1 / 30

Expressive Domain Models and UML Class Diagram Notation

Learn how to create more expressive domain models and understand UML class diagram notation. Explore concepts like attributes, associations, and generalization.

mconstance
Download Presentation

Expressive Domain Models and UML Class Diagram Notation

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. Domain Models Part 2 http://flic.kr/p/9a9RjD

  2. What are you goingto learn about today? • Making more expressive domain models • More on UML class diagram notation http://flic.kr/p/8JpkTg

  3. Recall: Iterative development process We are here http://en.wikipedia.org/wiki/File:Iterative_development_model_V2.jpg

  4. Recall: The purpose of analysis But we still don’t fully understand the problem domain! Analysis

  5. Recall: Domain Models Classes: concepts or entities in the problem domain (not software)

  6. Recall: Domain Models Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes

  7. Recall: Domain Models Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes Associations: relationships between classes

  8. Recall: Associations

  9. Recall: Domain Models Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes Associations: relationships between classes

  10. Recall: Noun-phrase identification technique • Identify nouns and noun phrases in descriptions of a domain • Nouns = candidate classes or attributes

  11. Recall: Think like a mapmaker • Use existing names in the territory • Exclude irrelevant or out-of-scope features • Do not add things that are not there http://flic.kr/p/5QKvWh

  12. Recall: Draw classes starting from the upper left Sale Payment Store address

  13. Now, it’s time for something new!

  14. Recall the Payment class Payment There are different types of payments,like cash, credit, and check payments,and each type has some unique attributes How would you modelthe different payment types? http://flic.kr/p/9ksxQa

  15. Answer: Use generalization superclass – moregeneral concept Payment generalizationrelationship(3 overlappingtriangle-arrows) subclasses – morespecialized concepts

  16. Generalization guideline: The 100% Rule Payment 100% of the superclass’s definition should be applicable to the subclass • The subclass must conform to 100% of the superclass’s • attributes • associations

  17. Generalization guideline: The Is-a Rule All members of the subclass set must be members of the superclass set Informal test: “A Subclassis asuperclass” • E.g.: “A CashPayment is a Payment” Remember this!!!

  18. When to model subclasses? Would you model this? http://flic.kr/p/9ksxQa

  19. Guideline: Model a subclass when… • subclass has additional attributes of interest AND/OR • subclass has additional associations of interest AND/OR • subclass is operated on, handled, reacted to, or manipulated differently in ways that are of interest AND/OR • subclass represents an animate thing (e.g., animal) that behaves differently in ways that are of interest

  20. Did you notice something odd about this model? Payment You can have cash, credit, and check payments, but can you ever really have just a Payment?

  21. abstract Payment concrete

  22. Abstract classindicated by italics

  23. POS Example: Generalization • Does this model obey: • The 100% Rule? • The Is-a Rule?

  24. Recall the Sales and Sales LineItem • A LineItem is a part of a Sale • They have a composition relationship • We can model this!

  25. Recall the Sales and Sales LineItem Black diamond denotescomposition Read as: A sale is composedof 1 or more line items Note: Multiplicity on diamondend must be 1 or 0..1

  26. Composition relationship implies … • An instance of the part belongs to only 1 composite instance AND • The part must always belong to a composite AND • The composite is responsible for creation/deletion of its parts

  27. POS Example: Composition Does this model usecomposition correctly?(Only 1? Always belong? Creation/deletion?)

  28. FYI: Lots more to the UML class diagram notation Association classes Qualified associations … and more!

  29. Summary Domain modeling topics: • How to model classes • and their attributes • How to model relationships among classes • Association • Generalization • Composition • How to distinguish abstract from concrete classes http://flic.kr/p/YSY3X

  30. Think-Group-Share Activity:Creating a Domain Model • Think • Identify nouns and noun phrases—for inspiration • Sketch class diagram • Group • Join your team at the whiteboard • Collaboratively draw a class diagram • Make tentative decisions quickly, then debate • Share • Look at each of the other teams’ diagrams • For each, identify one thing that you wish you’d thought of • For each, identify one thing that you would do differently http://flic.kr/p/5dfuqL

More Related