object_oriented_concepts_(1).pptx
TRANSCRIPT
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 1/20
Binu B Nair
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 2/20
Review of Object oriented Concepts
Generalization
Inheritance
Dependency Association
Abstraction
Aggregation
Composition
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 3/20
object Data + Methods
object State + Behavior
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 4/20
It would have data:
How hungry it is
How frightened it is
Where it is
And methods:
eat, hide, run
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 5/20
A dependency is a semantic relationship
where a change to the influent or
independent modeling element may affect
the semantics of the dependent modelingelement.
The most general relationship between two
packages
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 6/20
Generalization is the process of extracting shared characteristics from
two or more classes, and combining them into a generalized superclass.
Shared characteristics can be attributes, associations, or methods.
Is-a relationship
Broader level inheritance
Eg: A student is a person.
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 7/20
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 8/20
If B is a subclass of A
A objects can be assigned to A variables
B objects can be assigned to B variables
B objects can be assigned to A variables, but A objects can not be assigned to B variables
Every B is also an A but not every A is a B
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 9/20
class Dog { ... }
class Pomeranian extends Dog { ... }
Dog myDog;
Dog rover = new Dog ();
Pomeranian yourPomeranian;Pomeranian myPomeranian = new Pomeranian ();
myDog = rover;
yourPomeranian = myPomeranian ;
myDog = myPomeranian ;
yourPomeranian = rover; yourPomeranian = (Pomeranian ) rover;
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 10/20
They can exist without each other
Is a relationship where all object have their
own lifecycle and there is no owner
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 11/20
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 12/20
An abstraction relationship is a dependency
between model elements that represents the
same concept at different levels of
abstraction or from different viewpointsOne model element, the client, is more
refined or detailed than the other, the
supplier.
Abstraction relationships do not usually havenames and appear as a dashed line with an
open arrow pointing from the detailed model
element to the general model element.
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 13/20
Derivation
Realization
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 14/20
Realization is a relationship between the
blueprint class and the object containing its
respective implementation level details
The relationship between the interface andthe implementing class
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 15/20
“Has-a” relationship
is a specialize form of Association
All object have their own lifecycle
Child object can not belongs to anotherparent object.
Department and teacher.
A single teacher can not belongs to
multiple departments, but if we delete the
department teacher object will not destroy.
We can think about “has-a” relationship
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 16/20
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 17/20
It is a strong type of Aggregation
The Death relationship
The lifetimes of both the objects are the
same.Manager and the project objects are
dependent on each other.
If one goes for garbage collection the other
also has to be garbage collected
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 18/20
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 19/20
??
7/30/2019 Object_Oriented_Concepts_(1).pptx
http://slidepdf.com/reader/full/objectorientedconcepts1pptx 20/20
Thanks ….!!!