Analysis Modeling Static Modeling.

Slides:



Advertisements
Similar presentations
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.
Advertisements

CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
Inheritance Inheritance Reserved word protected Reserved word super
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Ch 12: Object-Oriented Analysis
Sucha Smanchat  Steps in OOAD using UML  Use Case Diagram  Sequence Diagram / Communication Diagram  Class Diagram  State.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
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.
Class Diagram & Object Diagram
- 1 - © Houman Younessi 2010 MGMT Advanced Systems Analysis and Design A dvanced S ystems A nalysis and D esign Fall 2010 Convener: Houman Younessi.
UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams.
Analysis Modeling Dynamic Modeling. Requirements analysis Results in static and dynamic models – Scenario models: use cases (static), swimlane diagrams.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Abstract Classes and Interfaces
SE-565 Software System Requirements More UML Diagrams.
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.
Unified Modeling Language
Object-Oriented Analysis and Design
CS 106 Introduction to Computer Science I 04 / 13 / 2007 Friday the 13 th Instructor: Michael Eckmann.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Objects, Classes, and Basic Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Introduction to Objects Objects,
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Activity & Class Modeling Labs Discussion p3 T120B pavasario sem.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis activity Janice Regan,
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
CS 160: Software Engineering October 22 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
UML Class Diagram. A class diagram shows 1.Classes 2.The relationships between them.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
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.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Chapter 16 UML Class Diagrams.
Sub-Phase Low Level Design (cont)
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.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Activity & Class Modeling Labs Discussion p3 T120B pavasario sem.
UML Diagrams: Class Diagrams The Static Analysis Model
Class Diagram M. Seidl, et al., Introduction to Object-Oriented Modeling, Springer, Chaper 4. Soft copy (pdf) downloadable freely.
Unified Modeling Language—UML A Very Brief Introduction
Class Diagrams.
Reference: COS240 Syllabus
OO Domain Modeling With UML Class Diagrams and CRC Cards
Analysis Modeling Dynamic Modeling.
UML Unified Modelling Language
Object Oriented Analysis and Design
Object Oriented Analysis and Design Using the UML
CIS 375 Bruce R. Maxim UM-Dearborn
Objects, Classes, and Basic Class Diagrams
Class Diagrams.
Objects, Classes, and Basic Class Diagrams
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Introduction to UML Sources:
CIS 375 Bruce R. Maxim UM-Dearborn
Object Oriented System Design Class Diagrams
The generalization of class
Presentation transcript:

Analysis Modeling Static Modeling

Requirements analysis Results in static and dynamic models Scenario models: use cases (static), swimlane diagrams (dynamic) Class diagrams (static) Flow oriented diagrams (dynamic) Behavioral models: sequence diagrams (dynamic), state diagrams (dynamic) These models bridge the gap between requirements and implementation (code)

Classes through Class diagrams We’ve done use cases, time to move on to candidate classes, all of which should: Retain information Need services Have multiple attributes Have common attributes and operations Be essential requirements (in the problem space)

Selecting classes: example Run this slide to see animation ATMUser Yes PinNum Yes No Maybe retained information needed services multiple attributes common attributes common operations essential requirements

Class diagrams A box with at least three compartments: Student A box with at least three compartments: Class name Attributes Operations Responsibilities User-defined compartment Each class associated with other classes -major: String -gpa: Real -standing: String +add(section: Section) +drop(section: Section) -- The set of students known to the registration system -- An exception occurs if gpa falls below 2.0

Attribute syntax [visibility] name [multiplicity] [:type] [=initial-value] [{property-string}] visibility: public “+”, protected “#”, or private “-” name: capitalize first letter of each word that makes up the name, except for the first multiplicity: number, range, or sequence of number or ranges. type: built-in type or any user-defined class initial-value: any constant and user-defined object property-string: e.g, changeable, addOnly, frozen

Operation syntax [visibility] name [(parameter-list)] [:return-type] [{property-string}] visibility: “+”, “#”, “-” name: verb or verb phase, capitalize first letter of every word, except first parameter-list: coma separated list of parameters return-type: primitive type or user-defined type property-string: isQuery, sequential, guarded, concurrent

Example association Student Section -major: String -GPA: Real -standing: String -name: String -capacity: Integer +add(Student) +drop(Student) +checkPrereq(List<Student>) +add(Section) +drop(Section) Here, a Student is associated with a Section; one or both need the other in order to function

Associations An association is a structural relationship that specifies that objects of class may be connected to objects of another class Associations typically represent “long-lived” relationships In a library system a Person always has a name (association), but may infrequently have a book (dependency)

Association syntax Connect two classes Have labels and roles Have multiplicities Are directional (related to “has a” relationship) – the navigation Think about which class needs to know about the other; which class is an attribute of the other? Why/when do I care?

Exercise: How many instructors can a class section have? Student Semester 1..* 0..* 1 0..8 1..* Class Section Instructor 1..3 0..6 1..* <works for 1 1 1..* Department Course

How many instructors can a class section have? Answer: 1 to 3 Student Semester 1..* 0..* 1 0..8 1..* Class Section Instructor 1..3 0..6 1..* <works for 1 1 1..* Department Course

Attribute vs Association name is the role on the association (attribute) We generally don’t model built-in classes like String (they are just types for attributes) joe: Student Is basically the same as ... -name: String = “Joe Jones” name joe: Student Joe Jones : String 1

Types of associations Relation Generalization Association Dependency Binary Association N-ary Association Aggregation

Generalization A triangle on the side of the general class Same as inheritance hierarchy in Java Opportunity for reuse Graduate Student Person Student

Dependency One class uses another, but it’s a weaker form of association Not necessarily long-lived; the depend-or can exist without a depend-ee in the system Dashed line

Aggregation Means “part of” Symbolized by a white diamond Crust 1 1 1 Sauce Serving 1 1 Pizza * Order 1..3 1 1 Cheese Serving 0..9 1 4..* Topping Serving Slice

Composition Like aggregation, but the component cannot survive on its own Symbolized by a black diamond Room Building

Exercise Take a look at http://www.cs.gmu.edu/~kdobolyi/cs321/BookstoreExample4.jpg Does John McCain (who has 7 houses) have a problem using this system? If Barack Obama decides to create a Federal sales tax, how would we change the system? Why is there a display method in Item, Book, MusicCD and Software? An ItemOrder is part of how many Orders? Can you explain how a search works using this diagram?

Answer Take a look at http://www.cs.gmu.edu/~kdobolyi/cs321/BookstoreExample4.jpg Does John McCain (who has 7 houses) have a problem using this system? Yes; only 2 addresses associated with a customer If Barack Obama decides to create a Federal sales tax, how would we change the system? add federalTax attribute to Order class Why is there a display method in Item, Book, MusicCD and Software? each subclass has its own implementation, even though one was inherited from the parent An ItemOrder is part of how many Orders? 1 Can you explain how a search works using this diagram? No; this is a static diagram, and does not show “flow” or actions

Quiz review What two main components make up a class in a class diagram? How do you represent an attribute? What are all the options/parts? How do you represent a method? What are all the options/parts? What is an association? Draw it. What is a dependency? Draw it. What is a generalization? Draw it. What is an aggregation/composition? Draw it. When do you include an attribute, as opposed to modeling it with an association? What do the arrows mean on associations? What do the multiplicities mean on associations?

In-class exercise Let’s make a class diagram for an ATM Include a dependency Include a generalization Include a composition Include all multiplicities label all attributes Complete the exercises at http://www.cs.gmu.edu/~kdobolyi/cs321/hwk03.html Due next class

Team Project Examine the Quiz Game description/use cases In your teams, come up classes; At least one dependency, aggregation, and generalization All associations must have navigations and multiplicities All attributes and operations must have types and visibilities Turn in this assignment through XP-Dev