Domain Model and Domain Modeling

Similar documents
Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Domain Modeling: Associations and Attributes

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D

Domain Modeling. CSSE 574: Week 1, Part 3. Steve Chenoweth Phone: Office (812) Cell (937)

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Goal: build an object-oriented model of the realworld system (or imaginary world) Slicing the soup: OOA vs. OOD

Modeling Dynamic Behavior

Object-Oriented Functional Analysis and Design for POS Example

Constantinos Constantinides Computer Science and Software Engineering Concordia University Montreal, Canada

On to Object-oriented Design

Modeling Dynamic Behavior

On to Object-oriented Design

Responsibilities. Using several specific design principles to guide OO design decisions.

Information Expert (or Expert)

System Sequence Diagrams. Based on Craig Larman, Chapter 10 and Anuradha Dharani s notes

MSO Lecture 3. Wouter Swierstra. September 14, 2015

Object-Oriented Software Engineering Practical Software Development using UML and Java

SE 1: Software Requirements Specification and Analysis

ADVANCED SOFTWARE DESIGN LECTURE 7 GRASP

Software Engineering Prof.N.L.Sarda IIT Bombay. Lecture-11 Data Modelling- ER diagrams, Mapping to relational model (Part -II)

IMS1002/CSE1205 Lectures 1

Principles of Software Construction: Objects, Design, and Concurrency. Assigning Responsibilities to Objects. toad. Jonathan Aldrich Charlie Garrod

Principles of Software Construction: Objects, Design, and Concurrency

Principles of Software Construction: Objects, Design and Concurrency. Object-Oriented Design: Assigning Responsibilities.

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

Class Diagrams in Analysis

Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP)

Object Oriented Software Development CIS Today: Object Oriented Analysis

References: Applying UML and patterns Craig Larman

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad

Domain Modeling- 2. Generalization

OBJECT ORIENTED ANALYSIS AND DESIGN SYLLABUS

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

System Analysis & design

22/09/2012 INFO2110. Copyright Warning. Revision of class diagram. Overview. Purpose of class diagram. Generalization Relationship

CSCI315 Database Design and Implementation Singapore Assignment 2 11 January 2018

Principles of Software Construction: Objects, Design, and Concurrency

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

COMP 354: INTRODUCTION TO SOFTWARE ENGINEERING

Software Modeling & Analysis

COMP 6471 Software Design Methodologies

CS6502-OBJECT ORIENTED ANALYSIS AND DESIGN Two Marks Question with Answers Unit-I Introduction to OOAD

Entity Relationship Diagram (ERD) Dr. Moustafa Elazhary

Requirements Engineering

(Murlidhar Group of Institutions,Bhavnagar Road, Rajkot) by:-assit. Prof. Vijay Vora (SOOADM) MCA-III

Principles of Software Construction: Objects, Design and Concurrency. Introduction to Design. toad

Object Analysis & Design in the textbook. Introduction to GRASP: Assigning Responsibilities to Objects. Responsibility-Driven Design

Operations Contracts and Preliminaries on Design

Software Modeling & Analysis

Design First ITS Instructor Tool

CHAPTER 4 Data and Process Modeling (Phase 2: Systems Analysis)

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Principles of Software Construction: Objects, Design, and Concurrency

OO Design2. Design Artifacts


MIS2502: Data Analytics Relational Data Modeling - 1. JaeHwuen Jung

VEL TECH HIGH TECH Dr. RANGARAJAN Dr. SAKUNTHALA ENGINEERING COLLEGE UNIT 1 UML DIAGRAMS

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Information Systems (Informationssysteme)

Object-Oriented Analysis and Design

Lecture 8: Use Case -Driven Design. Where UML fits in

What is a Model? Copyright hebley & Associates

ROEVER ENGINEERING COLLEGE DEPARTMENT OF INFORMATION TECHNOLOGY CS2353-OBJECT ORIENTED ANALYSIS AND DESIGN. Unit-I. Introduction to OOAD

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

SELECTION. (Chapter 2)

4 Software models. often more than what people can handle not necessary to know all details at all times

Final Exam CISC 475/675 Fall 2004

Module 16. Software Reuse. Version 2 CSE IIT, Kharagpur

Syllabus for CSC 455 Database Systems 3 Credit Hours Spring 2012

COMP 6471 Software Design Methodologies

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING CS2353-OBJECT ORIENTED ANALYSIS AND DESIGN. Unit-I. Introduction to OOAD

Topics. Overview- The UML Functional Model. Structural Model. Behavioral Models. Use Case Diagram (essential and system)

CSSE 374: UML Activity Diagrams. Shawn Bohner Office: Moench Room F212 Phone: (812)

CSE Information Systems 1

Data Analysis 1. Chapter 2.1 V3.1. Napier University Dr Gordon Russell

Entity Relationship Modelling

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Object-Oriented Analysis and Design

Lecture 1/2. Copyright 2007 STI - INNSBRUCK

Review of Basic Software Design Concepts. Fethi Rabhi SENG 2021

21. Document Component Design

Data and Process Modeling

Marking Guidelines for MVK Projects. MVK11. Version 6.2 (PPD, URD, ADD, revised URD+ADD, and software demo)

System Analysis and Design. Data Flow Diagram. System Analysis and Design

Introduction - SENG 330. Object-Oriented Analysis and Design

Process Modelling. Data flow Diagrams. Process Modelling Data Flow Diagrams. CSE Information Systems 1

San Jose State University - Department of Computer Science

Tutorial notes on. Requirements analysis

Data. Entities. Accounting Information Systems. Chapter 4: Data Management

K12PaymentCenter.com Parent User Manual

CPSC 427a: Object-Oriented Programming

Database Management Systems MIT Lesson 01 - Introduction By S. Sabraz Nawaz

K12PaymentCenter.com Parent User Manual

Michael Kifer, Arthur Bernstein, Philip M. Lewis. Solutions Manual

1: Specifying Requirements with Use Case Diagrams

Object Design II: Design Patterns

The Object-Oriented Design Process

Transcription:

Dr. Michael Eichberg Software Engineering Department of Computer Science Technische Universität Darmstadt Software Engineering Domain Model and Domain Modeling Resources: Craig Larman; Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process; Prentice Hall, 2001

Domain Model Why: Domain modeling helps us to identify the relevant concepts and ideas of a domain When: Domain modeling is done during object-oriented analysis Guideline: Only create a domain model for the tasks at hand

Curtis law: [ ] Good designs require deep application knowledge. Sinngemäß: Ein guter (Software-)Entwurf benötigt ein tiefgreifendes Verständnis des Einsatzgebiets (der zu erstellenden Software.) Domain Model 3 Albert Endres and Dieter Rombach A Handbook of Software and Systems Engineering; Addison Wesley 2003

The Domain Model illustrates noteworthy concepts in a domain. Domain Model =dt. Analysemodell (Konzeptmodell) Domain Model 4 The domain model is created during object-oriented analysis to decompose the domain into concepts or objects in the real world The model should identify the set of conceptual classes (The domain model is iteratively completed.) It is the basis for the design of the software The domain model is also called conceptual model, domain object model or analysis object model.

Conceptual Classes Domain Model 5 Conceptual classes are ideas, things or objects in the domain A conceptual class has a symbol representing the class, an intension and an extension that defines the set of examples to which the conceptual class applies. intension =dt.(hier) Bedeutung extension =dt.(hier) Ausprägung Domain concepts / conceptual classes are not necessarily software objects as, e.g., in Java, C#, Ruby,...!

To visualize domain models the UML class diagram notation is used. Visualizing the Domain Model 6 However, no operations are defined in domain models Only... domain objects and conceptual classes associations between them attributes of conceptual classes The result is a conceptual perspective model.

Visualizing Domain Models Exemplified (By means of a basic course management system.)

Statements about a Course Management System Visualizing the Domain Model During a semester a lecturer reads one or more lectures 8 Sometimes the lecturer is on leave to do research, in this case (s)he does not give a lecture A student usually attends one or more lectures, unless (s)he has something better to do During the semester there will be several exercises which are meant to be solved by small study groups Each student is assigned to one particular study group for the whole semester A study group consists of two to three students After submission of a solution by a study group it is graded by a tutor...

A class describes a set of objects with the same semantics, properties and behavior. When used for domain modeling, it is a visualization of a real world concept. Visualizing the Domain Model 9 During a semester a lecturer reads one or more lectures A student usually attends one or more lectures,... During the semester there will be several exercises... Each student is assigned to one particular study group for the whole semester... it is graded by a tutor Tutor Semester Lecture Study Group Exercise Student Lecturer Grade

Attributes are logical data values of an object. It is useful to identify those attributes of conceptual classes that are needed to satisfy the information requirements of the current scenarios under development. Visualizing the Domain Model 10... after submitting a solution it is graded by a tutor The bonus is a relative bonus that reflects the relative number of exercise points gained during the semester... The bonus is derived. attributes Student name /bonus : Percentage derived attribute ("/") Solution achieved exercise points Exercise task submission date exercise points

An association is a relationship between classes. The ends of an association are called roles. Roles optionally have a multiplicity, name and navigability. Visualizing the Domain Model 11 A lecturer reads one or more lectures... A student usually attends one or more lectures... A study group consists of two to three students... During the semester there will be several exercises... Study consists of Group 1 2..3 Lecturer association * name reads Student name /bonus : Percentage multiplicity * Lecture

The multiplicity defines how many instances of a class A can be associated with one instance of a class B at any particular moment. (e.g., * zero or more; 1..10 between 1 and 10; 1,2 one or two) Visualizing the Domain Model 12 A student usually attends one or more lectures, unless (s)he has something better to do A study group consists of two to three students...... Study Group 1 2,3 Student name /bonus : Percentage Lecture * 1..*

Two classes can have multiple associations. Visualizing the Domain Model 13 A student usually attends one or more lectures, unless the student has something better to do A study group consists of two to three students; after submitting a solution it is graded by a tutor who is also a student Student name attends 1..* * is tutor for * * Lecture description

A preliminary domain model for a course management system. Visualizing the Domain Model 14 Student name /bonus : Percentage 2..3 consists of 1 1..* attends * Lecture description 1 owns 12..14 Exercise reads * * Lecturer name StudyGroup solves * * Solution achieved exercise points task submission date exercise points The Domain Model is sometimes also called a Visual Dictionary.

Domain Modeling Overview

Excerpt Of the Domain Model For the POS System Domain Modeling 16? Which are noteworthy domain concepts / domain objects?

How to create the domain model? (If we are not readily familiar with the domain.) Domain Modeling 17 1. Find the conceptual classes Strategies: a. Reuse or modify an existing model b. Use a category list c. Identify noun phrases explained in }the following 2. Draw them as classes in a UML class diagram 3. Add associations and attributes Use the domain vocabulary; e.g. a model for a library should use names like Borrower instead of customer.

Domain Modeling 18 Example: existing model for bank accounts and associated entries. {balance = sum(entries.amount)} Acount balance: Quantity 1 0..* Entry amount: Quantity whenchanged: Timepoint [One possible source] Martin Fowler; Analysis Patterns - Reusable Object Models; Addison-Wesley, 1997

How to create the domain model? Use a category list to find the conceptual classes. line item =dt. Einzelposten transaction =dt. Abwicklung / Durchführung; Geschäftsvorfall Domain Modeling 19 Conceptual Class Category Business transactions... Transaction line items... Product or service related to a transaction or transaction line item. Where is the transaction recorded? Roles of people or organizations related to the transaction; actors in use cases. Place of transactions. Noteworthy events, often with a time or place that needs to be remembered. Classes (for the POS system) Sale, Payment SalesLineItem Item Register Cashier, Customer, Store Store Sale, Payment......

How to create the domain model? Identify noun phrases to find the conceptual classes(linguistic analysis). Domain Modeling 20 Identify the nouns and noun phrases in textual descriptions of a domain and consider them as candidate conceptual classes or attributes A mechanical noun-to-class mapping isn t possible; words in natural languages are ambiguous; i.e. the same noun can mean multiple things and multiple nouns can actually mean the same thing Use Cases are also an excellent source for identifying conceptual classes.

How to create the domain model? Identify noun phrases to find the conceptual classes. Domain Modeling 21 Process Sale: A customer arrives at a checkout with items to purchase. The cashier uses the POS system to record each item. The system presents a running total and line-item details. The customer enters payment information, which the system validates and records. The system updates the inventory. The customer receives a receipt from the system and then leaves the store with the items.

How to create the domain model? Identify noun phrases to find the conceptual classes. Domain Modeling 22 Process Sale: A customer arrives at a checkout with items to purchase. The cashier uses the POS system to record each item. The system presents a running total and line-item details. The customer enters payment information, which the system validates and records. The system updates the inventory. The customer receives a receipt from the system and then leaves the store with the items.

How to create the domain model? Identify noun phrases to find the conceptual classes. Domain Modeling 23 Process Sale: A customer arrives at a checkout with items to purchase. The cashier uses the POS system to record each item. The system presents a running total and line-item Identified candidate conceptual classes: Customer, Item, Cashier, Store, Payment, Sales Line Item, Inventory, Receipt, Sale. details. The customer enters payment information, which the system validates and records. The system updates the inventory. The customer receives a receipt from the system and then leaves the store with the items.

How to create the domain model? Identify noun phrases to find the conceptual classes. Domain Modeling 24 Process Sale: A customer arrives at a checkout with items to purchase. The cashier uses the POS system to record each item. The system presents a running total and line-item Identified candidate conceptual classes: Customer, Item, Cashier, Store, Payment, Sales Line Item, Inventory, Receipt, Sale. details. The customer enters payment information, which the system validates and records. The system updates the inventory. The customer receives a receipt from the system and then leaves the store with the items. Should Receipt be in the domain model?

Guidelines when to include a candidate conceptual class that reports Information into the domain model Domain Modeling 25 In general, it is not useful since all information is derived or duplicated from other sources If it has a specific semantics w.r.t. the business, then it should be included Identified candidate conceptual classes: Customer, Item, Cashier, Store, Payment, Sales Line Item, Inventory, Receipt, Sale. Should Receipt be in the domain model?

Guidelines when to include a candidate conceptual class that reports Information into the domain model Domain Modeling 26 In general, it is not useful since all information is derived or duplicated from other sources If it has a specific semantics w.r.t. the business, then it should be included Identified candidate conceptual classes: Customer, Item, Cashier, Store, Payment, Sales Line Item, Inventory, Receipt, Sale. A receipt is just a report of a sale and a payment...

Guidelines when to include a candidate conceptual class that reports Information into the domain model Facts : Identified candidate conceptual classes:... Receipt,. A receipt is just a report of a sale and a payment... Should Receipt be in the domain model? Well, it depends. Domain Modeling if we just consider the current scenario then receipt should not be part of the domain model; a receipt is just a report 27 if we also consider how to handle returns then a receipt represents an important concept on its own How about legal restrictions...? Domain Requirement

Guidelines when to include a description class into the domain model Domain Modeling 28 A description class contains information that describes something else Examples: a product description records the price, picture and text of an item a flight description contains information about the flight (number) and the source and target destinations

Guidelines when to include a description class into the domain model Domain Modeling 29 A description class should be added to the domain model when: There needs to be a description about an item or service, independent of the current existence of any examples of those items or services Deleting instances of things they describe results in a loss of information that needs to be maintained, but was incorrectly associated with the deleted thing It reduces redundant or duplicated information

When should I model something as an attribute or a class? Domain Modeling 30 Rule of Thumb: If we do not think of some conceptual class X as a number, date or text in the real world, X is probably a conceptual class, not an attribute. StudyGroup Solution Exercise task submission date exercise points achieved exercise points

When should I model something as an attribute or a class? Let s assume that we develop an airline reservation system. Domain Modeling 31 Rule of Thumb: If we do not think of some conceptual class X as a number or text in the real world, X is probably a conceptual class, not an attribute. Should destination be an attribute of flight, or a conceptual class airport? A destination airport is a building at a specific place, it is not just a number or some text. Hence, it should be a conceptual class. How about the name of the airport? Flight * * Flies-from Flies-to 1 1 Airport

When should I add an association to the domain model? Domain Modeling Rule of Thumb: Include associations in the domain model for which knowledge of the relationship needs to be preserved for some duration. We are working on the conceptual model; we are not modeling associations at the software level. 32

When should I add an association to the domain model? Domain Modeling 33 When an association is among the common associations list: A is a transaction related to another transaction B A is a line item of a transaction B A is a product or service for a transaction B A is a role related to a transaction B A is physical or logical part of B...

When should I add an association to the domain model? Domain Modeling 34 E.g. the relation between a Sale and a SalesLineItem needs to be remembered However, it is not necessary to store the relation between a Cashier and a ProductDescription that he looks up

Name an association based on a ClassName- VerbPhrase-ClassName format. The verb phrase creates a sequence that is readable and meaningful. Good examples: Player Is-on Square Sale Paid-by CashPayment Bad examples: Sale Uses CashPayment (Uses is usually generic and doesn t tell us anything.) Player Has Square (Has is usually generic and doesn t tell us anything.) Domain Modeling 35

The attributes in a domain model should preferably be primitive data types (w.r.t. the domain!). Domain Modeling 36 Very common data types include: Boolean, Date, Number, Character, String, Address, Color, Phone Number, Consider modeling quantities as classes to be able to associate units e.g. the data type of the amount attribute of a payment should indicate the currency Cashier name currentregister?

The attributes in a domain model should preferably be primitive data types. Domain Modeling 37 Very common data types include: Boolean, Date, Number, Character, String, Address, Color, Phone Number, Consider modeling quantities as classes to be able to associate units e.g. the data type of the amount attribute of a payment should indicate the currency avoid: recommended: Cashier name currentregister name Cashier Use associations to model dependencies Register between conceptual number classes; do not use attributes.

Consider defining a new data type class for something that is initially considered a string. Domain Modeling 38 If the string is composed of separate sections e.g., phone number, name of person,... If different operations are associated with the string e.g., social security number If the string has other attributes If the string is a quantity with a unit e.g., money has a unit for currency avoid: recommended: ProductDescription itemid : ItemId ProductDescription 1 1 Item id countrycode

Excerpt Of the Domain Model For the POS System Domain Modeling 39? Which are noteworthy domain concepts / domain objects?

Excerpt Of the Domain Model For the POS System Domain Modeling 40 Sales LineItem quantity Contained-in 1..* 1 0..1 Records-sale-of 1 Item * Stocked-in 1 date time Paid-by Sale Payment amount 0..1 Captured-on 1 Store address name Register Houses

Domain Model and Domain Modeling Summary

The domain model serves as a source of inspiration for the design model which will be discussed later on. Purpose of Domain Modeling 42 Domain Model Payment amount 1 1 date time Sale inspiration / basis Design Model Payment amount: Money getbalance():money 1 1 Sale date: Date starttime: Time gettotal(): Money By using the domain model as a direct inspiration for software classes the representational gap between the domain concepts and the program is (relatively) small.

Goal of the Lecture 43 The goal of this lecture is to enable you to systematically carry out small(er) software projects that produce well-designed software. - Domain Modeling is useful to understand the ideas and concepts of the domain and their interrelationships - A Domain Model is usually created at the beginning of a project and is a basis for the design model - A Domain Model is created using a subset of the UML class diagram notation

Goal of the Lecture 44 The goal of this lecture is to enable you to systematically carry out small(er) commercial or open-source projects. Domain Modeling Software Project Management Project Start Start of an iteration Project End Requirements Management Domain Modeling