Ch 5 Presentation

560 views

Published on

Published in: Travel, Business
  • Be the first to comment

  • Be the first to like this

Ch 5 Presentation

  1. 1. Ch 5 PresentationOrganizing an Object Model<br />David Morales<br />
  2. 2. How to Organize an Object Model<br />Complete each task in the proper order<br />Include proper amount of detail in each step<br />Revise and edit <br />Ensure data is correct and all necessary info is included<br />Add additional information where needed<br />Ensure all subsequent steps reflect update<br />Example: if an additional class is needed, then all following steps need to show the new class<br />
  3. 3. Steps for Creating an Object Model<br />Tasks in order<br />Identify and define objects<br />Define Relationships between objects <br />Create a Relationship diagram<br />Indentify the actors and use cases<br />Create a Use Case Diagram<br />
  4. 4. Steps for Creating an Object Model<br />Tasks in order (continued)<br />Identify cardinality and UML Notation<br />Create a Class Diagram<br />Create a Sequence Diagram<br />Create a Sate Transition Diagram<br />Create an Activity Diagram<br />
  5. 5. Steps for Creating an Object Model<br />All tasks are sequential<br />Each step depends on data generated from previous steps<br />Additional information can be added to a previous task regardless of what step of the process you are on<br />Updates must be reflected in all the tasks that follow the task that was updated<br />
  6. 6. Identify and Define Objects<br />Objects represent a real person, place, event, or transaction<br />Each object contains attributes, methods, and messages<br />Attributes describe the class<br />Methods are tasks and functions the object can perform when it receives a message<br />A message is a command<br />
  7. 7. Identify and Define Objects<br />Steps:<br />1. Add new student instance<br />2. Record employee number<br />3. Record employee name<br />4. Record address<br />5. Record telephone number<br />6. Record date of birth<br />7. Record sex<br />8. Record title, rate of pay<br />9. Record deductions<br />10. Record state<br />11. Save new employee data<br />Method:<br />ADD EMPLOYEE<br />EMPLOYEE<br />Attributes<br />Employee number<br />Employee name<br />Address<br />Telephone number<br />Date of birth<br />Sex<br />Title, rate of pay<br />Deductions<br />State<br />Methods<br />Add new<br />Change name<br />Change address<br />Change Telephone<br />Change deductions<br />Change state<br />Characteristics that describe the EMPLOYEE object<br />Tasks that the EMPLOYEE object can perform<br />Objects and methods are represented visually<br />Object<br />Method<br />Message: ADD NEW<br />Tells the EMPLOYEE class to perform all the steps needed to add an EMPLOYEE<br />
  8. 8. Identify and Define Objects<br />EMPLOYEE<br />Attributes<br />Employee number<br />Employee name<br />Address<br />Telephone number<br />Date of birth<br />Sex<br />Title, rate of pay<br />Deductions<br />State<br />Methods<br />Add new<br />Change name<br />Change address<br />Change Telephone<br />Change deductions<br />Change state<br />Characteristics that describe the EMPLOYEE object<br />Tasks that the EMPLOYEE object can perform<br />Each object can have different instances<br />There are many employees, each employee has his/her own record<br />Instances of EMPLOYEE Object<br />0392<br />David Morales<br />9408 Worman Dr, Stafford<br />555-555-5555<br />29Mar1983<br />Male<br />Help Desk Tech, 35k<br />0<br />VA<br />0023<br />Melissa Barnes<br />1020 Fleet St, Stafford<br />555-555-1254<br />03Aug1971<br />Female<br />Accounting Manager, 75k<br />3<br />VA<br />
  9. 9. Define Relationships between Objects<br />Relationships enable objects to communicate and interact as the perform functions and transactions<br />They describe <br />What objects need to know about each other<br />How they respond to changes in other objects<br />The effects of member ship in classes, superclasses and sub-classes<br />
  10. 10. Define Relationships between Objects<br />EMPLOYEE<br />Attributes<br />Employee number<br />Address<br />Telephone number<br />Title, rate of pay<br />Deductions<br />State<br />PERSON<br />MANAGER<br />Attributes<br />Name<br />Date of birth<br />Attributes<br />Methods<br />Add new<br />Change name<br />Change address<br />Change Telephone<br />Change deductions<br />Change state<br />Methods<br />Breath<br />Eat<br />Sleep<br />Objects belong to classes, classes belong to superclasses, and classes can have sub-classes<br />Class<br />Class name<br />Superclass<br />Superclass name<br />Uncommon attributes<br />Sub-class<br />Common attributes<br />Sub-class name<br />Belongs to<br />Uncommon attributes<br />Belongs to<br />Common methods<br />Uncommon methods<br />Uncommon methods<br />
  11. 11. Create Object Relationship Diagram<br />EMPLOYEE<br />DIRECTOR<br />OFFICE STAFF<br />MANAGER<br />Provides a visual overview of the system and the relationships between the various objects within<br />Below is a partial diagram<br />Is a<br />Supervises<br />Supervises<br />
  12. 12. Identify the Actors and Use Case<br />An actor is an external entity<br />An actor initiates a use case by requesting information <br />A use case represents the steps in a specific business function or process<br />Issues<br />Generate Paycheck<br />Employee<br />
  13. 13. Use Case Diagram<br />Visual summary of several related use cases<br />Initiates<br />Create Timesheet Entry<br />Notifies<br />Department head<br />Issues<br />Notifies<br />Generate Paycheck<br />Initiates<br />Calculate payroll<br />Employee<br />Payroll clerck<br />
  14. 14. Identify cardinality<br />Cardinality describes how instances of one class relate to instances of another class<br />Example: An employee can have no payroll deductions or many payroll deductions, thus it would be a zero or many relationship<br />Example: An employee may have one spouse or no spouse, thus it would be a zero to one relationship<br />
  15. 15. Identify Cardinality – UML Notation<br />How cardinality is noted with UML<br />1<br />0..*<br />1<br />0..1<br />1<br />1<br />1<br />1..*<br />
  16. 16. Class Diagram<br />Represents a detailed view of a single use case<br />Shows the classes the participate in the use case<br />Documents the relationships among the classes<br />Maintained for<br />1<br />0..*<br />1<br />Manages<br />0..*<br />Notifies<br />1<br />0..*<br />Submits<br />Based on<br />1<br />1..*<br />1..*<br />1<br />
  17. 17. Sequence Diagram<br />Dynamic model of a use case<br />Shows the interaction among classes during a specified time period<br />Graphically documents the use case by showing the classes, messages and the timing of messages<br />
  18. 18. Sequence Diagram<br />EMPLOYEE<br />STOCK TRANSFER<br />PAYROLLACTION<br />Sequence diagram for CHANGE CONTRIBUTIONS function <br />Change Contributions<br />Change Contributions<br />
  19. 19. State Transition Diagram<br />Shows how an object changes from one state to another<br />Depends on events that affect the object<br />All possible states must be shown in the diagram<br />Example for EMPLOYEE object<br />Future<br />Current<br />Past<br />Retires<br />Prospective<br />hire<br />Quits<br />Meets <br />Requirements<br />Gets fired<br />
  20. 20. Activity Diagram<br />Resembles a horizontal flow chart<br />Show the actions and events as the occur<br />Show the order in which actions take place and identify outcomes<br />Activity diagram for CHANCE CONTRIBUTIONS scenario<br />Change stock purchase deduction<br />Change employee deduction<br />Employee changes contributions<br />Start<br />End<br />

×