Classes and their relationships

Slides:



Advertisements
Similar presentations
From use cases to classes (in UML). A use case for writing use cases Use case: writing a use case Actors: analyst, client(s) Client identifies and write.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Lecture 9 Object-Oriented Analysis
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes (continued)
Lecture 4 Class Responsibility Collaboration Cards
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Chapter 5: Modeling Systems Requirements: Events and Things
From Problem Statement to Design
Systems Analysis and Design in a Changing World, Fifth Edition
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
1 Object orientation. 2 What benefits does OO give? Primarily –Encapsulation (Associates data & operations) –Types & specialisation –Software re-use.
1 Object-Oriented Analysis Use Case Driven. 2 The outline method for OOA 1.Identify object classes within the problem domain 2.Define the behaviour of.
Lecture 5: Modelling with Classes. © Lethbridge/Laganière 2005 Chapter 5: Modelling with classes2 5.1 What is UML? The Unified Modelling Language is a.
Object-Oriented Analysis and Design NGSSC Object-Oriented Scientific Programming, June 2012.
Jan 21, Ron McFadyen1 Ch 10. Domain Model: Visualizing Concepts Domain model illustrated with a class diagram (with no operations defined)
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes.
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis activity Janice Regan,
5 Systems Analysis and Design in a Changing World, Fifth Edition.
1 CMPT 275 Software Engineering Requirements Analysis Phase Requirements Analysis activity Janice Regan,
Design Model Lecture p6 T120B pavasario sem.
Keys for Relationship Sets The combination of primary keys of the participating entity sets forms a super key of a relationship set. – (customer-id, account-number)
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
CHAPTER 6 OBJECT ANALYSIS.
Identifying Object Relationships, Attributes, and Methods.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
5 Chapter 5: Modeling Systems Requirements: Events and Things Systems Analysis and Design in a Changing World.
Entity Relationship (E-R) Model
An informal, team oriented, OO design system
VOSE / VORD Lecture 08.
Chapter 12 – Object-Oriented Design
Identifying Object Relationships, Attributes and Methods
Object-Oriented Modeling
DATA REQIREMENT ANALYSIS
ATM OO Design and Implementation Case Study
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
The Movement To Objects
OBJECT ORIENTED CONCEPT
Chapter 5: Structural Modeling
Physical Data Model – step-by-step instructions and template
Use Case Model.
Chapter 11 Object-Oriented Design
Entity-Relationship Model
Collaborations and Hierarchies
Week 10: Object Modeling (1)Use Case Model
Database EER.
OO Domain Modeling With UML Class Diagrams and CRC Cards
Start at 17th March 2012 end at 31th March 2012
Abstract descriptions of systems whose requirements are being analysed
OBJECT RELATIONSHIPS, ATTRIBUTES, AND METHODS
UML’s StateChart FSM, EFSM in UML Concurrent states Tool support.
Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami
Software Architecture & Design Pattern
University of Houston-Clear Lake
CIS 375 Bruce R. Maxim UM-Dearborn
SYS466 Domain Classes – Part 1.
4: Object-oriented Analysis & Design
Database EER.
Object Oriented Analysis and Design
CIS 375 Bruce R. Maxim UM-Dearborn
Use Case Analysis – continued
ITEC324 Principle of CS III
ITEC324 Principle of CS III
From Class Diagram to Contract Diagram
Presentation transcript:

Classes and their relationships

OO Design Identify a first set of candidate classes Add associations and attributes Find generalizations List the main responsibilities of each class Decide on specific operations Iterate over the entire process until the model is satisfactory Add or delete classes, associations, attributes, generalizations, responsibilities or operations Identify interfaces Apply design patterns Don’t be too disorganized. Don’t be too rigid either. C-S 446/546

How to find classes? Nouns in requirements document or use case descriptions may provide a good starting point, but often are inadequate Each class should contain a distinct set of operations relevant to the system under consideration Think of a class as an ADT Remove vague classes Classes that do not adequately describe themselves A class that represents the internet C-S 446/546

How to find classes (continued) Try not to include implementation-oriented classes in the analysis model May be introduced later during design and/or implementation Examples: array, tree, list These classes will not only occupy so much space in the diagram but also tend to divert the focus of analysis C-S 446/546

How to identify associations? An association corresponds to a semantic dependency between classes Class A uses a service from class B (client-server) Class A has a structural component whose type is class B (aggregation) Class A sends data to or receives data from class B (communication) C-S 446/546

How to identify associations (continued) Include only those associations that are relevant to the current model Constrained by assumptions, simplifications, system boundary (what is expected to be provided by the system) Three different associations between “Faculty member” and “Course” “Faculty member” teaches “Course” in a course registration system “Faculty member” creates “Course” in a curriculum development system “Faculty member” evaluates “Course” in a course evaluation/inspection system C-S 446/546

How to identify associations (continued) Eliminate redundant associations “Faculty member” teaches “Course” “Course” is taught between “Time” to “Time” Therefore, “Faculty member” teaches between “Time” to “Time” use transitivity between associations Remember that subclasses inherit the associations of a superclass C-S 446/546

Example C-S 446/546

How to identify aggregations? Aggregations are also associations Identify as Association if it is not clear whether it is Association or Aggregation “Mail” has “Address” (aggregation) “Mail” uses “Address” for delivery (association) “Customer” has “Address” (aggregation) “Customer” resides at “Address” (association) “TV” includes “Screen” (aggregation) “TV” sends information to “Screen” (association) C-S 446/546

How to identify specialization? Generally, specialization relationships are noticeable in the application domain Top-down approach “Student”, “Full-time Student”, “Part-time Student” “TV”, “Plasma TV”, “Flat Panel TV” “Customer”, “Bank manager”, “Teller” C-S 446/546

How to identify specialization (continued) Some of them are discovered during analysis Bottom-up approach “Part-time Instructor” derived from “Instructor” and “Student” while modeling a department “User” derived from “Customer”, “Bank Manager” and “Teller” while modeling an ATM system “Material” derived from “Book”, “Journal” and “Magazine” while modeling a library catalog system C-S 446/546

Example C-S 446/546

Example C-S 446/546

Deriving components of a class diagram from a use case diagram Actors are potential candidates for classes Sometimes, an actor may not be modeled as a class Specialization between actors will end up in specialization relationship between the corresponding classes C-S 446/546

Deriving components of a class diagram from a use case diagram Two actors may be related to each other if they are connected through a series of use cases The classes corresponding to these actors will thus have an association See the ATM example – the actor “User” is related to “Account” because of the use cases “deposit” and “update account” The relationship among use cases will be exploited later in dynamic modeling C-S 446/546

Airline Reservation System Ootumlia Airlines run sightseeing flights from Java Valley, the capital of Ootumlia. The reservation system keeps track of passengers who will be flying in specific seats on various flights, as well as people who will form the crew. For the crew, the system needs to track what everyone does, and who supervises whom. Ootumlia Airlines expects to expand in the future so the system needs to be flexible; in particular, it will be adding a frequent-flier plan. C-S 446/546

Exercise Draw a use-case diagram Class diagram C-S 446/546