OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting...
-
Upload
laila-hesselgrave -
Category
Documents
-
view
216 -
download
2
Transcript of OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting...
![Page 1: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/1.jpg)
OBJECT-ORIENTEDNESS
![Page 2: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/2.jpg)
What isObject-Orientedness?
model system as a collection ofinteracting objects
O-O Modelling O-O Programming
► similar conceptual philosophy
► different purpose
2/26
![Page 3: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/3.jpg)
Objectswhat is an object?
individuality
properties
►real world thing - something tangible
►conceptual / virtual / abstract
►all objects have identity
►all objects are distinguishable - twins
►identity - state – behaviour
►(identity - data - operations)
3/26
![Page 4: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/4.jpg)
there are many THINGS in the world
5/25
From: Sigfried S (1996). Understanding Object-Oriented Software Engineering
![Page 5: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/5.jpg)
the World our Model
From: Sigfried S (1996). Understanding Object-Oriented Software Engineering5/26
![Page 6: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/6.jpg)
Objects (cont..)
individual, identifiable entity (real or abstract)
with a well defined rolein the problem domain
6/26
![Page 7: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/7.jpg)
Object Propertiesidentity
state (data)
behaviour (operations/methods)
► property of an object which distinguishes it from all other objects
► attributes of an object
► attributes have values
► describes how object acts & reacts
► procedures / operations (messages)
7/26
![Page 8: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/8.jpg)
Object Properties(cont.)
attributes (data)
behaviour (operations/methods)
► descriptor (variable) that holds value e.g. name, weight, colour, model,
► may have same across classes e.g. weight
► procedure that may be applied to or by an object
e.g. Move, Open, Draw, ...
► all objects in a class share same operations
8/26
![Page 9: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/9.jpg)
Classes and Instancesinstance (object)
class
► unique individual
► all values unique
► individuality from differences in attribute values (but may differ in only location & orientation)
► abstraction - generalization
► group of objects with common properties
► differentiation in attributes
► attributes can have ranges / options
9/26
![Page 10: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/10.jpg)
10/26
similar THINGS can be GROUPED
From: Sigfried S (1996). Understanding Object-Oriented Software Engineering
10/25
![Page 11: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/11.jpg)
11/26From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design
![Page 12: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/12.jpg)
From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design 12/26
![Page 13: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/13.jpg)
Class Relationshipstaxonomical / typological
aggregation
others
► a_kind_of, a_type_of, is_a, an_instance_of ako, ato, isa, aio
► a_part_of, a_component_of apo, aco
► functional, ownership, connectivity, ... provides_access, owned_by, joins
13/26
![Page 14: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/14.jpg)
depends on purpose
Classificationbrings order
no simple recipe
► knowledge ordered hierarchically
► no perfect class structure & set of objects
► difficult - boundaries are fuzzy
► difficult to define precisely attributes & values e.g. cup and bowl
► different views
14/26
![Page 15: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/15.jpg)
Classification (cont.)
● superclass, subclass, instance
► general to specific
► fewer members - more specific
► ancestors - descendants
► parent - child
15/2615/25
![Page 16: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/16.jpg)
Inheritance
superclass, subclass, instance
C1
superclass
instance
superclasssubclass
subclass
A
B
C
ato
ato
aio
recursive
reuse
► subclass inherits all properties of superclass
► instance special case of subclass
► inherit ‘up the line’
►avoids redundancy
16/26
![Page 17: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/17.jpg)
From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design 17/26
![Page 18: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/18.jpg)
vehicle
landvehicle
watervehicle
amphibiousvehicle
car boat
Multiple Inheritance
ato ato
atoato ato ato
18/26
![Page 19: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/19.jpg)
Generalization / Specialization
generalization
specialization
► extract common characteristics
► create higher-level abstraction
► bottom-up
► top-down
► may constrain ancestor attributes e.g. circle special case of ellipse
must do one of above
► add new features - extension e.g. hinged door adds swing behaviour
19/26
![Page 20: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/20.jpg)
Aggregation / Decomposition
assembly / component
recursive
structural hierarchy
► special form of relationship
► aggregate object made up of component objects
► treated as one unit - an object
► orthogonal concept to generalization/specialization
► components may be aggregations
► part/whole vs subclass/class
► apo, aco vs ako, ato, isa, aio
20/2620/25
![Page 21: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/21.jpg)
lamp
fluorescentlamp
incandescentlamp
ballast starter socket
Aggregation / Decompositionaddition of components
base cover switch
ato
aco
acoaco
21/26
![Page 22: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/22.jpg)
lamp
fluorescentlamp
ballast starter
Aggregation / Decompositionaddition of components (cont.)
base cover switch
ato
aco
aco
L1
base1 cover1 switch1
aco
ballast1 starter1
isa
isaisa
isa
isaisa
22/26
![Page 23: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/23.jpg)
O-O Conceptsencapsulation / modularity
classification
inheritance
aggregation
► localize data & procedures in a module
► taxonomic / typologic hierarchy
► makes order
► reusability
► structural hierarchy
► hides / adds details
23/26
![Page 24: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/24.jpg)
O-O Languages● Smalltalk first popular OOL
● C++ strongly typed - lots of housekeeping
● Eiffel strongly typed - garbage collection
● CLOS (Common Lisp Object System) O-O extension of COMMON LISP encapsulation not enforced
● Objective C
● Java cleaned-up version of C++ - no pointers distributed 24/26
![Page 25: OBJECT-ORIENTEDNESS. What is Object-Orientedness? model system as a collection of interacting objects O-O Modelling O-O Programming ► similar conceptual.](https://reader033.fdocuments.us/reader033/viewer/2022051614/551af44955034606048b6233/html5/thumbnails/25.jpg)
O-O Databasesdatabases
O-O programming
OODMS
► relationships
► used to store persistent data
► data doesn’t vanish when program stops execution
► objects
► not persistent
► object information persistent
25/2625/25