1 / 24

Constructing The Object Model Diagram

Constructing The 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. May be completed during design phase. Completed during the design phase. The Class Diagram. Class name.

lydia-olsen
Télécharger la présentation

Constructing The 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 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.

  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 All Course objects participate Associations Between Classes +

  4. Zero or more One or more Zero or one All objects of the class participate in the association – (total) Explicit cardinality Cardinality Constraints * + 1..4

  5. All Course objects have a professor and at least 1 student 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

  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 works for salary Better – model salary as a relationship attribute Relationship Attributes 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. Project Programmer assigned * + 1 Language Ternary Relationships Every project is assigned a team of 1 or more programmers and written in 1 language

  10. Aggregate Class Name * Component 1 + Component 2 3 Component 3 Multiplicity of each component Aggregation Coleman’s Notation Aggregation models the has-a relationship

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

  12. Project Language * assigned uses + * Programmer Example of Aggregation Consider the Ternary Relationship Project-Programmer-Language A project has-a language and a team of one or more programmers assigned to it

  13. 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

  14. 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.

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

  16. 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

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

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

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

  20. 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.

  21. 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.

  22. 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

  23. 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

  24. Arithmetic Expression Term Add_op Mult_op Factor Variable Constant identifier value Model Diagram {in parentehsis} + 2 * + 2 *

More Related