IS0514Slide 1 IS0517 Lecture Week 8 Class Diagrams III.

Slides:



Advertisements
Similar presentations
Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
Advertisements

Systems Analysis and Design with UML Version 2.0, Second Edition
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 9 Object, Package, Component and Deployment Diagrams (Based on Fowler, 2004,
IS514 Lecture Week 9 CRC Cards.
© 2010 Bennett, McRobb and Farmer1 Requirements Analysis 1: Requirements and Classes Based on Chapter 7 of Bennett, McRobb and Farmer: Object Oriented.
IS0514Slide 1 IS0514 Lecture Week 4 Use Case Modelling (2)
IS514Slide 1 IS514 Lecture Week 7 Class Diagrams II.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
03/12/2001 © Bennett, McRobb and Farmer Class Design Based on Chapter 14 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design.
03/12/2001 © Bennett, McRobb and Farmer 2002 Refining the Requirements Model Based on Chapter 8 of Bennett, McRobb and Farmer: Object Oriented Systems.
03/12/2001 © Bennett, McRobb and Farmer Problems in Information Systems Development Based on Chapter 2 of Bennett, McRobb and Farmer: Object Oriented.
- 1 - © Houman Younessi 2010 MGMT Advanced Systems Analysis and Design A dvanced S ystems A nalysis and D esign Fall 2010 Convener: Houman Younessi.
Data modelling uses two main techniques Entity relationship (E-R) modelling: a top- down approach Normalisation: a bottom-up approach.
Requirements Analysis
03/12/2001 © Bennett, McRobb and Farmer Activity Diagrams Based on Chapter 5 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
Chapter 13: Object-Oriented Programming
Systems Analysis and Design in a Changing World, 6th Edition
03/12/2001 © Bennett, McRobb and Farmer Use Case Diagrams Based on Chapter 6 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Mapping ERM to relational database
IS0514 Lecture Week 3 Use Case Modelling.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
Refining the Requirements Model
IS0514 Lecture - Week 2 Best Practice Development Methodology.
Data Modeling with ER Diagrams What is an Entity-Relationship Model? How is an E-R model represented as an E-R diagram? How can a video store be modeled.
Copyright © 2003 Addison-Wesley Jesper Rosholm Tørresø.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
IS0514Slide 1 IS0514 Lecture Week 5 Introduction to Object Orientation.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
R McFadyen Chapter 7 Conceptual Data Modeling.
IS0514Slide 1 IS0514 Lecture - Week 1 (Semester 2) Business Systems Development Tools and Techniques.
Class diagram. Purpose of Structural Models Class diagrams represent –Generic Categories (classes) of things (objects) –Define relationships among Generic.
Assignements. CSC343: Intro. to Databases2 Exercise 1 Superkeys: Candidate keys: Primary key:
Distributed Java Programming Distributed Java Programming Class #2 August 22, 2002.
Topic 5 Introduction to UML Diagrams. 1-2 Objectives To introduce UML Diagrams A diagrammatic way of showing the relationships among classes This will.
© Bennett, McRobb and Farmer Requirements Analysis Based on Chapter 7 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design.
Centre for Computer Technology ICT214 Object Oriented Design and Programming Week 02 – Classes, Objects, Instances Richard Salomon and Umesh Patel Centre.
03/12/2001 © Bennett, McRobb and Farmer 2005 Refining the Requirements Model Based on Chapter 8 of Bennett, McRobb and Farmer: Object Oriented Systems.
03/12/2001 © Bennett, McRobb and Farmer 2002 Refining the Requirements Model Based on Chapter 8 of Bennett, McRobb and Farmer: Object Oriented Systems.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Design Model Lecture p6 T120B pavasario sem.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Chapter 17 – Object- Oriented Design. Chapter Goals To learn about the software life cycle To learn about the software life cycle To learn how to discover.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Object-Oriented Analysis and Design Use cases Finding classes Collaboration and Sequence diagrams Associations between classes.
INFSY 535.  Small systems  Larger systems 1.Understand the program requirement- what 3. Write and test each part (unit testing) 4. Maintenance 2. Specify.
Caroline Stirling Academic Support Librarian –
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
Inf 43: Introduction to Software Engineering May 7, 2016.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Object-Orientated Analysis, Design and Programming
UML-Class Diagrams. UML-Class Diagrams Order placement problem A Company has two types of customers, corporate customers and personal customers. All.
Chapter 9 Domain Models.
Problems in Information Systems Development
A Review or Brief Introduction
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Systems Analysis and Design With UML 2
ER MODEL Lecture 3.
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
IS0514 Lecture Week 3 Use Case Modelling.
Business Analysis More on Classes Chris Russell O2.41
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Object Oriented System Design Class Diagrams
Refining the Requirements Model
Presentation transcript:

IS0514Slide 1 IS0517 Lecture Week 8 Class Diagrams III

IS0514Slide 2 So far Identifying –Classes Attributes Operations –Types of relationships –Multiplicity How to draw class diagrams This week –Class Diagrams Visibility Association Classes Constraints Recursive relationships –Object Diagrams

IS0514Slide 3 Visibility Quick Question: –Are all attributes available to other objects? –Consider the class person –Which attributes should be available? –Which operations should be available? Attributes –Probably many of them are private Operations –Probably most of them are public

IS0514Slide 4 Visibility in UML VisibilityDescriptionSymbol PublicIs directly accessible by an instance of any class + PrivateMay only be used by an instance of the class that includes it - ProtectedMay be used either by an instance of the class that includes it or by a subclass of that class # PackageIs directly accessible only by instances of a class in the same package ~ Design Analysis

IS0514Slide 5 Examples

IS0514Slide 6 Exercise 1 Given the class BankAccount below Identify the visibility of the (i.e., choose + or – ) for: –Attributes –Operations

IS0514Slide 7 Exercise 1 – One Answer I would love to be able to set the balance on my account but can I?

IS0514Slide 8 Association Classes Sometimes the way in which objects of a class are associated is just as important as the objects of a class themselves Consider the association between Student and Module. Where should our system record the student’s marks on for each student on each module? StudentModule 1..*6 is taking  is taking mark : Integer association class

IS0514Slide 9 Exercise 2 – From Seminar A publisher specialises in producing volumes of short stories. Most stories are by one author, but occasionally, two authors collaborate on a story. Stories that have been originally published in one volume may be re-issued in other collections. Whenever a story is used in a volume, various operational details must be recorded. Stories have a title and a genre. Authors have a name and an address. Collections have a title and an introduction. When a story is used in a volume the position in the volume needs to be recorded. Redraw including –Multiplicity –Association Class

IS0514Slide 10 Exercise 2 -One Solution  

IS0514Slide 11 Constraints a constraint is a condition that has to be satisfied Use with care –Too much text on a diagram –Can be over used Order dateReceived isPrepaid number: String price: Money dispatch() close() Order Line quantity : Integer price : Money isSatisfied : Boolean * line items 1 {if Order.customer.creditRating is “poor”, then Order.isPrepaid must be true} Customer creditRating getCreditRating 1..* 1

IS0514Slide 12 Constraints... continued another common situation is when there is an ‘exclusive or’ between two associations CopyBook Journal 1..* is a copy of 0..1 is a copy of 1..* 0..1 CopyBook Journal 1..* is a copy of 0..1 is a copy of 1..* 0..1 {or} under-constrainedUsing an or-constraint

IS0514Slide 13 Exercise 3 Consider a car rental company The company will only rent a car to customers over the age of 25 

IS0514Slide 14 Exercise 3 – One Solution 

IS0514Slide 15 Exercise 4 Draw a very simple class diagram showing the relationship between children and their biological parents. Don’t worry about attributes etc. Can you represent the same relationship using only one class.

IS0514Slide 16 Exercise 4 – One solution

IS0514Slide 17 Recursive Association - is allowed, and can be useful ! an employee, as a manager, may manage other employees; each employee may be managed by another employee employee  manages 0..* 0..1

IS0514Slide 18 Class v. Object Diagram Staff staffName staffID staffstartdate staffdept AkhtarAli:Staff staffName=Akhtar Ali staffID=313 staffstartdate= staffdept=SDE full symbol for an object is a box with 3 compartments class name attributes operations an instance symbol shows both instance and class name underlined with a colon to separate in an instance symbol, both attribute names and values are given

IS0514Slide 19 Exercise 5 Given the class diagram Draw the object diagram given the following instances –Ford Fiesta £4999 –Subaru Impreza WRD £22000 with a flash stereo –Hyundai Accent £7995 with child seats

IS0514Slide 20 Exercise 5 – One Answer make=Ford model=Fiesta price=£4999 ThisFordFiesta:Car make=Subaru model=Impreza price=£22000 thisSubaruImpreza:Car make=Hyundai model=Accent price=£7999 thisHydundaiAccent:Car name=stereo :Accessory car accessory name=Child Seats childseats:Accessorycar accessory

IS0514Slide 21 This weeks reading ESSENTIAL READING Dennis A, Wixom B, and Tegarden D (2005) System Analysis and Design with UML version 2 second edition, Wiley Chapter 7 Further reading Bennett, S., McRobb, S. and Farmer, R. (2002) Object- Oriented Systems Analysis and Design using UML, 2nd Edition, McGraw-Hill Pages

IS0514Slide 22 Summary Visibility Association classes Constraints Recursive relationships Object diagrams Next week –Behavioural Model –Class Responsibility Collaboration Cards