All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
of 27

Please download to get full document.

View again

1. Chapter 6: Class Diagrams 2. Objectives <ul><li>Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams.…
  • 1. Chapter 6: Class Diagrams
  • 2. Objectives <ul><li>Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. </li></ul><ul><li>Understand the processes used to create CRC cards, class diagrams, and object diagrams. </li></ul><ul><li>Be able to create CRC cards, class diagrams, and object diagrams. </li></ul><ul><li>Understand the relationship between the structural and use case models. </li></ul>
  • 3. Structural Model <ul><li>A formal way of representing the objects that are used and created by a business system </li></ul><ul><ul><li>People </li></ul></ul><ul><ul><li>Places </li></ul></ul><ul><ul><li>Things </li></ul></ul><ul><li>Drawn using an iterative process </li></ul><ul><ul><li>First drawn in a conceptual, business-centric way </li></ul></ul><ul><ul><li>Then refined in a technology-centric way describing the actual databases and files </li></ul></ul>
  • 5. Structural Models <ul><li>Main goal : to discover the key data contained in the problem domain and to build a structural model of the objects </li></ul>Problem Domain Solution Domain Structural Modeling
  • 6. A Common Language <ul><li>Structural models create a well-defined vocabulary shared by users and analysts </li></ul><ul><ul><li>Classes created during analysis are not the classes that programmers develop during implementation </li></ul></ul><ul><ul><li>This refinement comes later </li></ul></ul><ul><li>Typical structural models: </li></ul><ul><ul><li>CRC cards </li></ul></ul><ul><ul><li>Class (and Object) diagrams </li></ul></ul>
  • 7. Classes, Attributes, & Operations <ul><li>Classes </li></ul><ul><ul><li>Templates for instances of people, places, or things </li></ul></ul><ul><li>Attributes </li></ul><ul><ul><li>Properties that describe the state of an instance of a class (an object) </li></ul></ul><ul><li>Operations </li></ul><ul><ul><li>Actions or functions that a class can perform </li></ul></ul>
  • 8. Relationships <ul><li>Describe how classes relate to one another </li></ul><ul><li>Three basic types in UML </li></ul><ul><ul><li>Generalization </li></ul></ul><ul><ul><ul><li>Enables inheritance of attributes and operations </li></ul></ul></ul><ul><ul><li>Aggregation </li></ul></ul><ul><ul><ul><li>Relates parts to wholes </li></ul></ul></ul><ul><ul><li>Association </li></ul></ul><ul><ul><ul><li>Miscellaneous relationships between classes </li></ul></ul></ul>
  • 9. CRC CARDS
  • 10. Responsibilities & Collaborations <ul><li>Responsibilities </li></ul><ul><ul><li>Knowing </li></ul></ul><ul><ul><li>Doing </li></ul></ul><ul><li>Collaboration </li></ul><ul><ul><li>Objects working together to service a request </li></ul></ul>
  • 11. Front-Side of a CRC Card
  • 12. Back-Side of a CRC Card
  • 14. Elements of a Class Diagram
  • 15. Attribute Visibility <ul><li>Attribute visibility can be specified in the class diagram </li></ul><ul><ul><li>Public attributes (+) are visible to all classes </li></ul></ul><ul><ul><li>Private attributes (-) are visible only to an instance of the class in which they are defined </li></ul></ul><ul><ul><li>Protected attributes (#) are like private attributes, but are also visible to descendant classes </li></ul></ul><ul><li>Visibility helps restrict access to the attributes and thus ensure consistency and integrity </li></ul>
  • 16. Operations <ul><li>Constructor </li></ul><ul><ul><li>Creates object </li></ul></ul><ul><li>Query </li></ul><ul><ul><li>Makes information about state available </li></ul></ul><ul><li>Update </li></ul><ul><ul><li>Changes values of some or all attributes </li></ul></ul>
  • 17. More Elements of Class Diagrams
  • 18. Multiplicities 1 1 1 0..* 1 1..* Exactly one: A department has one and only one boss Zero or more: An employee has zero to many children One or more: A boss is responsible for one or more employees Department Boss Employee Child Boss Employee
  • 19. More Multiplicities 1 0..1 1 2..4 1 1..3, 5 Zero or one: An employee can be married to 0 or 1 spouse Specified range: An employee can take 2 to 4 vacations each year Multiple disjoint ranges: An employee can be in 1 to 3 or 5 committees Employee Spouse Employee Vacation Employee Committee
  • 20. Sample Class Diagram
  • 21. Simplifying Class Diagrams <ul><li>Fully populated class diagrams of real-world system can be difficult to understand </li></ul><ul><li>Common ways of simplifying class diagrams: </li></ul><ul><ul><li>Show only concrete classes </li></ul></ul><ul><ul><li>The view mechanism shows a subset of classes </li></ul></ul><ul><ul><li>Packages show aggregations of classes (or any elements in UML) </li></ul></ul>
  • 22. Object Diagrams
  • 24. Object Identification <ul><li>Textual analysis of use-case information </li></ul><ul><ul><li>Nouns suggest classes </li></ul></ul><ul><ul><li>Verbs suggest operations </li></ul></ul><ul><li>Creates a rough first cut </li></ul><ul><li>Common object list </li></ul><ul><li>Incidents </li></ul><ul><li>Roles </li></ul>
  • 25. Patterns <ul><li>Useful groupings of classes that recur in various situations </li></ul><ul><li>Transactions </li></ul><ul><ul><li>Transaction class </li></ul></ul><ul><ul><li>Transaction line item class </li></ul></ul><ul><ul><li>Item class </li></ul></ul><ul><ul><li>Location class </li></ul></ul><ul><ul><li>Participant class </li></ul></ul>
  • 26. 7 Steps to Structural Models <ul><li>Create CRC Cards </li></ul><ul><li>Examine common object lists </li></ul><ul><li>Role-play the CRC cards </li></ul><ul><li>Create the class diagram </li></ul><ul><li>Review the class diagram </li></ul><ul><li>Incorporate patterns </li></ul><ul><li>Review the model </li></ul>
  • 27. Summary <ul><li>Structural Models </li></ul><ul><li>CRC Cards </li></ul><ul><li>Class Diagrams </li></ul><ul><li>Creating CRC Cards and Class Diagrams </li></ul>
  • We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks

    We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

    More details...

    Sign Now!

    We are very appreciated for your Prompt Action!