SlideShare a Scribd company logo
1 of 26
Object-Orientation
Concepts
Lukito Edi Nugroho
Department of Electrical
Engineering
Gadjah Mada University
Software Complexity
• Why software is inherently complex ?
– The complexity of problem domain
• “Impedance mismatch” between users and developers: each
group lacks of expertise in the domain of the other
• Software requirements often change during development
– The difficulty of managing the development process
• Software engineers have to “engineer the illusion of
simplicity”
– Flexibility through software
• Software is a reflection of a mental product, it allows any kind
of abstraction imaginable by its creator
Software Complexity
Attacking Complexity
• “Divide et impera” principle → decomposition
– Breaking a complex problem into smaller and manageable parts
– The size of a subpart must not exceed the capacity of human
cognition
• Algorithmic decomposition
– Decomposition is based on process
• A module denotes an activity
• Smaller parts compose a larger process
• Object-oriented decomposition
– Decomposition is based on key abstractions in the problem
domain
– The world is viewed as a set of autonomous agents that
collaborate to perform some higher level behaviour
Algorithmic Decomposition
Object-Oriented Decomposition
The Object Model
• Characteristics of object-orientation
– Abstraction
– Encapsulation
– Modularity
– Hierarchy
The Object Model
• Abstraction
– Denotes the essential characteristics of an object that distinguish
it from all other kinds of objects
– Provides crisp definition of conceptual boundaries, relative to the
perspective of the viewer
– Focuses on the outside view of an object, separating its
essential behaviour from its implementation
– The most important issue in design is to decide upon the right
set of abstractions for a given problem domain
Abstraction
The Object Model
• Encapsulation
– The process of hiding all details of an object that do not
contribute to its essential characteristics
– Abstraction and encapsulation are complementary
• Abstraction focuses on the outside view
• Encapsulation prevents clients from seeing its inside view
where the behaviour of the abstraction is implemented
– Encapsulation provides explicit barriers among different
abstractions → limiting the size of cognitive entities
Encapsulation
The Object Model
• Modularity
– Modularity packages abstractions into discrete units
– Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled modules
• How modules are defined, i.e., how a system is partitioned
• How a module sees another module
– In design, we strive for high cohesive modules and low coupling
between modules
Modularity
The Object Model
• Hierarchy
– Hierarchy is a ranking or ordering of abstractions
– Two important hierarchies: the “kind-of” (class hierarchy) and
“part-of” (object hierarchy) relationships
Hierarchy
Objects
• The nature of an object
– A tangible and/or visible thing, or may be
perceived intellectually
– Has three essential properties
• State
• Behaviour
• Identity
Objects
Object State
• The state of an object encompasses:
– The (static) properties of the object
– Current (dynamic) values of each of these properties
• A property is an inherent or distinctive characteristics or feature that
contributes to making an object unique
• A value could be simple or denote another object
– Simple values are non-temporal, unchangeable, and non-
instantiated
– Object values exist in time, are changeable, instantiated, and
can be created, destroyed, and shared
Object State
• Example of object stateclass Circle {
int radius;
Color color;
Circle(int r, Color c) {
radius = r; color = c;
}
public setRadius(int r) {
radius = r;
}
public setColor(Color c) {
color = c;
}
}
Circle circle = new(10,blue);
circle.setColor(red);
Object Behaviour
• No objects live in isolation
– Objects are acted upon, and they act upon other objects
• Behaviour is how an object acts and reacts, in terms of state
changes and message passing
– Behaviour of an object is completely defined by its actions
– At the programming level, behaviour is implemen-ted by
methods or member functions
Object Behaviour
• Different kinds of operations
– Modifier: alters the state of an object
– Selector: accesses, but does not alter, the state of an
object
– Iterator: permits all parts of an object to be accessed
in a well-defined order
– Constructor: creates an object and initializes its state
– Destructor: frees the state of an object and destroys
the object
Object Behaviour
class Sensor{
Tanktank;
intalarm;
voidalarmOn() tank.fill(maxvol);{ }
}
class Tank{
intvolume;
voidfill(intv){
for(inti= 0; i v; i++)v++;<
}
}
sensor
alarmOn()
tank
fill(intv)
alarmOn()
fill(maxvol)
Object Identity
• Identity is a property of an object which distinguishes it from all other
objects
• It denotes a reference associated with the object it identifies
– Identity is a property that shows that an object “exists”
• in real world (as an abstraction)
• in memory (computer representation)
– An identity exists as long as the object it represents exists
• Object creation always creates an identity
• Object deletion destroys its identity
Object Identity
class Circle {
int radius;
Color color;
Circle(int r, Color c) {
radius = r; color = c;
}
public setRadius(int r) {
radius = r;
}
public setColor(Color c) {
color = c;
}
}
Circle circle1 = new(15,green);
Circle circle2 = new(10,red);
Circle circle3 = new(5,blue);
circle3
circle2
circle1
Relationships Among Objects
• Types of relationships
– “Using” relationship
– “Containing” relationship
• “Using” relationship
– Two objects have equal position in a hierarchy
– Unidirectional message passing
– Each object may play one of the following roles
• Actor: an object that can access other objects, but cannot be
accessed by other objects
• Server: an object that can only be accessed by other objects
• Agent: an object that can both access or be accessed by
other objects
– Example: see the Sensor and Tank object
Relationships Among Objects
• “Containing” relationship
classMachine{
Carburetor carb= newCarburetor();
Plugplug= newPlug();
Pistonpiston= newPiston();
...
}
Machine
Carburetor
PlugPiston

More Related Content

Similar to Lukito Edi Nugroho - Object Orientation Concepts

Object Modelling Technique " ooad "
Object Modelling Technique  " ooad "Object Modelling Technique  " ooad "
Object Modelling Technique " ooad "
AchrafJbr
 

Similar to Lukito Edi Nugroho - Object Orientation Concepts (20)

Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Software Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-iSoftware Engineering Lec5 oop-uml-i
Software Engineering Lec5 oop-uml-i
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes.pptx
Objects and Classes.pptxObjects and Classes.pptx
Objects and Classes.pptx
 
Objects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxObjects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Lecture 1 oop
Lecture 1 oopLecture 1 oop
Lecture 1 oop
 
Handout on Object orienetd Analysis and Design
Handout on Object orienetd Analysis and DesignHandout on Object orienetd Analysis and Design
Handout on Object orienetd Analysis and Design
 
Object Modelling Technique " ooad "
Object Modelling Technique  " ooad "Object Modelling Technique  " ooad "
Object Modelling Technique " ooad "
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 
Analysis
AnalysisAnalysis
Analysis
 
34. uml
34. uml34. uml
34. uml
 
OMTanalysis.ppt
OMTanalysis.pptOMTanalysis.ppt
OMTanalysis.ppt
 
OMTanalysis.ppt
OMTanalysis.pptOMTanalysis.ppt
OMTanalysis.ppt
 
Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0Object oriented analysis_and_design_v2.0
Object oriented analysis_and_design_v2.0
 
Unit IV Software Engineering
Unit IV Software EngineeringUnit IV Software Engineering
Unit IV Software Engineering
 
07 intro2 oop
07 intro2 oop07 intro2 oop
07 intro2 oop
 

More from belajarkomputer

Helen Alida Abilio - Manajemen proses
Helen Alida Abilio - Manajemen prosesHelen Alida Abilio - Manajemen proses
Helen Alida Abilio - Manajemen proses
belajarkomputer
 
Helen Alida Abilio - Manajemen memori
Helen Alida Abilio - Manajemen memoriHelen Alida Abilio - Manajemen memori
Helen Alida Abilio - Manajemen memori
belajarkomputer
 

More from belajarkomputer (20)

Yogie Saputra - Deadlock
Yogie Saputra - DeadlockYogie Saputra - Deadlock
Yogie Saputra - Deadlock
 
Sri Astuti - Penjadwalan CPU
Sri Astuti - Penjadwalan CPUSri Astuti - Penjadwalan CPU
Sri Astuti - Penjadwalan CPU
 
Bagas Perdana Putra - Pengenalan Sistem Operasi
Bagas Perdana Putra - Pengenalan Sistem OperasiBagas Perdana Putra - Pengenalan Sistem Operasi
Bagas Perdana Putra - Pengenalan Sistem Operasi
 
Suci Arrum Meilani - Manajemen Memori
Suci Arrum Meilani - Manajemen MemoriSuci Arrum Meilani - Manajemen Memori
Suci Arrum Meilani - Manajemen Memori
 
Agung Deswantoro Adi - Memori Virtual
Agung Deswantoro Adi - Memori VirtualAgung Deswantoro Adi - Memori Virtual
Agung Deswantoro Adi - Memori Virtual
 
Juliyah - Intelligensi Transfer Sinyal
Juliyah - Intelligensi Transfer SinyalJuliyah - Intelligensi Transfer Sinyal
Juliyah - Intelligensi Transfer Sinyal
 
Helen Alida Abilio - Sistem Keamanan
Helen Alida Abilio - Sistem KeamananHelen Alida Abilio - Sistem Keamanan
Helen Alida Abilio - Sistem Keamanan
 
Helen Alida Abilio - Deadlock
Helen Alida Abilio - DeadlockHelen Alida Abilio - Deadlock
Helen Alida Abilio - Deadlock
 
Helen Alida Abilio - Sinkronisasi
Helen Alida Abilio - SinkronisasiHelen Alida Abilio - Sinkronisasi
Helen Alida Abilio - Sinkronisasi
 
Helen Alida Abilio - Manajemen File
Helen Alida Abilio - Manajemen FileHelen Alida Abilio - Manajemen File
Helen Alida Abilio - Manajemen File
 
Helen Alida Abilio - Manajemen proses
Helen Alida Abilio - Manajemen prosesHelen Alida Abilio - Manajemen proses
Helen Alida Abilio - Manajemen proses
 
Helen Alida Abilio - Manajemen Memori
Helen Alida Abilio - Manajemen MemoriHelen Alida Abilio - Manajemen Memori
Helen Alida Abilio - Manajemen Memori
 
Helen Alida Abilio - Manajemen input dan output
Helen Alida Abilio - Manajemen input dan outputHelen Alida Abilio - Manajemen input dan output
Helen Alida Abilio - Manajemen input dan output
 
Helen Alida Abilio - Manajemen memori
Helen Alida Abilio - Manajemen memoriHelen Alida Abilio - Manajemen memori
Helen Alida Abilio - Manajemen memori
 
Helen Alida Abilio - Konkurensi
Helen Alida Abilio - KonkurensiHelen Alida Abilio - Konkurensi
Helen Alida Abilio - Konkurensi
 
Helen Alida Abilio - Manajemen Proses
Helen Alida Abilio - Manajemen ProsesHelen Alida Abilio - Manajemen Proses
Helen Alida Abilio - Manajemen Proses
 
Helen Alida Abilio - Struktur Sistem Operasi
Helen Alida Abilio - Struktur Sistem OperasiHelen Alida Abilio - Struktur Sistem Operasi
Helen Alida Abilio - Struktur Sistem Operasi
 
Helen Alida Abilio - Konsep Sistem operasi
Helen Alida Abilio - Konsep Sistem operasiHelen Alida Abilio - Konsep Sistem operasi
Helen Alida Abilio - Konsep Sistem operasi
 
Konsep sistem operasi
Konsep sistem operasiKonsep sistem operasi
Konsep sistem operasi
 
Helen Alida Abilio - Konsep Sistem Komputer
Helen Alida Abilio - Konsep Sistem KomputerHelen Alida Abilio - Konsep Sistem Komputer
Helen Alida Abilio - Konsep Sistem Komputer
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

Lukito Edi Nugroho - Object Orientation Concepts

  • 1. Object-Orientation Concepts Lukito Edi Nugroho Department of Electrical Engineering Gadjah Mada University
  • 2. Software Complexity • Why software is inherently complex ? – The complexity of problem domain • “Impedance mismatch” between users and developers: each group lacks of expertise in the domain of the other • Software requirements often change during development – The difficulty of managing the development process • Software engineers have to “engineer the illusion of simplicity” – Flexibility through software • Software is a reflection of a mental product, it allows any kind of abstraction imaginable by its creator
  • 4. Attacking Complexity • “Divide et impera” principle → decomposition – Breaking a complex problem into smaller and manageable parts – The size of a subpart must not exceed the capacity of human cognition • Algorithmic decomposition – Decomposition is based on process • A module denotes an activity • Smaller parts compose a larger process • Object-oriented decomposition – Decomposition is based on key abstractions in the problem domain – The world is viewed as a set of autonomous agents that collaborate to perform some higher level behaviour
  • 7. The Object Model • Characteristics of object-orientation – Abstraction – Encapsulation – Modularity – Hierarchy
  • 8. The Object Model • Abstraction – Denotes the essential characteristics of an object that distinguish it from all other kinds of objects – Provides crisp definition of conceptual boundaries, relative to the perspective of the viewer – Focuses on the outside view of an object, separating its essential behaviour from its implementation – The most important issue in design is to decide upon the right set of abstractions for a given problem domain
  • 10. The Object Model • Encapsulation – The process of hiding all details of an object that do not contribute to its essential characteristics – Abstraction and encapsulation are complementary • Abstraction focuses on the outside view • Encapsulation prevents clients from seeing its inside view where the behaviour of the abstraction is implemented – Encapsulation provides explicit barriers among different abstractions → limiting the size of cognitive entities
  • 12. The Object Model • Modularity – Modularity packages abstractions into discrete units – Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules • How modules are defined, i.e., how a system is partitioned • How a module sees another module – In design, we strive for high cohesive modules and low coupling between modules
  • 14. The Object Model • Hierarchy – Hierarchy is a ranking or ordering of abstractions – Two important hierarchies: the “kind-of” (class hierarchy) and “part-of” (object hierarchy) relationships
  • 16. Objects • The nature of an object – A tangible and/or visible thing, or may be perceived intellectually – Has three essential properties • State • Behaviour • Identity
  • 18. Object State • The state of an object encompasses: – The (static) properties of the object – Current (dynamic) values of each of these properties • A property is an inherent or distinctive characteristics or feature that contributes to making an object unique • A value could be simple or denote another object – Simple values are non-temporal, unchangeable, and non- instantiated – Object values exist in time, are changeable, instantiated, and can be created, destroyed, and shared
  • 19. Object State • Example of object stateclass Circle { int radius; Color color; Circle(int r, Color c) { radius = r; color = c; } public setRadius(int r) { radius = r; } public setColor(Color c) { color = c; } } Circle circle = new(10,blue); circle.setColor(red);
  • 20. Object Behaviour • No objects live in isolation – Objects are acted upon, and they act upon other objects • Behaviour is how an object acts and reacts, in terms of state changes and message passing – Behaviour of an object is completely defined by its actions – At the programming level, behaviour is implemen-ted by methods or member functions
  • 21. Object Behaviour • Different kinds of operations – Modifier: alters the state of an object – Selector: accesses, but does not alter, the state of an object – Iterator: permits all parts of an object to be accessed in a well-defined order – Constructor: creates an object and initializes its state – Destructor: frees the state of an object and destroys the object
  • 22. Object Behaviour class Sensor{ Tanktank; intalarm; voidalarmOn() tank.fill(maxvol);{ } } class Tank{ intvolume; voidfill(intv){ for(inti= 0; i v; i++)v++;< } } sensor alarmOn() tank fill(intv) alarmOn() fill(maxvol)
  • 23. Object Identity • Identity is a property of an object which distinguishes it from all other objects • It denotes a reference associated with the object it identifies – Identity is a property that shows that an object “exists” • in real world (as an abstraction) • in memory (computer representation) – An identity exists as long as the object it represents exists • Object creation always creates an identity • Object deletion destroys its identity
  • 24. Object Identity class Circle { int radius; Color color; Circle(int r, Color c) { radius = r; color = c; } public setRadius(int r) { radius = r; } public setColor(Color c) { color = c; } } Circle circle1 = new(15,green); Circle circle2 = new(10,red); Circle circle3 = new(5,blue); circle3 circle2 circle1
  • 25. Relationships Among Objects • Types of relationships – “Using” relationship – “Containing” relationship • “Using” relationship – Two objects have equal position in a hierarchy – Unidirectional message passing – Each object may play one of the following roles • Actor: an object that can access other objects, but cannot be accessed by other objects • Server: an object that can only be accessed by other objects • Agent: an object that can both access or be accessed by other objects – Example: see the Sensor and Tank object
  • 26. Relationships Among Objects • “Containing” relationship classMachine{ Carburetor carb= newCarburetor(); Plugplug= newPlug(); Pistonpiston= newPiston(); ... } Machine Carburetor PlugPiston

Editor's Notes

  1. dipandang sebagai suatu aktifitas.. sehinggan setiap kotak memekai kata kerja