Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object-Oriented Modeling

Similar presentations


Presentation on theme: "Object-Oriented Modeling"— Presentation transcript:

1 Object-Oriented Modeling

2 Phases of object-oriented systems development cycle

3 Object Object: An entity that has state, behavior, and identity.
Tangible: Person, place or thing. Concept or Event: Department, performance, marriage, registration. Artifact of the Design Process: User interface, controller, scheduler.

4 State, Behavior, Identity
State: Attribute types and values. Behavior: How an object acts and reacts. Behavior is expressed through operations that can be performed on it. Identity: Every object has a unique identity, even if all of its attribute values are the same.

5 Objects and Operations
Object Class: Set of objects that share a common structure and a common behavior. Class Diagram: Fig. 5-2a. Object or Instance Diagram: Fig. 5-2b. Operation: A function or service that is provided by all the instances of a class. Encapsulation: Hiding an object’s implementation details.

6 UML class and object diagrams
(a) Class diagram showing two classes

7 (b) Object diagram with two instances

8 Operations Types of Operations:
Constructor: Creates a new instance of a class. Query: Accesses the state of an object but does not alter its state. Update: Alters the state of an object.

9 Associations Association: Relationship among object classes (Fig. 5-3). Association Role: Role of an object in an association (e.g. Manager in the Manages association of Fig. 5-3a.) Multiplicity: How many objects participate in an association. Lower-bound..Upper bound. Examples: Figs 5-4,5.

10 Examples of binary association relationships
(a) University example

11 (b) Customer service example

12 Association Class Association Class: An association which has attributes or operations of its own or which participates in relationships with other classes. (Fig. 5-6,7)

13 Object diagram for customer order example

14 Association class and link object
(a) Class diagram showing association classes

15 (b) Object diagram showing link objects

16 Ternary relationship with association class

17 Derived attribute, association, and role

18 Generalization Common attributes, relationships, AND operations.
Subclass, superclass. (Fig. 5-9a) Abstract Class: No direct instances Concrete Class: Direct instances (Fig. 5-9b)

19 Examples of generalization, inheritance, and constraints
(a) Employee superclass with three subclasses

20 Constraints Overlapping (Fig. 5-10) Disjoint
Complete (“total specialization”) - all subclasses specified. Incomplete (“partial specialization”) - some subclasses specified.

21 Example of overlapping constraint

22 Class-Level Attribute
Class-Level Attribute: Specifies a value common to an entire class, rather than a specific value for an instance. (Fig. 5-11) “=“ is initial, default value.

23 Polymorphism Abstract Operation: Defines the form or protocol of the operation, but not its implementation. (calc-tuition in Fig 5-11) Method: The implementation of an operation. Polymorphism: Modifications in an operation to apply to different classes.

24 Overriding Inheritance
Overriding: The process of replacing a method inherited from a superclass by a more specific implementation of that method in a subclass. For Extension: add code. For Restriction: limit the method. (Fig. 5-12) For Optimization: improve code by exploiting restrictions imposed by the subclass.

25 Overriding inheritance

26 Multiple Inheritance Multiple Classification: An object is an instance of more than one class. Multiple Inheritance: A class inherits features from more than one superclass. (Fig. 5-13)

27 Aggregation Aggregation: A part-of relationship between a component object and an aggregate object. (Fig. 5-14) Composition: A stronger form of aggregation in which a part object belongs to only one whole object and exists only as part of the whole object. (solid diamond in Fig. 5-15) Recursive Aggregation: Fig

28 Additional Concepts Abstract Data Type (ADT): Define a new data type and a set of operations that can act upon it. Example: matrix.

29 Class diagram for Pine Valley Furniture Company


Download ppt "Object-Oriented Modeling"

Similar presentations


Ads by Google