Chapter 9 Domain Models. Domain Modeling After you have your requirements you start modeling the domain. You are still modeling the business, not the.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 8, 9: BASICS, INTRO TO DOMAIN MODELS 1.
Advertisements

Object Design Examples with GRASP
January Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box.
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
Object-Oriented Analysis and Design
Copyright ©2004 Cezary Z Janikow 1 Domain Model n Visualization of entities and relationships n In UP presented as Class Diagrams – Classes, Relationships,
Solving the Problem Analysis & Design.
1 Domain Model: Adding Attributes Chapter 12 Adding Attributes.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
Domain model: visualizing concepts
Copyright ©2004 Cezary Z Janikow 1 Use Cases n Within Requirements discipline/workflow n Verbal descriptions of important functional (behavioral, transactional,
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
9/18/011 Software Requirements Analysis and Design (Continued)
Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1.
How to Make a Domain Model Tutorial
The first step in getting what you want is to decide what you want.
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
Object-Oriented Analysis and Design
What is a domain model? “A domain model captures the most important types of objects in the context of the business. The domain model represents the ‘things’
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Last lecture. What is a Use Case Use cases are stories (scenarios) of how actors use (interact with) the system to fulfill his goal. Examples Process.
Information Systems Analysis and Design Class Modeling
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
TK2023 Object-Oriented Software Engineering CHAPTER 5 DOMAIN MODELLING.
Domain Modelling Presented By Dr. Shazzad Hosain.
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 20. Review Software Requirements Requirements Engineering Process.
Chapter 9 Domain Models $PH\06f522\LarmanApplUMLandPtrns\larman3EdDgmsCh01-14\09_domainModelsR2.ppt – RJL
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Review ♦ System sequence diagram ♦ Domain model
Lecture 9 Enterprise Systems Development ( CSC447 ) COMSATS Islamabad Muhammad Usman, Assistant Professor.
Jan 21, Ron McFadyen1 Ch 10. Domain Model: Visualizing Concepts Domain model illustrated with a class diagram (with no operations defined)
Conceptual Modeling Modeling the Problem Domain. Conceptual Modeling Decompose problem space into comprehensible concepts. Clarify the terminology or.
DOMAIN MODEL- VISUALIZING CONCEPTS Identify conceptual classes related to the current iteration requirements. Create an initial domain model. Distinguish.
Lecture 13-17, chitkara university.  Gives a conceptual framework of the things in the problem space  Helps you think – focus on semantics  Provides.
Chapter 9 Applying UML and Patterns -Craig Larman
SYS466: Analysis and Design Using OO Models Domain Class Diagram.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
Elaboration Iteration 1- Part 1
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Domain Model—Part 2: Attributes.  A logical data value of an object  (Text, p. 158)  In a domain model, attributes and their data types should be simple,
Repetition af Domæne model. Artifact influence emphasizing the Domain Model.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2A: Attributes.
January Ron McFadyen1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain of interest.
Chapter 9: Domain Models.  The problem domain is modelled using a UML domain model: This is the first OO model that we will see (Use Cases are very useful.
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” Used to capture and describe.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Larman chapter 101 Domain Model: Visualizing concepts Larman chapter 10.
1 Chapter 9: Operation Contracts Chapter 13 in Applying UML and Patterns Book.
1 Object Oriented Analysis and Design Conceptual Model.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
Jan Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
Elaboration popo.
Chapter 9 Domain Models.
Domain Model: Visualizing concepts
UML Use Case Diagrams.
OO Domain Modeling With UML Class Diagrams and CRC Cards
Object Oriented Analysis and Design Conceptual Model.
Domain Model: Visualizing Concepts
Presentation transcript:

Chapter 9 Domain Models

Domain Modeling After you have your requirements you start modeling the domain. You are still modeling the business, not the program classes Various influences: –Source of info is the use-cases –operational contracts (like pre- and post-conditions) –conceptual classes give us ideas for what to name our program classes

Fig. 9.1

Example: The following are the conceptual classes for Payment and Sale. Part of the Conceptual Perspective Don’t be too thorough; avoid waterfall.

Fig. 9.2 NOTE: The direction of references.

What is a Domain Model Decompose the domain into noteworthy concepts and/or objects. The DM is a visual representation of real-situation objects and conceptual classes. Sometimes called Conceptual Model. In UP, this is one of the Business Modeling artifacts. Specifically, a class diagram with no operations or behaviour. Shows: –domain objects –associations –attributes

And… Sometimes called a visual dictionary.

What not to include: Software artifacts like databases, windows Responsibilities (ie, methods)

Fig. 9.3

Where does it fit? The Domain Model feeds into just one part of a program’s design. Typical program uses the MVC (Model-View-Controller) paradigm; the DM feeds the Model part only. The author uses the term “domain layer” to mean the software components that underlie the UI layer. We consider a conceptual class from 3 points of view –symbol: what words we use to name it –intension: its complete definition –extension: a set of examples of the class

Are Domain and Data Models the same? A Data Model is a model of persistent data; ie, data in a database or file system. Unlike a Data Model, just because we may never build the class, doesn’t mean we don’t put it in a Domain Model. Some Domain Model classes are purely behavioural

Fig. 9.5

Why Build a Domain Model? The developer has to understand the business so that is a good reason to build the Domain Model We want to use software artifact names that “remind” us of what real-world things they model. So it is a good idea to list those domain concepts (visually). The author calls this a “low representational gap”.

Fig. 9.6

Guidelines: Limit yourself to the interests of the current iteration; don’t try to draw the entire Domain Model up front (waterfall). To decide what classes to use, look around at what other developers have done here or in this area of endeavour. Look for patterns others have built. Our project uses Quartz. Make lists. Linguistic Analysis

List of Categories and possible classes Business TransactionsSale, Payment, Reservation Transaction Line ItemsSalesLineItem Products or ServicesItem, Flight, Seat, Meal Where Transaction RecordedRegister, Ledger, Manifest People’s RolesCashier, Customer, Passenger Place of TransactionStore, Airport, Plane, Seat Noteworthy EventsSale, Payment, Flight Physical ObjectsItem, Register, Board, Airplane Descriptions of ThingsProductDescription, FlightDescription Conceptual Class Category Examples

List of Categories and possible classes CatalogsProductCatalog, FlightCatalog Containers for ThingsStore, Bin, Airplane Things in ContainersItem, Square (on a Board), Passenger Other SystemsCreditAuthSystem, AirTrafficControl Records of Finance, WorkReceipt, Ledger, MaintenanceLog Financial InstrumentsCash, Check, LineOfCredit,TicketCredit Schedules, Manuals, DocsDailyPriceChangeList, RepairSchedule Conceptual Class Category Examples

Linguistic Analysis: Identify the nouns and verbs in text descriptions like a text-based Use-Case; consider these as candidate conceptual classes.

Fully Dressed Use Case (1): Scope: NextGenPOSApplication Level: User Goal PrimaryActor: Cashier StakeholdersAndInterests: –cashier wants: … –customer wants: … –company wants: … –manager wants: … –government wants: … –CC company wants: …

Fully Dressed Use Case (2): Preconditions: Cashier identified and authenticated Postcondtions: Sale completed, tax calculated, inventory updated, commission recorded, cc approval recorded MainSuccessScenario: 1.Customer arrives with goods 2.Cashier starts new sale 3.Cashier enters item identifier 4.Systems records sale and presents description and running total (repeat 3-4 many times) 1.System presents total 2.…

POS Example: Take from our various analyses, the relevant class names. Don’t include things that aren’t part of this iteration, for example CreditCardAuthorization.

Fig. 9.7

Fig. 9.8 NOTE: We keep the box not fully formed; easy to add stuff.

What about Using a Tool? There is little motivation to update a model unless it is easy to do so. That is why the author likes the whiteboard. The practical reason for updating is to keep the model as a documentation tool (for version 2).

Missing Classes (Receipt): This is a report on functionality of other classes so is a repetition of previously modeled info. Reason to exclude. Confers rights to return to Customer: Reason to Model Not doing returns now: Leave it out. Rules of Thumb: –Use existing names –exclude features that are not part of the iteration or plan –don’t add stuff that is not there

Weird Domains like Telecommunications: Some classes might be: Message, Connection, Port, dialog, Route, Protocol.

Attributes vs Classes: A common mistake is to cross identify these things. Rule of Thumb 1: If you don’t think of something as a number or string in the real world, it probably is a class. Rule of Thumb 2: Classes are capable of independent existence; attributes are properties of things. Rule of Thumb 3: If all you know about something is it exists and nothing else; it may be an attribute.

Examples: Sale store SaleStore phone or? Flight destination FlightAirport name or?

When to Model Descriptions? A description class describes something else. The difference between an object and a description of it is like the difference between a copy of a book and a book itself. If you run out of copies you may still need to know about the book. Intension vs Extension Physical Object vs Type of Thing So we need an Item class and a ProductDescription. How do you tell them apart? Identify their keys or identifying attributes. –serial number vs model number

Fig. 9.9 Book Copy

Fig What is the key?

Associations: A relationship between classes (or instances of classes). When do we show them? –when we need (real-world) to remember the other Too many associations make for an unwieldy diagram What associations are “implemented”? –Not all –some new ones appear between software objects Representations:

Fig. 9.11

Fig How many instances of Sale can be associated with an instance of Register? Ans: 0 or 1 NOTE: Not over time!!

Fig Many instances of item with the same store

Fig. 9.14

Fig instances of Store related to some instance of Item NOTE: For those in my database class: these are not participation numbers.

Multiple Associations:

Fig Employeemanages

Where to Start Adding Associations: A is a transaction related to another transaction B Payment - Sale A is a line item of a transaction BSalesLineItem - Sale A is a product or service for a transaction (or line item) B Item - SalesLineItem A is a role related to a transaction BCustomer - Payment A is a physical or logical part of BDrawer - Register A is physically or logically contained in BRegister - Store A is a description of BProductDescription - Item A is known/logged/captured in BSale - Register A is a member of BCashier - Department A is an organizational subunit of BDepartment - Store A uses or manages or owns BCashier - Register A is next to BSalesLineItem - SalesLineItem

Fig. 9.17

Fig. 9.18

Attributes: A property of a class or association. Find them in the text analysis of the requirements

Fig derived

Fig NOTE: You can “invent” obvious data types on your own

Fig I disagree An Item may never be sold

Fig Register is a complex thing

Fig. 9.23

Guidelines for Representing Data Types: composed of separate sections line an address operations associated with it – social security number has other attributes like validity date range a quantity with a unit type type abstraction: URL

Fig Might need Addresses for a delivery schedule Never gets shown as a class because it has not complexity other than the fact that it is a code.

Fig Don’t use attributes to represent associations in the Domain Model (ie foreign key syndrome)

Fig Quantities and Units

Fig. 9.27

Fig. 9.28