Chapter 11: Class Diagram

Slides:



Advertisements
Similar presentations
Object Design Examples with GRASP
Advertisements

Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
March Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns Assigning responsibilities to objects to achieve user goals Section 17.4.
Feb R. McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Fall 2009AXS-3913 Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Oct Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns P. 248: “The assignment of responsibilities and design of collaborations.
Fall 2009ACS-3913 Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
Feb 4, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – (interfaces,
Feb Ron McFadyen1 Use Case Realizations with GRASP Patterns “The assignment of responsibilities and design of collaborations are very important.
November Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Object-Oriented Analysis and Design
November Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
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.
Object-Oriented Analysis and Design
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”
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
Chapter 7: Object Design Examples with GRASP. Objective Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to.
Object-Oriented Analysis and Design An Introduction.
Object Design Examples with GRASP (Ch. 18)
1 Lecture 6: Operation Contracts. 2 Overview  What is contract ?  The guidelines for writing contracts for the system operations.  Use Case realizations.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
DOMAIN MODEL- VISUALIZING CONCEPTS Identify conceptual classes related to the current iteration requirements. Create an initial domain model. Distinguish.
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.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Larman chapter 101 Domain Model: Visualizing concepts Larman chapter 10.
OO Methodology Elaboration Phase Iteration 1- Part 3.
1 Chapter 9: Operation Contracts Chapter 13 in Applying UML and Patterns Book.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
Use-Case Model: Adding Detail with Operation Contracts.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
Oct 3, Ron McFadyen1 GRASP Patterns 1.Expert 2.Creator 3.Controller 4.Low Coupling 5.High Cohesion.
1 M206 Chapter 31: An Overview of Software Development 1.Defining the problem 2.Analyzing the requirement – constructing initial structural model 3.Analyzing.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
Ch 17: Use Case Realizations with GRASP Patterns
Mapping Designs to Code. It specify how to map the design into object oriented language The UML artifacts created during the design work, the interaction.
Object Design Examples with GRASP
TK2023 Object-Oriented Software Engineering
Chapter 9 Domain Models.
Domain Model: Visualizing concepts
GRASP: Visibility and Design
Conception OBJET GRASP Patterns
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
Chapter 11: Collaboration Diagram - PART1
Chapter 5: Object Oriented Analysis and Design
CONTENTS Object-Oriented Modeling Using UML
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
UML PPt by: Hong Qing Yu.
Project 1 Guide System Analysis & Design
Requirements To Design In This Iteration
Chapter 10: Visibility Chapter 18 in Applying UML and Patterns Book.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
OBJECT ORIENTED ANALYSIS AND DESIGN
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Chapter 16 UML Class Diagrams
Implementation Model: Mapping Designs to Code
Operation Contracts Ch. 11.
Domain Model: Visualizing Concepts
Chapter 11: Class Diagram
Design Model: Creating Design Class Diagrams
Presentation transcript:

Chapter 11: Class Diagram Chapter 19 in Applying UML and Patterns Book.

Overview What is Class Diagram? The different between Domain Model and Design Model. How to build UML Class Diagram (Class, Attribute, Relationship).

What is Class Diagram ? A class diagram shows the existence of classes and their relationships in the logical view of a system. UML modeling elements in class diagrams: Classes and their structure and behavior. Association, aggregation, dependency, and inheritance relationships. Multiplicity and navigation indicators. Role names.

Dependency Dependency means “One class uses the other” A dependency relationship indicates that a change in one class may effect the dependent class, but not necessarily the reverse. A dependency relationship is often used to show that a method has object of a class as arguments. Basic Class Dependent Class Depends on

Generalization hierarchy

Generalization hierarchy with added detail

Domain Model (Conceptual Model) vs Domain Model (Conceptual Model) vs. Design Model Classes (Class Diagram) (Conceptual Model) (Class Diagram)

Example Design Class Diagrams (DCD)

Creating NextGen POS DCD Identify all the classes participating in the software solution. Do this by analyzing the interaction diagrams. Draw them in a class diagram. Duplicate (i.e. copy) the attributes from the associated concepts in the Domain Model.

Steps: Design to Code Main goal is to define Design Class Diagram with Attributes and Methods Defining Concepts Adding Reference Attributes, attributes. Creating methods from interaction diagrams: Find & Add methods. Add type information to the attributes and methods Add navigability and associations. Collection classes in code.

Creating NextGen POS DCD Add method names for each class by analyzing the interaction diagrams.

Creating Methods from Sequence Diagrams 12 Creating Methods from Sequence Diagrams :Register :ProductCatalogue Sale :SalesLineItem :ProductSpec Constructor 1. Spec=getSpecification(itemID) 1.1 Spec=Find(itemID) 2. makeLineItem(spec,quantity) 2.1 sli= Create(spec,quantity) 2.1.1 Sub=getSubTotal(itemID) 2.2 Add(sli)

Creating NextGen POS DCD Add type information to the attributes and methods.

Question: Register – addLineItem Method The addLineItem sequence diagram will be used to illustrate the Java definition of the addLineItem method. Which class addLineItem should belong to? The addLineItem message is sent to a Register instance, therefore the addLineItem method is defined in class Register. public void addLineItem (itemID itemID, int quantity); Message 1. A getSpecification message is sent to the productCatalog to retrieve a productSpecification. productSpecification spec = catalog.getSpecification (itemID); Message 2. The makeLineItem message is sent to the Sale. sale.makeLineItem (spec, quantity);

Register - addLineItem Method Public void addlineitem(itemid itemid, int quantity) { productSpecification spec = catalog.getSpecification(itemID); sale.makeLineItem(spec, quantity); } Public productSpecification getSpecification(itemID){ spec := find(itemID); Return spec; } Public void makeLineItem (productSpecification spec, int quantity){ sli= create(spec, quantity); //new in java add(sli);

Skeletal definition of Register Class

Collection Classes in Code

Adding Navigability & Dependency Relationships