Presentation is loading. Please wait.

Presentation is loading. Please wait.

The OOA Process - I Steps and Rules Objects and Structures.

Similar presentations


Presentation on theme: "The OOA Process - I Steps and Rules Objects and Structures."— Presentation transcript:

1 The OOA Process - I Steps and Rules Objects and Structures

2 The Steps of OOA - Part 1 Identify classes (objects) Identify key structures –Generalization (generalization – specialization, “ISA”) –Aggregation (whole – parts, “PART-OF”) –Association (relationship) Define attributes ===> Static Object Diagram ===> incomplete Object Dictionary

3 The Steps of OOA - Part 2 Define services via scenarios –Services (operations) per class/object –message passing between objects –coordination of message passing –states and transitions ===> Scenarios ===> complete Object Dictionary

4 OOA - Class Describes the structure and behavior of a set of similar objects in terms of: –attributes (variables, data-structures, smaller objects) –operations (services/methods) –states and possible transitions between states Participates in structures Specified in the object dictionary A “usual way” to model the “entities” in the domain of interest Employee name:String persNbr:Integer skills: List of Skill skill: Record.......... tellSkills(skills).....

5 OOA - Abstract Class NO instantiations possible a generalization of one or more objects with a uniform set of attributes and services Defines common attributes and services Used in classification structures to organize object hierarchies Has to be fully specified in the Object-Dictionary Label {abstract}

6 abstract Class – Example Defines an abstract class with 2 specific derived classes Programmer ProjectLeader Employee  abstract  name:String persNbr:Integer skills: List of Skill skill: Record.......... tellSkills(skills).....

7 OOA - Objects An “instance” of a class An object is an at run- time (in the running system) existing and acting unit that is structured like and behaves according to the class it is derived from. Usually the operations are not shown in a diagram. Martin: Employee name: „P. Martin“ persNbr: 4711 skills: OOAD, SWE, PRG........ Employee instance of :Employee instance of

8 Relations & Structures Generalization –also „specialization“ –with inheritance Aggregation –whole-part relation –„Composition“ as a special case Association –„free“ association –similar to ER diagrams Employee ProgrammerProjectLeader Computer CPU Terminal I/O Devices 1 1 1..2 1..* Project Employee 1..* 0..3 has

9 OOA - Generalization- Specialization groups objects based on similarity of attributes and services forms a class hierarchy by –generalization –specialization attributes, services, etc. are inherited by the more specialized from the more general objects gen spec1spec2

10 Employee ManagerProgrammer Inheritance name address experience courses list of prg-lang.

11 Employee Student Multiple Inheritance ==> Inheritance Lattices name address Major GPA Teaching Assistant

12 OOA - Aggregation groups objects by combining smaller parts into larger units forms a structure by –aggregation –decomposition cardinalities must be specified (min, max) no inheritance whole part1part2 (min,max) (min, max) (min, max)

13 OOA - Association provides free mapping between objects complements the two predefined structural types forms a network of objects by using binary relationship types Does not carry attributes supports access to partner-object (via “foreign key”) obj1 obj2 label (min,max)

14 ManagerDepartment manages (1,N)(1,1) Manages which department? Follow association. Since when? Attribute of...? access 1..*1

15 OOA - Attributes exist only as elements of an object attributes model –the data portion of the object –state information –foreign keys (implement association) no separate graphical representation (part of the object symbol) specified in the object dictionary

16 Scope of Attributes the data capsule principle –attributes are local to each object –attributes are global to all services in the object

17 During analysis and design we specify the attribute’s type and constraints. The initial value of an attribute is assigned during the creation of an object instance. Attribute values can be manipulated only by the object’s local services. Attributes keep their value until the object instance is explicitly deleted (persistance). An Attribute’s “Life-Cycle”

18 Attributes and Inheritance are inherited in a classification hierarchy inheritance is mandatory multiple inheritance is possible ===> position attributes as high in the classification hierarchy as possible

19 Attributes in the Object Dictionary specify for each attribute (= data dictionary) –name –informal description –purpose –range of values –related data items –formal data structure specification (e.g. BNF)

20 Back-ups

21 Class - remarks There are also –generic classes (templates) –interface classes –metaclasses –utility classes

22 Object - remarks Each object belongs to (at least) one class Attributes may hold values Operations can be triggered by messages to execute on the local values.

23 Polymorphism An operation is specified under the same name in multiple classes. The operation behaves different (class specific) in each class. Adaptation of an operation through over- writing. Prerequisites –inheritance in the class hierarchy –late binding –(dynamic typing) Employee  abstract  tellSkills new Programmer ProjectLeader tellSkills EmployeeType reportCode

24 Atm atm # req_withdrw req_dep req_balance req_int_rate Account acct # balance sec-code state withdrw dep prov_balance Savings_Acct add_on_interest prov_int_rate int_rate Trans_Rec trans_type date_time amount teller_ID (Static) class diagram Std_Acct has 0..* 1 AccountType withdrw  abstract  sec-code


Download ppt "The OOA Process - I Steps and Rules Objects and Structures."

Similar presentations


Ads by Google