Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.

Slides:



Advertisements
Similar presentations
From use cases to classes (in UML). A use case for writing use cases Use case: writing a use case Actors: analyst, client(s) Client identifies and write.
Advertisements

Object-Oriented Analysis and Design CHAPTERS 8, 9: BASICS, INTRO TO DOMAIN MODELS 1.
Chapter 9 Domain Models The classic OOAD model. Fig. 9.1.
Copyright ©2004 Cezary Z Janikow 1 Domain Model n Visualization of entities and relationships n In UP presented as Class Diagrams – Classes, Relationships,
From Class Diagrams to Databases. So far we have considered “objects” Objects have attributes Objects have operations Attributes are the things you record.
Object Oriented Analysis Process
1 Lecture 2: Elaboration Tasks and Domain Modeling.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
Domain model: visualizing concepts
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
Copyright W. Howden1 Lecture 2: Elaboration Tasks and Domain Modeling.
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.
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
Glenn David Blank Computer Science & Engineering Department Lehigh University, Bethlehem, PA, USA With support from the National Science Foundation (Grants.
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.
BTS430 Systems Analysis and Design using UML Domain Model Part 1—Finding Conceptual Classes.
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 9 Domain Models. Domain Modeling After you have your requirements you start modeling the domain. You are still modeling the business, not the.
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.
Chapter 9 Domain Models $PH\06f522\LarmanApplUMLandPtrns\larman3EdDgmsCh01-14\09_domainModelsR2.ppt – RJL
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
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)
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
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.
Lecture 6: Structural Modeling
SYS466: Analysis and Design Using OO Models Domain Class Diagram, Part 1.
Chapter 1 Applying UML and Patterns. The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary.
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.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2A: Attributes.
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.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
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 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.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XIV. From Requirements to Design in the UP.
Elaboration popo.
Chapter 9 Domain Models.
Domain Model: Visualizing concepts
Domain Models Part 1
OO Domain Modeling With UML Class Diagrams and CRC Cards
Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami
Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami
OO Domain Modeling With UML Class Diagrams and CRC Cards
Object Oriented Analysis and Design Conceptual Model.
Domain Modeling.
Domain Modeling.
Domain Model: Visualizing Concepts
Presentation transcript:

Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole

Why do this? If you don’t understand the domain, you can’t program for it effectively Lower the representational gap between mental model and software model CS6359 Fall 2012 John Cole2

Objectives Identify conceptual classes related to the current iteration Create an initial domain model Model appropriate attributes and associations CS6359 Fall 2012 John Cole3

What is a Domain Model? Illustrates noteworthy concepts in a domain. That is, defines what the system is about Models the things in your system and the way they relate to each other A domain model is conceptual, not a software artifact A visual dictionary CS6359 Fall 2012 John Cole4

What’s the Difference? CS6359 Fall 2012 John Cole5 Conceptual Class: Sale amtitem Software Artifacts:SalesDatabase Sale Double amt; Item item; void print()

Business Object Model Class diagrams with no methods, just fields May show domain objects Associations between classes Attributes of conceptual classes CS6359 Fall 2012 John Cole6

Domain Model, visually CS6359 Fall 2012 John Cole7

Conceptual Classes An idea, thing, or object Symbol—Words or images representing a conceptual class Intension—Definition of a conceptual class Extension—The set of examples to which the class applies It is not a data model CS6359 Fall 2012 John Cole8

How to Create a Domain Model Find the conceptual classes Draw them as classes in a UML class diagram Add associations necessary to record relationships Add attributes necessary for information to be preserved Use existing names, the vocabulary of the domain CS6359 Fall 2012 John Cole9

How do I find Conceptual Classes? Reuse or modify existing models. If there are published models, prior art, or books, use them Use a category list (Table 9.1) Identify noun phrases (linguistic analysis) CS6359 Fall 2012 John Cole10

Noun Phrase Identification CS6359 Fall 2012 John Cole11 Consider the following problem description, analyzed for Subjects, Verbs, Objects: The ATM verifies whether the customer's card number and PIN are correct. S V O O O If it is, then the customer can check the account balance, deposit cash, and withdraw cash. S V O V O V O Checking the balance simply displays the account balance. S O V O Depositing asks the customer to enter the amount, then updates the account balance. S V O V O V O Withdraw cash asks the customer for the amount to withdraw; if the account has enough cash, S O V O O V S V O the account balance is updated. The ATM prints the customer’s account balance on a receipt. O V S V O O

Noun Phrases Analyze each subject and object as follows: Does it represent a person performing an action? Then it’s an actor, ‘R’. Is it also a verb (such as ‘deposit’)? Then it may be a method, ‘M’. Is it a simple value, such as ‘color’ (string) or ‘money’ (number)? Then it is probably an attribute, ‘A’. Which NPs are unmarked? Make it ‘C’ for class. Verbs can also be classes, for example: Deposit is a class if it retains state information CS6359 Fall 2012 John Cole12

Where are the Terms? Some are in the use case Some come from domain experts Natural language is imprecise and ambiguous, so you need to use judgment CS6359 Fall 2012 John Cole13

POS example CS6359 Fall 2012 John Cole14 You can create a list, or you can use a set of class diagrams, per the table below

Monopoly Game Domain Model CS6359 Fall 2012 John Cole15

Maintaining the Model Usually the model is a guideline to thinking, not an end in itself. Thus it will change as you learn more Who will use the updated model? CS6359 Fall 2012 John Cole16

Report Objects Including reports in a domain model usually isn’t useful because the information is derived from other objects. There are special cases, such as receipts, that should be in the model. CS6359 Fall 2012 John Cole17

Mapmaker (domain terms) Strategy Use existing names so far as possible. Learn the terms your users use. Exclude out-of-scope features. If a feature is not in the current iteration, don’t use it. Model the “unreal” world (i. e. Telecom) by listening carefully to the vocabulary of experts. “Port” means two different things in telecom and shipping. CS6359 Fall 2012 John Cole18

Attributes vs. Classes Common mistake: representing something as an attribute when it should have been a class. “If we do not think of some conceptual class X as a number or text in the real world, it should probably be a class, not an attribute.” Should “store” be an attribute of Sale or should it be a class? CS6359 Fall 2012 John Cole19

Description Classes A description class contains information that describes something else E. g. Product Description records the price, picture, text description (and what else?) of an item CS6359 Fall 2012 John Cole20

Why Use Them? If we keep all the information in, say, a sales line item, once all of that item are sold, there is no record of what the item was How does this relate to database design? CS6359 Fall 2012 John Cole21

Associations Relationship between (instances of) classes that indicates some interesting and meaningful connection What objects need memory of a relationship? In Monopoly, where each piece is and which player owns which token No need to remember numbers on the dice CS6359 Fall 2012 John Cole22

Associations (cont’d) Avoid having too many; this adds communication paths and complexity Will they be implemented in software? UML: Line between classes with the name of the association Name with VerbPhrase-ClassName format. E. g. Sale Paid By CashPayment Each end of an association is called a Role CS6359 Fall 2012 John Cole23

Associations (cont’d) Multiplicity: how many instances of class A can be associated with an instance of class B. E. g. an instance of Store can be associated with many (zero or more) Items This is at a particular moment, not over time Discussion of 0..1 or 1 Multiple associations: Flight FliesTo and FliesFrom an airport Common Associations List on p. 155 CS6359 Fall 2012 John Cole24

Attributes An Attribute is a logical data value of an object You can also have derived attributes denoted by / before the name Full syntax: visibility Name : type multiplicity = default {property string} +pi : Real= {read-only} CS6359 Fall 2012 John Cole25

Attribute Types Usually primitive data types, as well as things like Color, DateTime, Zip code, etc. The latter are specializations of primitive types It should not normally be a class, such as Sale or Airport Relate conceptual classes with an association, not an attribute. No foreign keys Attributes in code are okay CS6359 Fall 2012 John Cole26

New Data Type Classes Things like ItemID or ClaimNumber are not always simple data types, even though they look like them If the attribute contains separable pieces, it can be its own class. For example, a Claim Number has the state, year, and day encoded in it If it has operations associated with it CS6359 Fall 2012 John Cole27

New Data Type Classes (cont’d) If it has other attributes, such as a sale price If it has units, such as currency If it is an abstraction of one or more types with these properties CS6359 Fall 2012 John Cole28

Quantities with Units Represent them with distinct classes with an associated unit CS6359 Fall 2012 John Cole29

Is the Domain Model Correct? No, but it’s a good approximation It gets better with each iteration; don’t try to get it all at once Domain model usually done in the elaboration phase CS6359 Fall 2012 John Cole30