Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Object-oriented modeling Class/Object Diagrams
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Jan 2003Ron McFadyen Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Refining the Domain Model
7M822 UML Class Diagrams advanced concepts 15 September 2008.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
CSSE 374: Domain Model Refinements and Iteration 3 Preparations Q1 These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo, and others.
Data Modeling Using the Entity-Relationship Model
Systems Analysis and Design in a Changing World, Fifth Edition
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
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.
Detailed design – class design Domain Modeling SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
R McFadyen Chapter 7 Conceptual Data Modeling.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Object oriented classification Classification is the process of checking to see if an object belongs to a category or a class, is regarded as a basic attribute.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
INFO 620Lecture #81 Information Systems Analysis and Design Class Diagram Refinement INFO 620 Glenn Booker.
Domain Model Refinement Larman, chapter 31 CSE 432: Object-Oriented Software Engineering Glenn D. Blank, Lehigh University.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a more specific kind of thing (the.
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 Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
OO Methodology Elaboration Iteration 3 – Part 1 Refining Models.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
Sept 2004Ron McFadyen Generalization (Ch 26) a generalization is a relationship between a general thing (the superclass or parent class) and a.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
Domain Model Refinement Notation Extensions. Things not seen before in the Domain Model Similar to the concepts in the Object Models Generalization and.
What is this? SE-2030 Dr. Mark L. Hornick 1. Same images with different levels of detail SE-2030 Dr. Mark L. Hornick 2.
UML Diagrams: Class Diagrams The Static Analysis Model
Business System Development
The Movement To Objects
Domain Model Refinement
UML Class Diagrams: Basic Concepts
Domain Class Diagram Chapter 4 Part 2 pp
Relating Use Cases popo.
Understand and Use Object Oriented Methods
Chapter 22 Object-Oriented Systems Analysis and Design and UML
a generalization is a relationship between a general thing (the
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 11: Class Diagram
Presentation transcript:

Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1

What will we learn? Refining the Domain Model 2

Refining Domain Models: Super and Sub Classes Recall that once the initial Domain Model has been created, it may be enhanced in future iterations as more details are added to use cases, or our understanding of the system under development increases Early iterations tend to be high level, but more details are added in later We saw that as use case scenarios are extended, it may make sense to collect several conceptual classes together to form a super-class, with individual sub- classes A conceptual super-class definition is more general or encompassing than a subclass definition All members of a conceptual subclass set are members of their superclass set 3

Super- and Sub-Classes 4

Super and Sub Classes All statements about the super-class apply to any sub-classes; in other words, 100% of the super- class definition applies to the sub-class The sub-class must conform to the attributes and associations of the super-class A Credit Payment pays-for a Sale. A Check Payment has an amount 5

Refining Domain Models: Super and Sub Classes Can think of the “sub-class as being a kind of super-class” A Credit Payment is a kind of Payment Often shortened to: A Credit Payment is a Payment All members of the sub-class set must be members of the super-class set, i.e. sub-class x is a super-class y We can identify sub-classes by these two rules The 100% rule – all members of the sub-class must be a member of the super-class The “is a” rule – the sub-class is a kind of super-class Any sub-class of a super-class must obey these rules 6

Sub-Classes: When to Define Occasionally a super-class is created to capture similar sub-classes, but usually the process works the other way: A more general super-class has been defined, and as the iterations proceed, sub-classes are created to handle more detailed scenarios Guidelines: Create a sub-class when … The class under consideration “is a” kind of an existing super-class The class under consideration has additional attributes of interest The class under consideration has additional associations of interest The class under consideration is operated on, handled, reacted to, or manipulated differently than the super-class (or other subclasses) The class under consideration represents an actor that behaves differently than the super-class or other sub-classes 7

Super- and Sub-Classes: When to Create 8 Bad example: When would this make sense? Market research model, where there are behaviors of male and female shoppers that are different Medical research, since men and women are different biologically

Super-Classes: When to Define This may occur when common traits are identified among various conceptual classes in the Domain Model Create a super-class when: The potential sub-classes appear to be variations of the same concept All the potential sub-classes will conform to the “is a” rule for the new super- class A set of common attributes that belong to all the potential sub-classes is identified and can be factored out A set of common associations that all potential sub-classes have has been identified and can be factored out 9

Example: Payment Sub-Classes 10

11

Domain Models: Levels of Granularity As the Domain Model evolves, the question will arise: What level of detail to go to? How many sub-classes? Depends on the system being modeled – remember, the Domain Model is a tool to help understand the system Note that system transactions (request – reply) are usually modeled, because other activities and processes depend upon them But it is not always necessary to define sub-classes for every transaction General rule: don’t add complexity unless needed! 12

13

14

Abstract Conceptual Classes Recall that when we were developing use cases, we saw that it may be useful to collect a series of steps that occurs in several use cases and define an abstract use case that the other use cases could refer to We can do something similar for conceptual classes: If every member of a class C is a sub-class of C, then C is called an abstract class. But if there is an instance of C that is not a member of a sub-class, then C is not an abstract class. The Payment conceptual class we have been discussing is an abstract class, because all payments fall into one of the three sub-classes Usually, when a super-class is created from a set of sub-classes, the super-class is abstract Not all super-classes are abstract classes Denote with italics in Domain Model 15

Modeling State Changes Occasionally it is necessary to capture the state of an transaction, for example, in the Domain Model. This should not be done with sub-classes, because the super-class can transition Best to use a separate conceptual class for this, and provide state subclasses of the state class The association is usually “is-in” for these state transition classes State transitions can also be captured in a state diagram 16

Example: Modeling State Changes 17

Association Classes Often, the association between conceptual classes contains information that needs to be captured in the model, but does not belong in either class as an attribute A merchantID may be an attribute with the payment authorization service, but this does not belong in either the Store or AuthorizationService classes A salary may be an attribute of employment, but it does not belong as an attribute of the person or employer classes General rule: If class C can simultaneously have many values of attribute A, then A should not be placed in C. Could create a new conceptual class and associate it with the existing classes, but this can add complexity to the model Better way: Create a special class that represents the attributes of the association 18

Example: An Association Class 19

Association Classes – When to Add If the attribute(s) appear to be related to the association and not a particular conceptual class …. The lifetime of the attributes is dependent upon the association … There is a many-to-many association between two conceptual classes, and there are many attributes (common clue) 20

Aggregation and Composition These are software class concepts that will be important later Aggregation implies a container or collection of classes In this case, if the container class is destroyed, the individual parts are not Denoted in UML as an open diamond Composition also implies a collection of classes, but with a stronger life dependency If the container class is destroyed, the individual component instances are also destroyed Denoted by a filled in diamond in UML 21

Examples: Aggregation and Composition 22

Aggregation and Composition Usually not critical for domain models, but may be used to … Clarify constraints in the Domain Model (e.g. existence of a class depends on another class) Help model situations when create/delete operations apply to many sub-parts 23

Examples: Composition in NextGen POS 24

Association Role Names Occasionally a role name is added to an association; this name describes the role the object plays in the association Not required, often included if there role is not clear Should model the role as a separate class if there are unique attributes, associations, etc. related to the role 25 “Reflexive Association”

Qualified Associations A qualifier may be used in an association; it distinguishes a set of objects at the far end of the association based upon the qualifier value In the example below, we can identify the ProductDescriptions by the itemID, so we denote this in the UML diagram and change the multiplicity. Be careful not to design! 26

Packages Often, a Domain Model may become complex and hard to read Re-structuring the model using packages is an way to improve readability and maintainability 27

Packages An element is owned by the package it belongs to, but can be referenced by elements in another package 28

Packages Packages may be dependent upon each other; this happens if the elements know about or are coupled to elements in another package 29

Partitioning the Domain Model Use packages to partition the Domain Model when there are groups of elements that … … are in the same subject area, closely related by concept or purpose … are in the same class hierarchy together … participate in the same use case … are strongly associated 30

NextGen POS – Domain Model 31

NextGen POS: Core/Misc Package 32

33

34

35

36

Takeaways from Chapters 9 and 31 Learn how to associate the conceptual classes of a Domain Model Understand how to assign key attributes to conceptual classes, and when to define a new data type class Understand how to create sub- and super-classes 37

Next … Chapter 16: UML Class Diagram Notation An overview of Java concepts: Inheritance, Polymorphism, Interfaces 38