Guidelines for Creating Domain Models

domain modeling n.w
1 / 24
Embed
Share

"Learn how to model conceptual classes, notations, and UML diagrams for domain modeling. Understand the process of finding and identifying noun phrases in use cases to create effective domain models."

  • Domain Modeling
  • UML Diagram
  • Conceptual Classes
  • Notations
  • Guidelines

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1

  2. Today Domain Modeling Notations Guidelines Practice 2

  3. Domain Model The domain model is a representation of real-situation conceptual classes The term does not mean a set of diagram describing software classes Bridges the representational gap between Use-Case Model and Software Design Model (such as Class and Interaction Diagrams) 3 Q1

  4. An Example POS System 4

  5. Notation UML Class Diagram UML class diagram is used to model a domain with a twist Domain Class Domain class consist of class name and attributes Domain class does not have methods Relation A line with a label represents the relation between two classes A relation has a cardinality constraint 5 Q2

  6. How to Create Domain Model Find conceptual classes Draw them as classes in a UML class diagram Add associations and attributes 6

  7. Finding Conceptual Classes Reuse or modify the existing model if one exists Use a category list Identify noun phrases in your use-cases 7

  8. Category List (Partial) Business transaction Sale, Payment, Reservation Product or service related to transaction Item, Flight, Seat Where is the transaction recorded Register, Ledger, FlightManifest Place of service Store, Airport, Plane, Seat 8

  9. Identify Noun Phrase in Use Cases Basic Flow for a POS System 1. Customer arrives at a POS checkout with goods and/or services to purchase 2. Cashier start a new sale 3. Cashier enters item identifier 4. System records sale line item and presents item description, price, and running total 5. 9

  10. List and Draw UML Diagram Sale Register Cash Payment Amount SaleLineItem Cashier Item 1. Decide which ones are classes and which ones are attributes 2. Add attributes and relation to the identified domain classes 10

  11. Part of POS System 11

  12. Attributes vs. Classes - or - - or - - or - 12 Q3

  13. Description Classes A description class contains information that describes something else E.g. Item and ProductDescription 13

  14. When to use Description Class When information must be retained independent of existence of instances of the described item When deleting the described item could result in information loss When it reduces redundant information 14 Q4

  15. Avoid Premature Design Good Avoid Avoid 15

  16. Confusion with Databases Domain model Data model Data models: Only show persistent data Exclude classes that don t have attributes Domain models may include: External actors, transient data, any real-world classes Also classes without attributes/data that have a purely behavioral role 16 Q5

  17. Dont Have Too Much Details 17

  18. Association Notations Association name: Use verb phrase Capitalize Typically camel-case or hyphenated Avoid has , use Reading direction: Can exclude if association reads left- to-right or top-to- bottom Multiplicity (Cardinality): * means many x..y means from x to y inclusively 18

  19. Cardinality (or Multiplicity) * zero or more; "many" T 1..* T one or more 1..40 T one to 40 5 T exactly 5 19 3, 5, 8 T exactly 3, 5, or 8

  20. More Association Classes can have multiple associations Classes can also self-associate! Object creates itself Object modifies itself Object moves itself * 1 Flies-to Flight Airport Flies-from 1 * 20

  21. Attributes An object s logical data value that must be remembered Some attributes are derived from other attributes Usual primitive attributes (data types not shown in DM) Common compound attributes Date, time, address, SSN, phone number, bar codes, etc. May even become full class objects in design attributes Sale dateTime / total : Money 21 derived attribute

  22. Visibility in Domain Models Math Person Sale firstName middleName : [0..1] lastName - dateTime : Date - / total : Money + pi : Real = 3.14 {readOnly} Private visibility attributes Public visibility readonly attribute with initialization Optional value 22

  23. POS Domain Model Records-sale-of Product Description Ledger Product Catalog Contains 1 1..* 1 1 1 Records- accounts- for 0..1 Used-by * Describes * Sales LineItem Store Item Stocks * 1 1 1..* 1..* 1 Houses 1..* Contained-in Logs- completed 1 * Sale Register Captured-on 0..1 1 1 1 1 Is-for Paid-by 1 Works-on 1 1 23 CashPayment Customer Cashier

  24. Next In-class Exercise Create domain model for your project based on use cases (2 rich ones) that you have developed for Milestone 2 Present your model to the class 24

Related


More Related Content