Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Oriented Analysis and Design

Similar presentations


Presentation on theme: "Object Oriented Analysis and Design"— Presentation transcript:

1 Object Oriented Analysis and Design
Agenda Object basics (continued) Encapsulation & Information Hiding Class Hierarchy Inheritance Polymorphism Associations Aggregations

2 Encapsulation & Information Hiding:
Object basics: Encapsulation & Information Hiding: An object is said to encapsulate the data & a program No object can operate directly on another object’s data Object’s internal format is insulated from other object’s Private Protocol Public Protocol Massages Data Permissible operations

3 Encapsulation & Information Hiding:
Object basics: Encapsulation & Information Hiding: Encapsulation & Information Hiding: Very general encapsulation mechanisms are private, public & protected Public members may be accessed from anywhere Private members are accessible only from within a class Protected members can be accessed only from subclasses

4 Encapsulation & Information Hiding:
Object basics: Encapsulation & Information Hiding: An important factor in achieving encapsulation is the design of different classes of objects that operate using common protocol Protocol is an interface to the object TV contains many complex components, but you do not need to know about them to use it Data abstraction is a benefit of the object oriented concepts that incorporates encapsulation & polymorphism

5 Object basics: Class Hierarchy:
An object oriented system organize classes into a super class – subclass hierarchy Different properties and behaviors are used as the basis for making distinction between super & subclasses A subclass inherits all of the properties & methods defined in a super class Eliminates duplication by allowing classes to share & reuse behaviors

6 Object basics: Inheritance:
A relationship between classes where one class is the parent of another class It allows classes to share & reuse behavior & attributes We can “build on what we already have” & “reuse what we already have”

7 Multiple Inheritance:
Object basics: Multiple Inheritance: OO systems permit a class to inherit from more than one superclass This kind of inheritance is referred to as multiple inheritance For example utility vehicle inherits from Car and Truck classes

8 Object basics: Polymorphism: Poly means “many” & morph means “form”
Same operation may behave differently on different objects Draw message can be sent to many objects like triangle, circle or line & each object could act differently Polymorphism is the main difference between a message and a subroutine call It allows us write generic, reusable code more easily, because we can specify general instructions & delegate the implementation details to the object involved

9 Object basics: Associations: Represents relationship between objects
For example a pilot can fly planes. Associations are Bidirectional An important issue in association is cardinality

10 Object basics: Associations: Client server association:
A special form of association is a client-server relationship. This relationship can be viewed as one-way interaction: one object (client) requests the service of another object (server). PrintServer Item Request for printing

11 Object basics: Aggregations: Aggregation is a form of association
Objects are composed of & may contain other objects One object’s attributes can reference to other objects, where an attribute can be object itself Example Category Book Publication Author

12 Object basics: Aggregations: Example


Download ppt "Object Oriented Analysis and Design"

Similar presentations


Ads by Google