Object-Oriented Analysis and Design (1) - PowerPoint PPT Presentation

object oriented analysis and design 1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Object-Oriented Analysis and Design (1) PowerPoint Presentation
Download Presentation
Object-Oriented Analysis and Design (1)

play fullscreen
1 / 16
Object-Oriented Analysis and Design (1)
200 Views
Download Presentation
renee
Download Presentation

Object-Oriented Analysis and Design (1)

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Object-Oriented Analysis and Design (1)

  2. UML in System Analysis and Design • Steps in OOAD using UML • Use Case Diagram • Sequence Diagram / Communication Diagram • Class Diagram • State Machine Diagram • Activity Diagram • Package Diagram • Component Diagram • Deployment Diagram

  3. A Note • UML is somewhat hard • One problem can be solved by different designs • No exact answer • UML Specification is continuously updated • And it’s !@#$% hard to catch up • Different books say things differently • The steps in this presentation is but one common guideline

  4. Step 1:Use Case Diagram • Identify functional requirements of existing and/or new system • Identify stakeholders/users of the system • Draw system boundary • Draw each functional requirement as a use case • Less or more use cases? Why? • Represent users as actors

  5. Step 1: Use Case Diagram(cont.) • Use the <<extend>> and <<include>> relationships as needed • Usually, an extending use case is adding extra function to the extended use case • Usually, an included use case is a common function which is shared by many other use cases • Write use case description for each and every use case • Format varies - see http://en.wikipedia.org/wiki/Use_case

  6. Use Case Description Example Adapted from Craig Larman, “Applying UML and Patterns: An Introduction to Object- Oriented Analysis and Design and the Unified Process”, 2nd Ed., Prentice Hall, 2002. Name: Primary Actor: Stakeholders and Interests: Preconditions: Postconditions: Main Scenario: 1. 2. … Extensions: 1a. 2a.

  7. Exercise • Draw a ‘complete’ use case diagram (including use case description) for one of the following scenarios (at least 3 use cases) • Automatic Teller Machine (ATM) • An online game server • A customer support system for a product of your choice • Or a system being used in your work

  8. Step 2: Sequence Diagram Based on the use case diagram, draw a sequence diagram (or communication/collaboration diagram) for each use case There might be more than one sequence diagram to represent alternate routes When drawing sequence diagram, think of the real world scenario (that you write in use case description) and select potential objects/classes

  9. Step 2: Sequence Diagram (Cont) • Drawing sequence diagram helps identify classes and objects in the system along with the communications between them • The communications, in turn, identify the behavior of the classes and objects in the system • How do you tell what should be a class/object? • If it’s not a class, what should it be?

  10. Step 2: Sequence Diagram (Cont) Distinguish different types of communications (refer to UML slides) Use them appropriately Be careful about notation Do you need to refer to a specific object of a class?

  11. Exercise • Draw sequence diagrams for the use cases in your use case diagrams • Try to be as much detailed as possible

  12. Step 3: Class Diagram • Most of the objects/classes in the system are identified in sequence diagram • Additional classes may (likely) be required • Draw classes identified from step 2 • Add necessary attributes • Specify data type of the attributes • Specify visibility of the attributes • Usually ‘private’ (encapsulation / data hiding) • ‘public’ or ‘protected’ may be used (e.g. static variable)

  13. Step 3: Class Diagram (cont) • Add behavior (methods) as identified by communications between objects in sequence diagrams • What can an object do? • What should an object do for other objects? • Specify method’s parameters • Parameter VS Argument? • Specify visibility • Usually ‘public’ or ‘protected’, but ‘private’ is possible for method used within the class

  14. Step 3: Class Diagram (cont) • Add relationships between classes • Association (uni-directional / bi-directional) • Generalization (inheritance) • Aggregation • Composition • Specify name of relationship and/or roles of the classes involved • Specify multiplicity (0..1, 1..1, 0..m, 1..m)

  15. Step 3: Class Diagram (cont) • It is possible to specify the type of classes by inscribing <<stereotype>> with class name • GUI classes may be inscribed with <<boundary>> • Controller classes (classes that contain business rules and/or calculations) may be inscribed with <<controller>> • Classes that model data (database) may be inscribed with <<entity>> • Be careful as stereotype may cause confusion • Do not use <<interface>> for GUI classes

  16. Exercise • Draw a class diagram for your system using the objects/classes and their behavior obtained from the sequence diagrams • Again, try to be as much detailed as possible