Chapter 9 Applying UML and Patterns -Craig Larman

Slides:



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

Object Design Examples with GRASP
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
January Ron McFadyen1 Use Cases in the UML Functionality under consideration is represented by use cases (named ellipses) enclosed in a box.
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
Jan Ron McFadyen1 Consider a simple cash-only Process Sale scenario 1. Customer arrives at a POS checkout with goods and/or services to purchase.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Chapter 9 DOMAIN MODELS Objectives
Sept Ron McFadyen1 Use Cases Introduced by Ivar Jacobson in 1986 literal translation from Swedish ”usage case” - may be of.
Fall 2009ACS-3913 Ron McFadyen1 Use Cases Used to capture functional requirements – there are other requirements categories such as usability, reliability,
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.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 More on use cases System sequence.
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
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”
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’
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.
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
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.
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.
Lecture 13-17, chitkara university.  Gives a conceptual framework of the things in the problem space  Helps you think – focus on semantics  Provides.
♦ Use Case Model  Detailled use case - Important  Use case diagram- Refactoring Use case diagram  > 1 Last Lectures.
SYS466: Analysis and Design Using OO Models Domain Class Diagram.
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.
Object-Oriented Analysis and Design Feb 2, 2009.
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.
PRESENTATION ON USE CASE. Use Case Modeling Use case diagrams describe what a system does from the standpoint of an external observer. The emphasis is.
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.
Summary from previous lectures
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.
1 Object Oriented Analysis and Design System Events & Contracts.
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.
System Sequence Diagrams and Operation Contracts
Domain Model: Visualizing concepts
Conceptual Model.
Domain Models Part 1
OO Domain Modeling With UML Class Diagrams and CRC Cards
OO Domain Modeling With UML Class Diagrams and CRC Cards
Relating Use Cases popo.
Object Oriented Analysis and Design Conceptual Model.
Object Oriented Analysis
Domain Model: Visualizing Concepts
Presentation transcript:

Chapter 9 Applying UML and Patterns -Craig Larman Domain Models Chapter 9 Applying UML and Patterns -Craig Larman

Introduction Remember: Use cases are not object-oriented requirement analysis , but they emphasize an activity view. A domain model is the most important and classic-model in Object Oriented Analysis

Domain model ? A domain model is a visual representation of conceptual classes (idea, thing or object) or real-situation objects in a domain. Make it easier to understand the key concepts and the stakeholders view. A UP domain model is a visualization of things in a real-situation domain of interests, not of software objects such as Java or C# classes. It is part of the Business Model artifact

Domain Model Relationships Business Model Domain Model Classes, attributes, associations Elaboration on some terms Use Case Model Domain Objects = conceptual classes Glossary Requirements Interaction Diagrams Design

Fig. 9.1 Example

Domain Model -UML Notation Illustrated using a set of class diagrams for which no operations are defined. It may contain: Domain Objects or Conceptual Classes Associations between conceptual classes Attributes of conceptual classes

A Domain Model is not a Software Artifact A Conceptual class: Sale Date Time

A Domain Model is not a Software Artifact Software Artifacts: Sale Date Time Print() Object responsibilities is not part of the domain model. (But to consider during Design) Avoid

Think of Conceptual Classes in terms of: Symbols – words or images Intensions – its definition (what does it represent) Extensions – the set of examples to which it applies. Note ; during each iteration, only objects in current scenarios are considered for addition to the domain model.

Symbol, intension and extension. All the examples of sales Fig 9.5

Question : Why create Domain model Question : Why create Domain model ? Answer : To take inspiration of real world domain to create software classes

Question : Why create Domain model Question : Why create Domain model ? Answer : To take inspiration of real world domain to create software classes

How to find these conceptual classes ?

Method1 : Identify Conceptual Classes by Category List: p 140-141 Common Candidates for classes include: Descriptions Roles Places Transactions Containers

Abstract nouns Rules Organizations Events Processes

Written Materials Catalogs Records Financial Instruments Services Systems

Method2: Conceptual Classes with Noun Phrase Identification Identify Nouns and Noun Phrases in textual descriptions of the domain. Fully dressed Use Cases, problem definition are good for this type of linguistic analysis. It’s not strictly a mechanical process: Words may be ambiguous Different phrases may represent the same concepts.

2. Cashier starts a new sale. 3. Cashier enters item identifier. Main Success Scenario (or Basic Flow): 1. Customer arrives at POS checkout with goods and/or services to purchase. 2. Cashier starts a new sale. 3. Cashier enters item identifier. 4. System records sale line item and presents item description, price, and running total. Price calculated from a set of price rules. Cashier repeats steps 3-4 until indicates done. 5. System presents total with taxes calculated. 6. Cashier tells Customer the total, and asks for payment. 7. Customer pays and System handles payment.

9. System presents receipt. 8. System logs completed sale and sends sale and payment information to the external accounting system (for accounting and commissions) and Inventory system (to update inventory). 9. System presents receipt. 10. Customer leaves with receipt and goods (if any). Extensions (or alternative Flows) 7a. Paying by cash: 1. Cashier enters the cash amount tendered. 2. System presents the balance due, and releases the cash drawer. 3. Cashier deposits cash tendered and returns balance in cash to Customer. 4. System records the cash payment.

Fig. 9.7 Remember : There is no such things as a correct list. Brainstorm what you consider noteworthy to be a candidate. But in general , different modelers will find similar lists.

When to model Specification/Description Conceptual Classes? Suppose all the items (ObjectBurgers) are sold out and then deleted. Someone ask you “”How much do ObjectBurgers cost ?

Example1: Fig. 9.9

When to model Specification/Description Conceptual Classes? A Class that records information about an item. Even if all Instances of the item are sold out, the description remains. It avoids duplication of recording the descriptive information with each instance of the item.

Example2 : Fig. 9.10

Association: Relationship between classes (more precisely, between instances of those classes). Fig. 9.11

Association: Relationship between classes (more precisely, between instances of those classes). Fig. 9.12

“many” ( 0 or more ) Multiplicity indicates how many instances can be validly associated with another instance, at a particular moment, rather than over a span of time. Example : monogamy Fig. 9.13

Fig. 9.14 : multiplicity values

Multiplicity communicates a domain constraint that will be reflected in software. How ? Fig. 9.15

Multiple Associations between two classes

Attributes A logical data value of an object. Imply a need to remember information. Sale needs a dateTime attributte Store needs a name and address Cashier needs an ID

Fig. 9.19

Fig. 9.20

Fig. 9.21 : Derived Attributes The quantity entered by the cashier may be recorded as an attribute “quantity” of the SaleLineItem class. However the quantity can be calculated from the actual multiplicity value of the association

Fig. 9.22 : Association or attribute Most attribute type should be “primitive” data type, such as: numbers and booleans. Attribute should not be a complex domain concept(Sale , Airport) CurrentRegister is of type “Register”, so expressed with an association

Fig. 9.23 A destination airport is not a string, it is a complex thing that occupies many square kilometers of space. So “Airport” should be related to “Flight” via an association , not with attribute

Should the “ItemID” class be shown as a separate class Should the “ItemID” class be shown as a separate class ? It depends on how the domain model is being used. ItemID is a new type with its own attributes Fig. 9.24 ItemID are primitive types(number, boolean, character, string…etc)

Fig. 9.26 : Modeling quantities and Units Price is a quantity with associated units. How should we model them?

A Common Mistake when modeling the domain- Classes or Attributes? Rule: If we do not think of a thing as a number or text in the real world, then it is probably a conceptual class. If it takes up space, then it is likely a conceptual class. Examples: Is a store an attribute of a Sale ? Is a destination an attribute of a flight ?

Assignment 1: Mobile phone system Problem definition Consider a system for a simple mobile phone. The phone can receive calls and call other phone numbers. It offers its owner a personal phone book to store namse and phone numbers. The phone book can be dynamically updated. The phone also manages a complete log of all incoming and outgoing calls and helps its owner to remember unanswered calls.

assignment Find classes and attributes for the mobile phone system.

assignment Find classes and attributes for the library system. For help see the videos from requirements to classes.

How to create a domain model Find the conceptual classes Draw them as classes in a UML class diagram Add associations and attributes

But remember There is no such thing as a single correct domainmodel. All models are approximations of the domain we are attempting to understand. We incrementally evolve a domain model over several iterations on attempts to capture all possible conceptual classes and relationsships.