Domain Model—Part 3: Associations, Multiplicity and Attribute- Text Notation.

Slides:



Advertisements
Similar presentations
Sucha Smanchat  Steps in OOAD using UML  Use Case Diagram  Sequence Diagram / Communication Diagram  Class Diagram  State.
Advertisements

Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
1 Domain Model Adding Associations Chapter 11 Applying UML and Patterns -Craig Larman.
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
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
November Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Systems Analysis and Design in a Changing World, 6th Edition
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
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.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Visualizing Concepts with a Domain Model.
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’
Domain Model—Part 4A: Special associations - Composition.
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
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.
DOMAIN MODE: ASSOCIATIONS, MULTIPLICITY AND ATTRIBUTE-TEXT NOTATION SYS466.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
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)
Domain Model Classes and Objects Association Structure Requirement Specification Domain Model.
Copyright © Craig Larman All Rights Reserved The Domain Model.
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
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
SYS466: Analysis and Design Using OO Models Domain Class Diagram.
Domain Model Classes and Objects Association Structure Requirement Specification Domain Model.
Elaboration Iteration 1- Part 1
Object-Oriented Analysis and Design Feb 11, 2009.
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,
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Object-Oriented Analysis and Design Feb 2, 2009.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
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.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
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.
Chapter 16 UML Class Diagrams.
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.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
1 Object Oriented Analysis and Design System Events & Contracts.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Elaboration popo.
Chapter 9 Domain Models.
Domain Model: Visualizing concepts
Chapter 16 UML Class Diagrams.
Conceptual Model.
OO Domain Modeling With UML Class Diagrams and CRC Cards
Group Members Muhammad Zeeshan ( 16) Adnan Akhtar (4)
Object Oriented Analysis and Design Conceptual Model.
Domain Model: Visualizing Concepts
Design Model: Creating Design Class Diagrams
Presentation transcript:

Domain Model—Part 3: Associations, Multiplicity and Attribute- Text Notation

 “a relationship between instances of classes (objects) that indicates some meaningful and interesting connection” (text, p. 150)

 When “memory” of a relationship is required  (in a real world situation, not a software situation)  SalesLineItem instances are associated with a Sale instance. Otherwise, it would not be possible to reconstruct a sale, print a receipt, or calculate a sale total.

 “Need to remember”  “Preserved for some duration”  Common Associations List (p.155)  “patterns” – e.g. Sale to SaleLineItem to Item.

 Multiplicity defines how many instances of class A can be associated with one instance of class B

 Name  Multiplicity (of Roles)  Multiple Associations  NOTE: Multiplicity depends on time Examples p.157

If we are selling a quantity of n of the same product (product:Product) then the SaleLine is associated with quantity n of that Product. But it is only associated with 1 Product. Note: this is sometimes modeled as a many to many association in a conceptual domain model to refer to the fact that a sale line can refer to many of the same product (e.g. 4 green peppers) BUT we are beyond that—as soon as we specify that product refers to an instance of the Product class, the multiplicity on the Product end should be a 1. Sells quantity of Contains A good association name helps clarify the association

 In the domain Model  Relate conceptual classes with an association, NOT an attribute  Cashier to Register  NOT currentRegister attribute of Cashier

 Attributes are shown several ways:  attribute text notation, such as currentSale : Sale.  association line notation  both together  Figure 16.3 shows these notations being used to indicate that a Register object has an attribute (a reference to) one Sale object.

 NOTE: the information that follows is only for the purposes of answering the question “when would we use directional associations?”  Directional associations have arrows; regular associations do not

 Directional associations are typically part of a Design Model (further on in the domain/design process); we would not usually show this in a domain model. (Larman, p.253) What this means: Order “knows” about OrderLine; OrderLine does not “know” about Order. In code, each Order class contains a reference to OrderLine objects (productOrderedSet). The OrderLine objects do not contain a reference to OrderLine.

public class Customer { private intcustID; private String custName; private Address address; private List contactSet; private Boolean isActive; public class Address { private int streetNum; private String streetName; private String city; private String postCode; private String province; private String country; public class Contact { private int contactID; private String name; private String phone;

 A data type refers to objects for which unique identity is not important.  Common data types are primitive-oriented types such as:  Boolean, Date (or DateTime), Number, Character, String (Text), Time, Address, Color, Geometrics (Point, Rectangle), Phone Number, Social Security Number, Universal Product Code (UPC), SKU, ZIP or postal codes, enumerated types

Showing objects as attributes is typically reserved for the Design model (further on in the analysis and design process) but we are showing them here in SYS466 to aid in understanding.

In OO language implementation, objects will contain references to their object attributes. For example SaleLine will contain a reference to a Product object.

public class Order { private intorderID; private Customer customer; private List productOrderedSet; public class OrderLine { private int qtyOrdered; private Product product; public class Product { private int productID; private String productName; orders quantity of contains

 Guideline: Use the attribute text notation for data type objects and the association line notation for others. Both are semantically equal, but showing an association line to another class in the diagram (as in Figure 16.3) gives visual emphasis—it catches the eye, emphasizing the connection between the class of objects on the diagram.

 Slide material was taken from Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, Third Edition, By Craig Larman, Published by Prentice Hall, Pub. Date: October 20, Chapter 16