Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20.

Similar presentations


Presentation on theme: "Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20."— Presentation transcript:

1 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20

2 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz2 CONTENTS u What is object-oriented development ? u Object-oriented process model u Object-oriented concepts u Object modeling technique u Unified Modeling Language (UML) u Concepts and Principles of Object Modeling u Object-oriented vs functional approach

3 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz3 What is OO Development ? u “New” way of thinking about problems using models organized around real world concepts. u The fundamental construct is the object Combines both data structure and operations in a single entity called an object. u Leads to reuse, faster software development and higher quality programs. u Easier to maintain Structure inherently decoupled Fewer side-effects

4 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz4 The OO process model u Moves through an evolutionary spiral u Emphasizes development of reuse capability

5 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz5 Object Oriented Concepts u Objects and Object Model Object: Data and operations relevant to some real world or significant program entity encapsulated into a monolithic unit accessible only through a well defined interface. For ex. File in the file system together with operations such as open, close, read, & write, Object Model: Describes the structure of the objects in the system –their identity, relationships to other objects, attributes and operations.

6 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz6 u Classification & Classes A class describes a group of objects with similar properties (attributes), common behavior (operations), common relationships to other objects, and common semantics. Object Modeling

7 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz7 Object Classes u Thus, a class is an abstraction that describes relevant properties and hides the rest. Represented diagrammatically as below. Class Name Attributes Operations

8 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz8 Object Modeling

9 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz9 Object Modeling u Attributes: An attribute is a data value held by the objects in a class. Name, age, and weight are attributes of Person objects.

10 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz10 Object Modeling u Operations and Methods : Operations : An operation is a function or transformation that may be applied to or by objects in a class. Each operation has a target object as an implicit argument. The behavior of the operation depends on the class of its target. Methods : A method is the implementation of an operation for a class. –Categories: 1) manipulate data, 2) perform computation, and 3) monitor for occurrence of controlling event.

11 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz11 u An operation may have arguments in addition to its target object. Such arguments parameterize the operation but do not affect the choice of method. Object Modeling

12 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz12

13 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz13 Class and Instance Polygon Vertices Border Color Fill Color Draw Erase Move Polygon v={(0,0),(0,1),(1,0)} BC = Red FC = Blue Draw Erase Move

14 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz14 Abstraction and Encapsulation

15 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz15 u Abstraction Isolate those aspects that are important and suppress (or hide) those that are unimportant (e.g., representations). Focus on what object is and does before deciding how it should be implemented. Abstraction allows dealing only with application domain concepts, not making design and implementation decision before problem is understood. Abstraction and Encapsulation

16 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz16 u Encapsulation (Information Hiding) Separates the external aspects of an object, which are accessible to other objects, from the internal implementation details of the object, which are hidden from other objects. u Combining Data and Operations: The OO approach combines the data structure and operations in a single entity. Abstraction and Encapsulation

17 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz17 Interfaces u Does not have an implementation of its own. u Other classes provide implementations of it. u Client classes are only interested in behavior. > Class Name Operations

18 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz18 Inheritance u Sharing of attributes and operations among classes based on hierarchical relationship.

19 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz19

20 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz20 Class and Subclass Polygon Vertices Border Color Fill Color Draw Erase Move Right Triangle Vertices Hypotenuse length Border Color Fill Color Draw Erase Move

21 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz21

22 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz22

23 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz23 Operations u Polymorphism The same “operation” may behave differently on different classes. E.g., the move operation behaves differently on a Window and ChessPiece. Operations may be overloaded when subclasses defined. –The compiler can distinguish based on the type of the operands in method invocations which operation is actually needed.

24 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz24 Polymorphism Car Paint Polygon Paint Triangle Paint Square Paint

25 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz25 Communication u Message: [destination, operation, params]

26 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz26 What Does OO Mean? u Pressman (Coad & Yourdon) Objects (identity) Classification Inheritance Communication u Rumbaugh Objects (identity) Classification Inheritance Polymorphism

27 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz27 Object Modeling Technique u Object modeling technique (OMT) extends from analysis thru design to implementation u Analysis model contains objects found in the application domain, including properties of object and their operations. u These application domain objects form a framework to the design model.

28 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz28 u The same seamless notation is used from analysis to design to implementation. u The system is modeled using three related but different view points. Object Model : Represents the static, structural, “data” aspects of the system. Dynamic Model : Represents the temporal, behavioral, “control” aspects of the system. Functional Model : Represents transformational, “functional” aspects of the system. Object Modeling Technique

29 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz29 Object Modeling u Links and Associations Link: A physical or conceptual connection between instances. E.g., Joe Smith Works-for Simplex company. Mathematically, a tuple, i.e., an ordered list of object instances. A link is an instance of an association. Associations : A group of links with common structure and semantics. E.g., a person Worksfor a company. All the links in an association connect objects from the same classes.

30 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz30

31 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz31 Object Modeling u Multiplicity: Specifies how many instances of one class may relate to a single instance of an associated class u Role Names: One end of an association. Binary association has two roles. u Link attributes May be defined for associations, e.g., if the association is “uses,” the link attribute might be one of permission.

32 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz32 Binary Association & Multiplicity

33 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz33 Ternary Association

34 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz34 Link Associations

35 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz35 Aggregation u A “part-whole” or “a-part-of” relationship

36 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz36 OO Software Process u Framework Identify major classes and connections. Do enough design to ensure they are implementable Extract reusable components and build prototype. Test to uncover errors and get customer feedback. Iterate on design and refine it. Engineer special objects (not in library). Assemble a new prototype. Test and obtain customer feedback. Iterate until satisfactory product obtained.

37 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz37 OO Metrics u Because of reuse, LOC not so useful u # of Scenario scripts, each a triplet of the form [initiator, action, participant], where Initiator = object initiating a request action = result of request (method invocation) participant = server object satisfying request u # of key [highly independent] classes u # of support classes (and ave. per key class) u # of subsystems

38 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz38 Possible Estimating Approach u Develop scenario scripts and estimate count u Determine the number of key classes u Categorize key classes Interface typeMultiplier No GUI2.0 Text-based user int.2.25 GUI2.5 Complex GUI3.0

39 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz39 Possible Estimating Approach u Estimate # of support classes by multiplying # key classes in each category by multiplier u Estimate # of person-days per class, e.g., 15-20 u Estimate the number of major iterations u There should be a contract deliverable for each major iteration

40 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz40 OO Progress Tracking u This needs to be done for each iteration (see text for list of specifics in each category) OO analysis completed OO design completed OO programming completed OO testing completed

41 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz41 Object-Oriented vs Structured Approach u Easier to maintain u Combines data structure and behavior in a single entity u Emphasizes object structure u Reuse more readily accomplished u Harder to maintain u May separate data and behavior u Emphasizes procedural structure u Reuse limited, hence possible delay in software construction

42 Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz42 Object-Oriented vs Structured Approach u Strong cohesion and weak coupling u Encapsulation, Inheritance and Polymorphism are strong features of OO software development u Harder to achieve weak Coupling and strong cohesion u Some languages support encapsulation and polymorphism, but rarely inheritance


Download ppt "Chapter 19 -- Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20."

Similar presentations


Ads by Google