INFO 620Lecture #81 Information Systems Analysis and Design Class Diagram Refinement INFO 620 Glenn Booker.

Slides:



Advertisements
Similar presentations
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Advertisements

©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
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.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
Refining the Domain Model
MORE ON CLASS MODELS Lecture Outline Aggregation and composition Roles Navigability Qualified association Derived association Constraints Association.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
2Object-Oriented Analysis and Design with the Unified Process Events and Use Cases  Use case  Activity the system carries out  Entry point into the.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
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.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
INFO 355Week #31 Systems Analysis II Domain Modeling INFO 355 Glenn Booker.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Session 11 The Class Diagram: Aggregation and Generalization Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 12, 2011 Presented.
Information Systems Analysis and Design Class Modeling
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
5 Systems Analysis and Design in a Changing World, Fourth Edition.
R McFadyen Chapter 7 Conceptual Data Modeling.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
UML Class Diagrams and Caché CAMTA Meeting – 1 st December 2011 John Murray Senior Product Engineer.
Lab 04.
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.
Domain Model Refinement Larman, chapter 31 CSE 432: Object-Oriented Software Engineering Glenn D. Blank, Lehigh 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.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
What is a Structural Model?
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.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
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,
Relationships Relationships between objects and between classes.
Repetition af Domæne model. Artifact influence emphasizing the Domain Model.
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
OO Methodology Elaboration Iteration 3 – Part 1 Refining Models.
January Ron McFadyen1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain of interest.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
Modeling the Static Structure: Relationships ©SoftMoore ConsultingSlide 1.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
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.
INFO 355Week #41 Systems Analysis II OO Design principles INFO 355 Glenn Booker.
Chapter 14 Semantic Modeling. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.14-2 Topics in this Chapter The Overall Approach The E/R Model.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Domain Model Refinement Notation Extensions. Things not seen before in the Domain Model Similar to the concepts in the Object Models Generalization and.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Business Process and Functional Modeling
Class Diagrams.
Domain Model Refinement
Systems Analysis and Design With UML 2
Relating Use Cases popo.
Domain Modeling.
Object Oriented System Design Class Diagrams
a generalization is a relationship between a general thing (the
Chapter 11: Class Diagram
Presentation transcript:

INFO 620Lecture #81 Information Systems Analysis and Design Class Diagram Refinement INFO 620 Glenn Booker

INFO 620Lecture #82 Iteration 3 of Text Iteration 3 in Larman covers additional refinement of the design –Relating use cases (“include”) –Generalization of classes –Architecture analysis –Additional patterns –Frameworks

INFO 620Lecture #83 Generalization Generalization and specialization are refinements of the class diagrams –May apply to all types of class diagrams Want to use them to reduce duplication of code by exploiting inheritance First focus on conceptual classes, not software classes

INFO 620Lecture #84 Look for Similar Concepts To identify generalization, look for all of the concepts which are classes in your system Text example has three Payment classes, and two AuthorizationService classes Any time there are very similar classes might be an opportunity for generalization

INFO 620Lecture #85 Showing Generalization The open triangle shows generalization

INFO 620Lecture #86 Superclass versus Subclass A superclass is more general, vague, or broad than a subclass

INFO 620Lecture #87 The 100% Rule All attributes of a superclass must also exist for all of its subclasses All associations of a superclass must also apply to all of its subclasses –Subclasses may have associations not shared by the superclass

INFO 620Lecture #88 Generalization These diagrams both mean the same thing

INFO 620Lecture #89 Generalization Association The association between generalized classes is “is-a-kind-of”, or “is-a” for short –“CreditPayment is-a Payment” –“Subclass is-a Superclass” –Human is-a Mammal Notice that the reverse is not always true –“Superclass is-a Subclass” is incorrect! –Mammal is-a Human???

INFO 620Lecture #810 Why Generalize? Keep in mind the system focus for our analysis –If the classes are to be meaningful, they must help our system work better Create conceptual subclass when –Subclass has different attributes and/or associations –Subclass behaves or is handled differently

INFO 620Lecture #811 Abstract Conceptual Classes If every member of the superclass is also a member of one subclass, then the superclass is an abstract conceptual class –Payment is an abstract conceptual class iff the only kinds of payment accepted are credit, cash, or check Show abstract conceptual class by making the class name italics (check “IsAbstract” in Visio)

INFO 620Lecture #812 Changing States It may be tempting to define subclasses for different states of a class, e.g. Authorized and Unauthorized Payments Don’t! Instead, make that state a separate abstract class, with subclasses for each possible state (p. 408)

INFO 620Lecture #813 Inheritance Inheritance is when a subclass inherits the attributes and associations of its superclass Inheritance is heavily implementation language-specific, so it doesn’t apply to conceptual class generalization –Conceptual classes may be collapsed or expanded to become software classes

INFO 620Lecture #814 Class Modeling If a class C has many possible values of attribute A for a single member of C, put A in its own class associated with C –Person has many PhoneNumber –Sale has many SalesLineItem

INFO 620Lecture #815 Association Classes But sometimes that isn’t enough… A class whose existence depends on two other classes at once can be an association class, shown by a dashed line Usually an association class is needed for some attributes or associations Association classes can be used to bridge many-to-many associations

INFO 620Lecture #816 Association Classes Employment is an association class between Company and Person Association classes are also good for time-dependent associations

INFO 620Lecture #817 Aggregation When a class makes you mad, that’s aggregation. No? Aggregations are associations where the entire thing (called the composite) is made up of some number of specific parts Aggregations association are often left unnamed, since it would be “Has-part”

INFO 620Lecture #818 Composite Aggregation A composite aggregation is when the composite lives and dies with its parts –When the composite is created, so are the parts It is shown with a filled-in (black) diamond on the side of the composite

INFO 620Lecture #819 Shared Aggregation Shared Aggregation is very rare, occurs with non-physical classes It occurs when the multiplicity at the composite side may be greater than one Hence it is when the same part may occur in more than one whole at the same time

INFO 620Lecture #820 Aggregation Show aggregation when –There is logical or physical whole-part connection –The lives of the part and whole are linked –Properties and/or operations of the whole also pertain to the part When in doubt, leave aggregation out

INFO 620Lecture #821 Time Intervals Attributes which change over time, and you need to know that history of change, may need their own classes –Often needed for measurements, legal or accounting records

INFO 620Lecture #822 Association Role Names The end of each association is a role Each role can have a name to help clarify its purpose, if needed Role name is given in lower case This example is also a reflexive association

INFO 620Lecture #823 Modeling Human Roles Human roles (student, teacher, architect, etc.) can be modeling as an association –Store Employs-to-manage Person Or human roles can be modeled as classes –Store Employs Manager Since human roles can change fairly easily, and mutating one class into another is difficult, it is better to use the latter (classes)

INFO 620Lecture #824 Derived Elements Attributes and associations may be derived from other attributes and associations They should be avoided, since they add complexity – use when it’s a frequently used term Show derived status manually with a forward slash prefix

INFO 620Lecture #825 Qualified Associations Class A may show a qualifier through which class A associates with class B The qualifier is an attribute of the first class –Helps clarify the association (p. 422) –And may simplify the multiplicity Not the “primary key” description method

INFO 620Lecture #826 Ordered Elements If associated objects are in a significant order (sequence), the association can have the trait “IsOrdered” –Qualified and Ordered are both properties of the (end) role

INFO 620Lecture #827 Packages More info on packages… Each package “owns” the classes in it; can be shown by a class diagram inside package –May need to draw text box and rectangle around class diagram A package may reference classes from other packages using otherpackage::class notation (p. 424)

INFO 620Lecture #828 Packages Packages are grouped by: –Strong association –Same type of concept or purpose (functional) –Are in the same class hierarchy –Are used in the same use cases A package for common functions is often called Core

INFO 620Lecture #829 Package Dependencies Packages can depend on each other Dependency is shown by a dotted line with an open arrowhead Think of dependency as an association called “Uses”

INFO 620Lecture #830 SSD Update While developing the design class diagram, it can be helpful to re-examine the system use cases and sequence diagrams –Clarify what system operations will be needed to support generalization and other refinements –Clarify what calls to external systems are expected, both outgoing and incoming

INFO 620Lecture #831 Object Identity Recall that every object has an object identity (OID), which acts as its equivalent of a primary key Now we can define attributes and methods to allow each object to create other objects, establish associations with those objects, and later destroy them! (this is jumping a little into Chapter 20)

INFO 620Lecture #832 Reference Attributes Associations are implemented via reference attributes and their methods –They are essentially a foreign key Reference attributes are used for association forming Warning: Reference attributes are not shown in the text’s class diagrams!!

INFO 620Lecture #833 Reference Attributes Reference attributes are needed: –For a one-way navigable association, the side which does not have an arrowhead –For two-way navigation, on both sides of the association Methods are needed to use the reference attributes (e.g. add or delete associations)

INFO 620Lecture #834 Reference Attributes The type of a reference attribute is: –If B has multiplicity of one, the reference attribute in class A is of the type B –If B has a multiplicity >1, the reference attribute in class A is a “collection” – a container for multiple objects of type B

INFO 620Lecture #835 This clarifies Figure 20.3, p. 305 –Need reference attribute for SalesLineItem, since only it has no arrowhead –So productSpec is the reference attribute, of type ProductSpecification since multiplicity=1 Reference Attributes >

INFO 620Lecture #836 Reference Attributes Another example: –Let’s say a Customer wants to make a Rental (per Prof. Song’s video rental example) –Association is bidirectional, hence need both reference attributes and their methods