1 / 23

Constructing The Class (Object Model*) Diagram

Constructing The Class (Object Model*) Diagram. The Object Model Diagram is a graphical representation of the classes within a system and the static or underlying relationships between them. *original designation. May be completed during design phase. Completed during the design phase.

sidneydelia
Download Presentation

Constructing The Class (Object Model*) Diagram

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Constructing The Class (Object Model*) Diagram The Object Model Diagram is a graphical representation of the classes within a system and the static or underlying relationships between them. *original designation

  2. May be completed during design phase Completed during the design phase The Class Diagram Class name Attributes methods

  3. One or more Student in a Course Course Student takes name ID major GPA credit_hr name number credits prereqs Students take 0 or more courses Associations Between Classes + *

  4. Zero or more One or more Zero or one Explicit cardinality Cardinality Constraints * Rumbaugh’s notation + Rumbaugh’s notation 1..4

  5. Student Course In any semester a professor will teach zero or more courses + Students may take up to 6 courses takes 0..6 Professor * 1 teaches Examples All Course objects have a professor and at least 1 student

  6. Student Course Associations read from left to right and top to bottom + takes 0..6 Professor 1 * teaches Examples

  7. Employee Company + + name ss_num salary name works for salary Better – model salary as a relationship attribute Relationship Attributes works for Bad – salary as an attribute precludes the possibility of an employee working for more than one company

  8. Person 2 name ss_num address parent child of * child Every person has 2 parents and zero or more children Role identifiers Role Relationships

  9. Librarian Patron issues + 1 1 Card Ternary Relationships A Librarian issues a Card to a Patron. The Card is uniquely assigned to a particular Patron.

  10. Aggregate Class * 3 + Component 2 Component 3 Component 1 Aggregation UML Notation

  11. Card Deck 52 suit rank composite aggregation Person Committee shared aggregation Aggregation A solid diamond is used to represent composition where the composite solely owns the part. A hollow diamond is used to indicate the composite end may be more than one. The part may appear simultaneously in more than one composite. * *

  12. Qualification to Remove Multiplicty The qualifier is a special attribute that limits the multiplicity of an association. The qualifier distinguishes among the set of objects at the many end of an association

  13. Directory File * contains Qualification Example A directory contains zero or more files Multiplicity can be removed by the qualifier file name which uniquely identifies a single file.

  14. Directory File File name Qualification Multiplicity is removed by the qualifier

  15. Shape area perimeter Circle Rectangle area perimeter area perimeter Generalization and Specialization Classes having the same attributes may be generalized to a common ancestor class

  16. Vehicle Water Vehicle Land Vehicle Air Vehicle Generalization and Specialization A sea plane travels in the air and on water

  17. A filled triangle indicates that some objects belong to more than one of the subclasses (subclasses overlap) An empty triangle indicates that all objects of the parent class belong to distinct subclasses Generalization and Specialization

  18. Constructing the Object Model Diagram Step 1 Determine the objects in the problem domain from the requirements document.

  19. Example -- Arithmetic Expression Requirements Document An arithmetic expression is a collection of one or more terms separated by additive operators. A term is a sequence of one or more factors separated by multiplicative operators. A factor is a variable, or a constant, or an arithmetical expression enclosed in parentheses.

  20. Example -- Arithmetic Expression Requirements Document An arithmetic expressionis a collection of one or more termsseparated byadditive operators. A termis a sequence of one or more factors separated bymultiplicative operators. A factoris avariable, or a constant, or an arithmetic expressionenclosed inparentheses.

  21. object object object object object object object constraint Arithmetic Expression Noun Phrases Arithmetic expression term additive operator factor multiplicative operator variable constant enclosed in parentheses

  22. Arithmetic Expression arithmetic expression is a sequence of terms terms are separated by additive operators term is a sequence of factors factors are separated by multiplicative operators factor is a variable factor is a constant factor is a arithmetic expression {enclosed in parentheses} constraint

  23. Arithmetic Expression Term Add_op Mult_op Factor Variable Constant identifier value Model Diagram {in parentehsis} + 2 consists-of connected-by contains + 2 connected-by A factor “is-a”

More Related