260 likes | 340 Views
OBJECT-ORIENTEDNESS. KCDCC. model system as a collection of interacting objects. O-O Modelling <--> O-O Programming. similar conceptual philosophy. different purpose. WHAT IS OBJECT-ORIENTEDNESS?. KCDCC. what is an object?. real world thing - something tangible.
E N D
OBJECT-ORIENTEDNESS KCDCC
model system as a collection of interacting objects O-O Modelling <--> O-O Programming similar conceptual philosophy different purpose WHAT IS OBJECT-ORIENTEDNESS? KCDCC
what is an object? real world thing - something tangible conceptual / virtual / abstract individuality all objects have identity all objects are distinguishable - twins properties identity - state - behaviour (identity - data - operations) OBJECTS KCDCC
There are many THINGS in the World From: Sigfried S (1996). Understanding Object-Oriented Software Engineering
The World Our Model 5/26 From: Sigfried S (1996). Understanding Object-Oriented Software Engineering
individual, identifiable entity (real or abstract) with a well defined role in the problem domain OBJECTS (cont..) KCDCC
identity property of an object which distinguishes it from all other objects state (data) attributes of an object attributes have values behaviour (operations/methods) describes how object acts & reacts procedures / operations (messages) OBJECT PROPERTIES KCDCC
attributes (data) descriptor (variable) that holds value e.g. name, weight, colour, model, may have same across classes e.g. weight behaviour (operations/methods) function or procedure that may be applied to or by an object e.g. Move, Open, Draw, ... all objects in a class share same operations KCDCC OBJECT PROPERTIES (cont.)
instance (object) unique individual all values unique individuality from differences in attribute values (but may differ in only location & orientation) class abstraction - generalization group of objects with common properties differentiation in attributes attributes can have ranges / options KCDCC CLASSES AND INSTANCES
Similar THINGS can be GROUPED 10/26 From: Sigfried S (1996). Understanding Object-Oriented Software Engineering
From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design
From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design
taxonomical / typological a_kind_of, a_type_of, is_a, an_instance_of ako, ato, isa, aio aggregation a_part_of, a_component_of apo, aco others functional, ownership, connectivity, ... provides_access, owned_by, joins KCDCC CLASS RELATIONSHIPS
brings order knowledge ordered hierarchically linked to categorization no simple recipe no perfect class structure & set of objects difficult - boundaries are fuzzy e.g. where does knee begin and end difficult to define precisely attributes & values e.g. cup and bowl different views CLASSIFICATION depends on purpose KCDCC
superclass, subclass, instance general to specific fewer members - more specific ancestors - descendants parent - child CLASSIFICATION (cont.) 15/26 KCDCC
superclass, subclass, instance subclass inherits all properties of superclass instance special case of subclass superclass A recursive ato inherit ‘up the line’ B superclass subclass ato if class B subclass of class A and class C subclass of class B then class C inherits from class B and class A C subclass aio C1 instance reuse avoids redundancy INHERITANCE KCDCC
From: Rumbaugh et al. (1991). Object-Oriented Modeling and Design
vehicle MULTIPLE INHERITANCE ato ato land vehicle water vehicle ato ato ato ato car amphibious vehicle boat 18/26
generalization extract common characteristics create higher-level abstraction bottom-up specialization add new features - extension e.g. hinged door adds swing behaviour may constrain ancestor attributes e.g. circle special case of ellipse must do one of above top-down GENERALIZATION / SPECIALIZATION KCDCC
assembly / component special form of relationship aggregate object made up of component objects treated as one unit - an object recursive components may be aggregations structural hierarchy orthogonal concept to generalization/specialization part/whole vs subclass/class apo, aco vs ako, ato, isa, aio KCDCC AGGREGATION / DECOMPOSITION 20/26
fluorescent lamp incandescent lamp KCDCC AGGREGATION / DECOMPOSITION addition of components lamp aco ato switch base cover aco aco socket ballast starter
KCDCC AGGREGATION / DECOMPOSITION addition of components (cont.) lamp aco ato switch base cover isa fluorescent lamp isa aco L1 ballast starter isa isa aco isa isa switch1 base1 cover1 ballast1 starter1 22/26
encapsulation / modularity localize data & procedures in a module classification taxonomic / typologic hierarchy makes order inheritance reusability aggregation structural hierarchy hides / adds details KCDCC O-O CONCEPTS
KCDCC 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
databases relationships used to store persistent data data doesn’t vanish when program stops execution O-O programming objects not persistent OODMS object information persistent KCDCC O-O DATABASES 25/26
CAD systems & applications implemented using O-O technology systems create and manipulate objects information embedded in objects data exchange & integration use O-O concepts no standard model for O-O systems concepts of state and behaviour fundamental KCDCC IMPACT OF 0-0 SYSTEMS ON MODELLING 26/26