CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) 877-8974 These slides and others.

Slides:



Advertisements
Similar presentations
CSSE 374: Object-Oriented Design Exercise Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and.
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Use cases.
CSSE 374: Introduction to Object- Oriented Analysis and Design Q1 Steve Chenoweth Office: Moench Room F220 Phone: (812)
CS 340 UML Class Diagrams. A model is an abstraction of a system, specifying the modeled system from a certain viewpoint and at a certain level of abstraction.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Copyright ©2004 Cezary Z Janikow 1 Domain Model n Visualization of entities and relationships n In UP presented as Class Diagrams – Classes, Relationships,
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
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.
Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1.
Unified Modeling Language
Object-Oriented Analysis and Design
CSSE 374: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
CSSE 374: Domain Model Refinements and Iteration 3 Preparations Q1 These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo, and others.
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
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”
CSSE 374: Interaction Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others derived.
CSSE 374: Final Perspectives on Software Architecture and Design These slides derived from Shawn Bohner, Curt Clifton, Alex Lo, and others involved in.
CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812)
CSSE 374: GRASP’ing at the First Five Patterns Principles Steve Chenoweth Office: Moench Room F220 Phone: (812)
CSSE 374: More Object Design with Gang of Four Design Patterns Steve Chenoweth Office: Moench Room F220 Phone: (812)
Chandan Rupakheti Office: Moench Room F203 Phone: (812) These slides and others derived from Shawn Bohner, Curt.
Object-Oriented Analysis and Design An Introduction.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Jan 21, Ron McFadyen1 Ch 10. Domain Model: Visualizing Concepts Domain model illustrated with a class diagram (with no operations defined)
Object-Oriented Analysis and Design Feb 25, 2009.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
SYS466: Analysis and Design Using OO Models Domain Class Diagram.
Object-Oriented Analysis and Design Feb 11, 2009.
Design Model Lecture p6 T120B pavasario sem.
System Sequence Diagram Chandan Rupakheti & Steve Chenoweth Week 5-3a.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Class diagrams Terézia Mézešová.
Chapter 16: UML Class Diagrams
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.
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.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
CSSE 374: UML Activity Diagrams
UML Diagrams: Class Diagrams The Static Analysis Model
Chapter 9 Domain Models.
UML Class Diagrams (more notation)
Chapter 16 UML Class Diagrams.
Introduction to Unified Modeling Language (UML)
Collaborations and Hierarchies
CSSE 374: Domain Model Refinements and Iteration 3 Preparations
Introduction to Unified Modeling Language (UML)
Chapter 11: Class Diagram
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Use cases Dr. X.
Design Model: Creating Design Class Diagrams
Presentation transcript:

CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo and others involved in delivering 374. Chandan Rupakheti Office: Moench Room F203 Phone: (812)

General solutions get you a 50% tip CS humor…

Plan for the Day, when we get to class Initial course comments – a fun exercise! Design Class Diagrams Design exercise that should help with Homework #2

Help Me Help You help me help you… Initial course comments – take out a piece of paper! List one helpful idea about the course:  Especially good, fun or useful thing  Especially need fixing thing  New idea for us to try Then…

UML Class Diagrams …George Washington & Betsy Ross realizing that design matters!

Design Class Diagrams (DCD) 1/2 Creation of DCDs builds on prior:  Domain Model (+detail to class definitions)  Interaction diagrams (identifies class methods) Creation of DCDs and interaction diagrams are usually created in parallel Q1

Design Class Diagrams (DCD) 2/2 DCDs illustrates the specifications for software classes and interfaces including: Classes, associations, and attributes Interfaces, with their operations and constants Methods Attribute type information Navigability Dependencies

Common UML Class Notation

Recipe for a Design Class Diagram 1)Identify all the classes participating in the software solution by analyzing the interaction diagrams 2)Draw them in a class diagram 3)Duplicate the attributes from the associated concepts in the conceptual model 4)Add method names by analyzing the interaction diagrams 5)Add type information to the attributes and methods 6)Add the associations necessary to support the required attribute visibility 7)Add navigability arrows to the associations to indicate the direction of attribute visibility 8)Add dependency relationship lines to indicate non- attribute visibility

Class Diagrams Do Double Duty Call them Domain Models when used for analysis at the conceptual level Call them Design Class Diagrams when used for design Q2 Navigability arrow Multiplicity only at target end Role name only at target end No association name

Attribute Text Attribute Text vs. Association Line Notation Preferred Avoid Role name is attribute name Q3

Guideline Good Practice: Example Q4

Showing Collection Attributes Q5 MultiplicitiesMultiplicities ConstraintsConstraints Preferred, less visual clutter

Operations Syntax:  visibility name(paramName:type, …) : returnType {properties}  + getPlayer(name:String) : Player {exception IOException} Also use syntax of implementation language  public Player getPlayer(String name) throws IOException Operation vs. operation contract vs. method

Cartoon of the Day

Keywords Categorize Model Elements KeywordMeaning Example Usage «actor» classifier is an actor shows that classifier is an actor without getting all xkcd «interface» classifier is an interface «interface» MouseListener {abstract} can’t be instantiatedfollows classifier or operation {ordered} set of objects has defined order follows role name on target end of association {leaf} can’t be extended or overridden follows classifier or operation

Generalization In Domain Model:  Says that the set of all NumberCards is a subset of the set of all Cards In DCD:  Says that, and that NumberCard inherits from Card

Dependencies Attribute association lines are solid Dependency lines are dashed Use dependency lines when a more specific line type doesn’t apply. Q6 Can label dependency arrows: e.g. «call», «create»

Interfaces in UML Q7

Composition More powerful than an attribute arrow Describes “whole-part” relationship Implies  Instance of part belongs to only one composite at a time  Part always belongs to a composite  Composite creates/deletes parts Q8 Association name in composition is always implicitly some “has-part” relation. So, it’s common to omit association or role name with compositions

Interaction Diagrams and Class Diagrams (DCD’s) Interaction diagrams show dynamic behavior Class diagrams show static behavior Tips:  Draw concurrently  Use two adjacent whiteboards, one for static and one for dynamic  Sketch communication diagrams, document using sequence diagrams

Exercise on DCD’s Break up into your project teams Given the following:  Domain Model and a Sequence Diagram Draw Design Class Diagram showing a Customer and the classes in a Rental package and a Video package for BrickBusters Video Store. Try to minimize dependencies. Q9

Store Address Phone# Customer name address phone# Video ID Transaction date Payment /amount: Money type authorization Initiates   Records- rental-of Pays-for  Transacts  Rents-from, Buys-from  Stocks  Selects  *1 1 * * 1 * 1..* * 1 Makes- Authorizes  1 1..* Rental dueDate ReturnDate ReturnTime VideoDescription title subjectCategory VideoSupplier address name newVideos Baske t Shelf location stock Membership ID startDate PricingPolicy perDayRentalCharge perDayLateCharge 1 Obtains  1 1  Maintains 1 * Determines- rental-charge  1 *  Contains 1 * * 1  Stores- video-on  Defines 1 *  Provides 1 * * Describes  Contains  1 0..*  Provides 1 0..* 1 1  Holds- videos-in 1

An SD Solution for Rent Video Example :Video findVideoToRent(ID,duration) Loop [more items] videoTitle, availability Checkout totalWithTaxes :Customer rentVideos :Video Description getVideoInfo(ID,duration) videoTitle, desc, availabilty selectVideoToRent(ID) selectedVideos(video List) updateAvailability(ID,duration)

+/∂ Feedback On a separate piece of paper – Please give us some team-level- anonymous feedback! Possible topics –  Class  Quizzes  Homework  Book  Projects  Schedule  …  Anything else Thanks – We’ll show results next class! + = things going well ∂ = things to fix

A CD Solution for Rent Video Example :Video 1: FindVideoToRent(ID,duration)  1.3: videoTitle, availability  3: Checkout  3.2: totalWithTaxes  :Customer rentVideos  :Video Description 1.1: getVideoInfo(ID,duration)  1.2: videoTitle, desc, availabilty  2: selectVideoToRent(ID)  3.1: selectedVideos(video List)  2.1: updateAvailability(ID,duration) 