Anda di halaman 1dari 10

1. Introduction to Object Oriented Paradigm 1.

1 Overview of OMT
The Object Modeling Technique (OMT) software engineering methodology is an example of a software engineering methodology that deals with object-oriented development in the analysis design phases. The Analysis Phase consists of understanding and modeling the problem statement that includes a list of goals and the domain within which it operates. This phase provides a conceptual overview of the proposed system. This problem statement is then expanded into three views, or models: 1) An Object Model 2) A Dynamic Model 3) A Functional Model Object Model: The Object Model describes the structure of the objects in the system their identity, their relationships to other objects, their attributes, and their operations graphically using object class diagrams containing object classes and their relationships. The object model depicts the primary view of how the real world in which the system interacts is divided and the overall decomposition of the system. The object model provides the framework into which the other models are placed. Classes are arranged into hierarchies sharing common structure and behavior and are associated with other classes. Classes define the attributes carried by each object instance and the operations that each object performs or undergoes. Dynamic Model: The Dynamic Model describes those portion of the system which are concerned with the sequencing of operations and time - events that cause state changes, sequences of events, states that define the context for events, and the organization of events and states. The dynamic model captures control information without regard for what the operations act on or how they are implemented. The dynamic model includes event trace diagrams describing scenarios. State diagrams represent the dynamic model graphically. A state corresponds to the interval between two events received by an object and describes the "value" of the object for that time period. Functional Model: The Functional Model describes computations and specifies those portions of the system concerned with transformations of values - functions, mappings, constraints, and functional dependencies. The functional model captures what the system does, without regard to how or when it is done. The functional model is represented

graphically with multiple data flow diagrams, which show the flow of values from external inputs, through operations and internal data stores, to external outputs. The System Design Phase follows the analysis phase. During system design, the overall structure and style are decided. The system is organized into subsystems that are then allocated to processes and tasks. The architecture provides the context in which more detailed decisions are made in later design stages. The Object Design Phase follows the system design phase. This phase determines the full definitions of the classes and associations used in the implementation, as well as interfaces and algorithms of the methods used to implement operations. It also adds internal objects for implementation and optimizes data structures and algorithms. Summary 1. Develop a Problem Statement. 2. Build an Object Model: 1. Identify object classes. 2. Develop a data dictionary for classes, attributes, and associations. 3. Add associations between classes. 4. Add attributes for objects and links. 5. Organize and simplify object classes using inheritance. 6. Test access paths using scenarios and iterate the above steps as necessary. 7. Group classes into modules, based on close coupling and related function. 3. Build a Dynamic Model: 1. Prepare scenarios of typical interaction sequences. 2. Identify events between objects and prepare an event trace for each scenario. 3. Prepare an event flow diagram for the system. 4. Develop a state diagram for each class that has important dynamic behavior. 5. Check for consistency and completeness of events shared among the state diagrams. 4. Build a Functional Model: 1. Identify input and output values. 2. Use data flow diagrams as needed to show functional dependencies. 3. Describe what each function does. 4. Identify constraints. 5. Specify optimization criteria. 5. Verify, iterate, and refine the three models: 1. Add most important operations to the object model.

2. Verify that classes, associations, attributes and operations are consistent and complete, check with problem statement. 3. Iterate steps to complete the analysis.

1.2 Types of Other Programming Paradigm and Object Oriented Paradigm: 1.2.1 Procedure Based ProgrammingProblem 1.2.2 Procedure Oriented Programming
Object-based programming (OBP) deals with the creation and use of objects. Objectoriented programming (OOP) encapsulates data (attributes) and methods (behaviors) into objects; the data and methods of an object are intimately tied together. Objects have the property of information hiding. Objects might know how to communicate with one another across well-defined interfaces, but they normally are not allowed to know how other objects are implemented. Keywords public and private are access modifiers. Fields and methods declared with access modifier public are accessible wherever the program has a reference to an object of the class in which they are declared. Fields and methods declared with access modifier private are accessible only to methods of the class in which they are declared. Instance variables are normally declared private and methods are normally declared public. A constructor has same name as its class and initializes the instance variables of an object of the class when the object is instantiated. Constructors can be overloaded. Constructors can take arguments, but cannot specify a return type. How to implement? The following steps necessary to object-based programming: 1. Translate classes into structures 2. Pass arguments to methods 3. Allocate storage for objects 4. Implement method resolution

5. Implement associations 6. Encapsulate internal details of classes 7. Implement inheritance in data structures

1.2.3 Object-Oriented Programming


Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. Definition: A type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. Object Oriented Programming as an approach that provides a way of modularizing program by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand. Object Oriented Programming is the most recent concept among programming paradigms and still mean different thing to different people. Thus, an object is considered to be partitioned area of operation memory that stores data and set of operations that can access that data. Since, the memory partitions are variety of different programs without modifications. The major motivating factor in the invention of object _oriented programming approach is to remove some of the (drawbacks) flows encountered in procedural approach. Object Oriented Programming treats data as a critical element (important) in the program development and does not allow it flow freely around the system. It ties data more closely to the function that operate on it, and protects it from accidental modification from outside functions. Object Oriented Programming allows decomposition of the problem into a number of entities called Object and then builds data and function s around these objects. The organization of data and function in Object Oriented Programming is shown as in figure.

Object A Data

Object B Data

Function

Function

Object C Function

Data

Organization of data and function in object oriented programming. The data of an object can be accessed only by the function associated with that object. However, function of one object can access the function of the other objects. Some of the striking features of Object Oriented Programming are: Emphasis is on data rather than procedure. Programs are divided into what are known as Objects. Data structures are assigned such that they characterize the Objects. Functions that operate on the data of an object are tied together in the data structure. Data is hidden and cannot be accessed by external functions. Object may communicate with each other through functions. New data and functions can be easily added whenever necessary. Follows bottom-up approach in program design.

1) 2) 3) 4) 5) 6) 7) 8)

1.2.4 Object Based Programming:

Object-based programming (OBP) deals with the creation and use of objects. Objectoriented programming (OOP) encapsulates data (attributes) and methods (behaviors) into objects; the data and methods of an object are intimately tied together. Objects have the property of information hiding. Objects might know how to communicate with one another across well-defined interfaces, but they normally are not allowed to know how other objects are implemented. Keywords public and private are access modifiers. Fields and methods declared with access modifier public are accessible wherever the program has a reference to an object of the class in which they are declared. Fields and methods declared with access modifier private are accessible only to methods of the class in which they are declared. Instance variables are normally declared private and methods are normally declared public. A constructor has same name as its class and initializes the instance variables of an object of the class when the object is instantiated. Constructors can be overloaded. Constructors can take arguments, but cannot specify a return type.

1.2.5 Advantages and disadvantages of object oriented paradigm: Advantages:


1) OOP provides a clear modular structure for programs which makes it good for defining abstract datatypes where implementation details are hidden and the unit has a clearly defined interface. 2) OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. 3) OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces. 4) IS easier to maintain beacause its structure is inherently decoupled. 5) Leads to reuse which in turn leads to faster software development and higher quality programs.

6) A single source for all outputs printed manual is created using tool designed for that purpose content is created and edited. 7) OO design uses objects in programming language, which is useful to implement human thoughts into programming. 8) Information hiding and data abstraction increase reliability and help decouple the procedural and representational specification from its implementation. 9) Dynamic binding increases flexibility. 10) Inheritance and coupled with dynamic binding enhance the reusability. 11) Many OO languages provides extendable standard class library, so it saves a lot of coding and debugging effort and also allows to build reliable program. 12) OO design involves objects which are closely relate in one to one manner with real world so it is easier to design. 13) Object Orientation provides many more advantages likeGive advantage in the production and maintenance Reduce development times High degree of code sharing

Disadvantages:
The major disadvantage of Object Oriented Language is the runtime time cost of dynamic binding mechanism.In early days there are many disadvantages of adopting Object Orientation in software development. Compiler overhead Runtime overhead Re-orientation of software developer to object oriented thinking Requires the mastery over the following areas Software Engineering Programming Methodology Benefits only in long run while managing large software project.

1.3 Basic of Object Modeling & Design 1.3.1 Objects and Classes:
Objects are basic run-time entities in an object-oriented system. An object can be a person, a place or any item that the program has to handle. Programming problems are analyzed in terms of objects and the nature of communication between them. The objects should be selected in such a way that they match closely with real-world objects.

Objects takes up space in the memory and have an associated address like structure in C. When program is executed, objects interact by sending messages to one another. For example if student and result are two objects in a program, then the student object may send a message to result object requesting for result. Each object contains data and code to manipulate the data.

Object: Student DATA Id Name Marks FUNCTIONS Total Display [Fig: Object Representation] Class is a user defined data type, which contains set of data and code of an object. And objects are referred as variables of type class. Objects with the same data structure and behavior are grouped into a class. Each class describes a possibly infinite set of individual objects; each object is said to be an instance of its class and each instance of the class has its own value for each attribute but shares the attribute name and operations with other instances of the class. The following points are considered: 1) Class is a template that unites data and operations. 2) Class is an abstraction of the real world entities with similar objectives. 3) Class identifies a set of similar objects. 4) Class is an implementation of abstract data type;

1.3.2 Links and Associations:


Links and associations are the means for establishing relationships among objects and Classes. A link is a physical or conceptual connection between object instances. For example, A person works for Simplex Company. Mathematically link is defined as a tuple that is an ordered list of object instances. A link is an instance of an association.

An association describes a group of links with common structure and common semantics. For example, a person Works-for a company. All the links in an association connect objects form the same classes. Associations and links often appear as verbs in a problem statement. An association describes a set of potential links in the same way that a class describes a set of potential objects. Associations are inherently bi-directional. The name of a binary association usually reads in a particular direction, but the binary association can be traversed in either direction. The direction implied by the name is the FORWARD direction; the opposite direction is the inverse direction. For example, Words for connects a person to company. The inverse of Worked for could be called Employs, and connects a company to a person. In reality, both directions of traversal are equally meaningful, and refer to the same underlying association; it is only the names that establish a direction. Associations are often implemented in programming languages as pointers form one object to another. A pointer is an attribute in one object that contains an explicit reference to another object For example, a data structure for Person might contain an attribute employees that points to a set of Employee objects. Implementing associations as pointers is perfectly acceptable, but association should not be modeled this way. A link shows a relationship between two objects. Modeling a link as a pointer disguises the fact that the link is not part of either object by itself, but depends on both of them together. A company is not part of a person, and a person is not part of company. Furthermore, using a pair of matched pointers, such as the pointer from Person to Company and the pointer from Company to a set of Employee, hides the fact that the forward and inverse pointers from Company to a set of Employee, hides the fact that the forward and inverse pointers and dependent on each other. All connections among classes should therefore be modeled as associations, even in designs for programs. We must see that associations are not just database constructs, although relational database are built on the concept of associations.

1.3.6 Identifying domain classes and relationships:


Following Figure shows the basic domain modeling concepts in our framework. Domain Classes provide the types for the objects of the application domain. . .

Attirbute

Domain class

Relationship

Index

Relationship 1:1

Relationship 1:n

Relationship m:n

Index Architecture

Relationship Index Architecture

The domain classes for an application can be organized in a class hierarchy with single inheritance relations among classes. For example, the domain class Diagram is a subclass of Notation. Domain classes are further characterized by their Attributes and Relationships. We support binary relationships between domain classes, classified by their cardinality (1:1, 1:n, m:n). In addition we allow to specify a key for the n-side of a 1:n relationship.

Domain Class

Attribut e

Super Class Sub Class


Classes, Attributes Inheritance

Anda mungkin juga menyukai