How to Make a Domain Model Tutorial

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

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’
Ch 12: Object-Oriented Analysis
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Solving the Problem Analysis & Design.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
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.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
Systems Analysis and Design in a Changing World, Fifth Edition
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’
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Object-Oriented Analysis and Design
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.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
5 Systems Analysis and Design in a Changing World, Fourth Edition.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
USE CASE Bayu Adhi Tama, MTI Faculty of Computer Science, University of Sriwijaya Slides are adapted from Petrus Mursanto
Review ♦ System sequence diagram ♦ Domain model
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
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.
Chapter 9 Applying UML and Patterns -Craig Larman
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Sept Ron McFadyen1 Class Diagram Begins as a conceptual or analysis class model and evolves to a design class model Used throughout the development.
What is a Structural Model?
Elaboration Iteration 1- Part 1
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Design Model Lecture p6 T120B pavasario sem.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
January Ron McFadyen1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain of interest.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Larman chapter 101 Domain Model: Visualizing concepts Larman chapter 10.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Basic Characteristics of Object-Oriented Systems
CHAPTER 6 OBJECT ANALYSIS.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Elaboration popo.
Chapter 9 Domain Models.
Business System Development
DATA REQIREMENT ANALYSIS
The Movement To Objects
Domain Model: Visualizing concepts
Systems Analysis and Design With UML 2
UML Use Case Diagrams.
Systems Analysis and Design With UML 2
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
Group Members Muhammad Zeeshan ( 16) Adnan Akhtar (4)
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Object Oriented System Design Class Diagrams
Object Oriented Analysis
Domain Model: Visualizing Concepts
Presentation transcript:

How to Make a Domain Model Tutorial

Basic Characteristics of Object Oriented Systems Classes and Objects Methods and Messages Encapsulation and Information Hiding Inheritance Polymorphism and Dynamic Binding

Classes and Objects Class – Template to define specific instances or objects Object – Instantiation of a class Attributes – Describes the object Behaviors – specify what object can do

Classes and Objects

Methods and Messages Methods implement an object’s behavior Analogous to a function or procedure Messages are sent to trigger methods Procedure call from one object to the next

Messages and Methods

Encapsulation and Information Hiding combination of data and process into an entity Information Hiding Only the information required to use a software module is published to the user Reusability Key Use an object by calling methods

Inheritance Superclasses or general classes are at the top of a hierarchy of classes Subclasses or specific classes are at the bottom Subclasses inherit attributes and methods from classes higher in the hierarchy

Class Hierarchy

Inheritance

Polymorphism and Dynamic Binding A message can be interpreted differently by different classes of objects Dynamic Binding Sometimes called late binding Delays typing or choosing a method for an object until run-time Static Binding Type of object determined at compile time

Polymorphish & Encapsulation

What is a Domain Model? Illustrates meaningful conceptual classes in problem domain Represents real-world concepts, not software components Software-oriented class diagrams will be developed later, during design

A Domain Model is Conceptual, not a Software Artifact Software Artifacts: Conceptual Class: SalesDatabase Sale amt item vs. Sale Double amt; Item item; void print() What’s the difference?

Domain Model Relationships Conceptual Class Diagram Classes, attributes, associations Define terms Use Case Model Domain objects Glossary Functional Requirements Interaction Diagrams Dynamic Behavior What do you learn about when and how to create these models?

Why do a domain model? Gives a conceptual framework of the things in the problem space Helps you think – focus on semantics Provides a glossary of terms – noun based It is a static view - meaning it allows us convey time invariant business rules Foundation for use case/workflow modelling Based on the defined structure, we can describe the state of the problem domain at any time.

Features of a domain model Domain classes – each domain class denotes a type of object.   Attributes – an attribute is the description of a named slot of a specified type in a domain class; each instance of the class separately holds a value.   Associations – an association is a relationship between two (or more) domain classes that describes links between their object instances. Associations can have roles, describing the multiplicity and participation of a class in the relationship. Additional rules – complex rules that cannot be shown with symbolically can be shown with attached notes.

Domain classes? Each domain class denotes a type of object. It is a descriptor for a set of things that share common features. Classes can be:- Business objects - represent things that are manipulated in the business e.g. Order. Real world objects – things that the business keeps track of e.g. Contact, Site. Events that transpire - e.g. sale and payment.

How to Identify Domain Classes Reuse an existing domain model There are many published, well-crafted domain models. Use a conceptual class category list Make a list of all candidate conceptual classes Identify noun phrases Identify nouns and phrases in textual descriptions of a domain ( use cases, or other documents)

Conceptual Class Category List Physical or tangible objects Register, Airplane Specifications, or descriptions of things ProductSpecification, FlightDescription Places Store, Airport Transactions Sale, Payment, Reservation Transaction items SalesLineItem Roles of people Cashier, Pilot Containers of other things Store, Hangar, Airplane Things in a container Item, Passenger Computer or electro mechanical systems CreditPaymentAuthorizationSystem, AirTrafficControl Catalogs ProductCatalog, PartsCatalog Organizations SalesDepartment, Airline

Where identify conceptual classes from noun phrases (NP) Vision and Scope, Glossary and Use Cases are good for this type of linguistic analysis However: Words may be ambiguous or synonymous Noun phrases may also be attributes or parameters rather than classes: If it stores state information or it has multiple behaviors, then it’s a class If it’s just a number or a string, then it’s probably an attribute

e.g. From NPs to classes or attributes 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 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 C R A A R A A A M A A A A M R M A R A C A A C A

Steps to create a Domain Model Identify candidate conceptual classes Draw them in a UML domain model Add associations necessary to record the relationships that must be retained Add attributes necessary for information to be preserved Use existing names for things, the vocabulary of the domain

Monopoly Game domain model (first identify concepts as classes) Die Board Piece Square Player

Monopoly Game domain model Larman, Figure 9.28

Class names Class Name creates the vocabulary of our analysis Use nouns as class names, think of them as simple agents Verbs can also be made into nouns, if they are maintain state E.g., “reads card” suggests CardReader, managing bank cards Use pronounceable names: If you cannot read aloud, it is not a good name Use capitalization to initialize Class names and demarcate multi-word names E.g., CardReader rather than CARDREADER or card_reader Why do most OO developers prefer this convention? Avoid obscure, ambiguous abbreviations E.g., is TermProcess something that terminates or something that runs on a terminal? Try not to use digits within a name, such as CardReader2 Better for instances than classes of objects

Associations Person Company A link between two classes (“has a”) Typically modeled as a member reference Notation from Extended Entity Relation (EER) models A Person works for a Company Role names and multiplicity at association ends Direction arrow to aid reading of association name Role employee employer Person Company 0..* 1 works for Association Name

Adding Association An association is a relationship between classes that indicates some meaningful and interesting connection. In the UML, associations are defined as “the semantic relationship between two or more classifiers that involve connections among their instances.”

Structure (association) analysis Lines connecting classes In UML, simple line is an association Decorations for multiplicity, role names, constraints Aggregations and composition: Arrow denotes navigability A black-filled diamond denotes a composition a part, unique to this whole A white-empty diamond denotes an aggregation a part, but not unique to this whole

Common Associations A is subpart/member of B. (SaleLineItem-Sale) A uses or manages B. (Cashier –Register, Pilot-airplane) A communicates with B. (Student -Teacher) A is transaction related to B. (Payment -Sale) A is next to B. (SaleLineItem-SaleLineItem) A is owned by B. (Plane-Airline) A is an event related to B. (Sale-Store)

Roles and Multiplicity Each end of an association is called a role. Multiplicity defines how many instances of a class A can be associated with one instance of a class B. e.g.: a single instance of a Store can be associated with “many”(zero or more) Item instances.

Some examples of Multiplicity

Adding Attributes An attribute is a logical data value of an object. Include the following attributes in a domain model: Those for which the requirements suggest a need to remember information. An attribute can be a more complex type whose structure is unimportant to the problem, so we treat it like a simple type UML Attributes Notation: Attributes are shown in the second compartment of the class box

Point of Sale System (POS) [1] Basic Flow: Customer arrives at a POS checkout with goods and/or services to purchase. Cashier starts a new sale. Cashier enters item identifier. System records sale line item and presents item description, price, and running total. Price calculated from a set of price rules. Cashier repeats steps 2-3 until indicates done.

Point of Sale System (POS) [2] System presents total with taxes calculated. Cashier tells Customer the total, and asks for payment. Customer pays and System handles payment. System logs the completed sale and sends sale and payment information to the external accounting (for accounting and commissions) and Inventory systems (to update inventory). System presents receipt. Customer leaves with receipt and goods (if any).

POS: Domain Model