Systems Analysis & Design Methods UML diagrams. 2 System Analysis & Design Methods: UML diagrams Books UML for JAVA Programmers UML for JAVA Programmers.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Author: Graeme C. Simsion and Graham C. Witt Chapter 4 Subtypes & Supertypes.
Data Modeling. What are you keeping track of? You begin to develop a database by deciding what you are going to keep track of. Each thing that you are.
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Introduction to MS Access, building tables, creating keys, creating relationships BSAD 141 Dave Novak.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Entity Relationship (ER) Modeling
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
Introduction To System Analysis and Design
From Class Diagrams to Databases. So far we have considered “objects” Objects have attributes Objects have operations Attributes are the things you record.
Agenda for Week 1/31 & 2/2 Learn about database design
UML a crash course Alex Lo Brian Kiefer. Overview Classes Class Relationships Interfaces Objects States Worksheet.
1 A Student Guide to Object- Orientated Development Chapter 9 Design.
SE-565 Software System Requirements More UML Diagrams.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
Blaha and Rumbaugh Sections 7.2 and 8.2
Database Design.  Define a table for each entity  Give the table the same name as the entity  Make the primary key the same as the identifier of the.
Relationships. In the Interaction diagrams, we began to look at how classes communicate with one another. Now, we'll focus on the relationships between.
UML for Java Programmers Object Mentor, Inc. Copyright  by Object Mentor, Inc All Rights Reserved
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
Creating Entity Relationship Diagrams. Identify data stores The data stores are easy to identify if you have already created a data flow diagram If you.
Database Design Using the REA Data Model
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
What is a domain model? “A domain model captures the most important types of objects in the context of the business. The domain model represents the ‘things’
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Introduction to Sequence Diagrams
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
DOMAIN MODE: ASSOCIATIONS, MULTIPLICITY AND ATTRIBUTE-TEXT NOTATION SYS466.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
© Copyright 2002, L. M. Linson, may be freely used with this notice Practical Database Design “Structuring Your Tables” by Larry Linson, presented to the.
Systems Analysis & Design Methods VII OOD-principles.
Chapter 12: Designing Databases
© Copyright 2002, 2005, 2013 L. M. Linson, may be freely used with this notice Practical Database Design “Structuring Your Tables” by Larry Linson, presented.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
M Taimoor Khan Course Objectives 1) Basic Concepts 2) Tools 3) Database architecture and design 4) Flow of data (DFDs)
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
What are Sequence Diagrams? Collaboration Diagrams allow designer to specify message flow between collaborating objects –Focus on relationship between.
Information System Design IT60105
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Lesson 2: Designing a Database and Creating Tables.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Chapter 3: Introducing the UML
Year 12 > 13 Applied GCE ICT Unit 7 Using Database Software.
Chapter 1 Overview of UML for Java Programmers. 2 Outline Diagram Types Diagram Types Class Diagrams Class Diagrams Object Diagrams Object Diagrams Sequence.
Order Database – ER Diagram
View Integration and Implementation Compromises
Inheritance Allows extension and reuse of existing code
Database Normalization
Tables and Their Characteristics
Order Database – ER Diagram
The Object Oriented Approach to Design
CS 426 Senior Projects Chapter 9: Relationships
IMAT5205 Systems Analysis and Design
Modeling Behavior in Statechart Diagrams
Relationships—Topics
Presentation transcript:

Systems Analysis & Design Methods UML diagrams

2 System Analysis & Design Methods: UML diagrams Books UML for JAVA Programmers UML for JAVA Programmers (Robert C. Martin © Copyright 2003.) A book you should read, even if it is not necessary for this course. UML distilled UML distilled Martin Fowler

3 System Analysis & Design Methods: UML diagrams Contents Normalized data model (not UML) Normalized data model (not UML) Class Model, conceptual (very useful) Class Model, conceptual (very useful) Class Model, design (very useful) Class Model, design (very useful) Object Model (useful) Object Model (useful) Sequence Diagram Sequence Diagram State diagram (very useful) State diagram (very useful) Collaboration diagrams (very useful) Collaboration diagrams (very useful) Using Collaboration diagrams (very useful) Using Collaboration diagrams (very useful)

4 System Analysis & Design Methods: UML diagrams Just to compare with class model: normalized relational database model (Not part of UML) Customer name address CompanyCustomer PrivateCustomer Product name price OrderedItem quantity * 1 Order date * 1 * ? PK customer_id FK customer_id PK order_id PK product_id FK order_id FK product_id } PK

5 System Analysis & Design Methods: UML diagrams Remarks I haven’t given the usual ERD diagram notation. I haven’t given the usual ERD diagram notation. Instead, I follow these rules: Arrows start from the foreign key and end with the primary key. Arrows start from the foreign key and end with the primary key. Why ? This way, the databasemodel can be directly compared to the OO class model. It also makes clear that the many-to-one-relations are realized using a field that sits on the many-side and identifies the one side. Not vice-versa.

6 System Analysis & Design Methods: UML diagrams Remarks All my arrows go up All my arrows go up Why ? This way, because the arrows go from the foreign key to the primary key, the many side –if there is one- is always lower than the one-side. Also, the entity/table that is dependend is always lower than the entity/table it depends on. Also, the entity/table that is dependend is always lower than the entity/table it depends on. This way, dependencies and (most) cardinalities can be derived at a glance. -> No arrow-staring nor diagram-deciphering required.

7 System Analysis & Design Methods: UML diagrams Remarks I do not show… I do not show… In order to be able to compare to the UML class model, certain details, that are part of ER-diagrams are not shown: …Relationship-types Identifying Non identifying Informative

8 System Analysis & Design Methods: UML diagrams Differences with Class models at specification/implementaion level Every field is supposed to be persistent. Every field is supposed to be persistent. Pointers/Navigatabilities are always UNIdirectional. Pointers/Navigatabilities are always UNIdirectional. One to many relationships always point to the one-side. One to many relationships always point to the one-side. The other way around would brake first normal form. The other way around would brake first normal form. Normalization demands ‘no data redundancy’ nor calculated fields. (OO specification/implementation level class models would allow private redundant attributes e.g. for cashing) Normalization demands ‘no data redundancy’ nor calculated fields. (OO specification/implementation level class models would allow private redundant attributes e.g. for cashing) E.g. no orderPrice field in order !!! E.g. no orderPrice field in order !!! No process/methods/procedures/functions No process/methods/procedures/functions E.g. no getOrderPrice method !!! E.g. no getOrderPrice method !!! Possible sub-type tables (if allowed) cannot exploit polymorphism Possible sub-type tables (if allowed) cannot exploit polymorphism

9 System Analysis & Design Methods: UML diagrams Class Diagram Class diagrams are static. This means they are independent of the moment in runtime. E.g. even if you might have hundreds of orders for one customer, you would still draw just one class diagram ‘Order’. Class diagrams are static. This means they are independent of the moment in runtime. E.g. even if you might have hundreds of orders for one customer, you would still draw just one class diagram ‘Order’.

10 System Analysis & Design Methods: UML diagrams Class Diagram conceptual level Customer +creditRating:String -name -adress CompanyCustomer +billForMonth(int) PrivateCustomer -contact Product +getPrice():double -name -price OrderedItem +getOrderedItemPrice():double -quantity * 1 Order +getOrderPrice:double -date * 1 * 1 Association Attributes Multiplicity –or- Cardinality Generalization Method

11 System Analysis & Design Methods: UML diagrams Class Diagram specification level Customer +creditRating:String -name -adress CompanyCustomer +billForMonth(int) PrivateCustomer -contact Product +getPrice():double -name -price OrderedItem +getOrderedItemPrice():double -quantity * 1 Order +getOrderPrice:double -date * 1 * 1 * Navigatability

12 System Analysis & Design Methods: UML diagrams Class Diagram specification level ‘Specification’ means ‘Design’ ‘Specification’ means ‘Design’ You make design decisions. The arrowheads show which class has the attribute pointing to the other(s). An association with a navigatability in 1 direction is called: unidirectional association. E.g. A customer points to many orders means: E.g. A customer points to many orders means: Each Customer object will have a List attribute of Order- objects (rather than than each Order-object has a Customer- attribute)

13 System Analysis & Design Methods: UML diagrams Class Diagram specification level OrderedItem +getOrderedItemPrice():double Order +getOrderPrice:double * 1 OrderedItem +getOrderedItemPrice():double Order +getOrderPrice:double * 1 OrderedItem +getOrderedItemPrice():double Order +getOrderPrice:double * 1 - orderedItems: List - order: Order Design solution n° 1 Design solution n° 2 Conceptual

14 System Analysis & Design Methods: UML diagrams Class Diagram specification level Navigatablitities are important. With design solution n°2, the functionality of the following code in Order would be hard to write. Thanks to right navigatability, I can delegate to OrderedItem: public class Order{ … public double getOrderPrice(){ public double getOrderPrice(){ double orderPrice = 0; double orderPrice = 0; OrderedItem oItem; OrderedItem oItem; for(int i = 0; i < orderedItems.size(); i++){ for(int i = 0; i < orderedItems.size(); i++){ oItem = (OrderdItem) orderedItems.get(i); oItem = (OrderdItem) orderedItems.get(i); orderPrice += oItem.getOrderedItemPrice(); orderPrice += oItem.getOrderedItemPrice(); } return orderPrice; return orderPrice; } …}

15 System Analysis & Design Methods: UML diagrams Object Diagram Object diagrams are dynamic. This means they depend on the moment of time during the system run. At implementation level, they are a snapshot of memory. E.g. if at a certain moment in time a customer record has 42 orders and you want to model this, you should draw 42 order rectangles. Object diagrams are dynamic. This means they depend on the moment of time during the system run. At implementation level, they are a snapshot of memory. E.g. if at a certain moment in time a customer record has 42 orders and you want to model this, you should draw 42 order rectangles.

16 System Analysis & Design Methods: UML diagrams Object Diagram :PrivateCustomer -name = “Scott” :Order -date = 1/1/2003 :Order -date = 1/5/2003 :Order -date = 20/1/2001 orders.get(0) orders.get(1) orders.get(2) Link :OrderedItem -quantity=2 :OrderedItem -quantity=3 :OrderedItem -quantity=10 :OrderedItem -quantity=250 … orderedItems.get(0) orderedItems.get(1) orderedItems.get(2) orderedItems.get(0) :Product -name= “Dell Dim 2.0” -price = product :Product -name= “Compac X2” -price = product

17 System Analysis & Design Methods: UML diagrams Sequence Diagram : OrderItem time getOrderedItemPrice() : Product getPrice() :double : Order Loop Data token Activation

18 System Analysis & Design Methods: UML diagrams Sequence Diagram (continued) [ topNode==null] [topNode!=null ] :TreeMap add(key,value) Guard

19 System Analysis & Design Methods: UML diagrams Sequence diagram (continued) Sequence diagrams are generally harder to understand than the code they try to model, especially when loops and conditions are involved. Sequence diagrams are generally harder to understand than the code they try to model, especially when loops and conditions are involved.

20 System Analysis & Design Methods: UML diagrams State Diagram (FSM) ReadingNormalCode ReadingString DoubleQuoteEncountered/StartWritingString DoubleQuoteEncountered/SaveWrittenString NonDoubleQuoteEncountered/AppendToString Start NonDoubleQuoteEncountered/AppendToString Event Action State Transition

21 System Analysis & Design Methods: UML diagrams :Button Collaboration diagram :Button send:Button :Dialer:Radio :Screen:Speaker Example taken from UML for Java programmers Robert C. Martin (2003). The letter A means ‘separate process‘ 1*:digit(n) 1.1:displayDigit(n) 1.2:tone(n) 2.1:connect(pno) A1: inUse 2: Send

22 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram Class diagrams can be used as a basis for implementation. We build class diagrams in small steps: Take a part of the problem (e.g. a use case) Take a part of the problem (e.g. a use case) Build a collaboration diagram in a step by step fashion. Build a collaboration diagram in a step by step fashion. Extract a class diagram Extract a class diagram Improve the design (not shown) Improve the design (not shown)

23 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram Example problem: Software that controls a celular phone. Example part of the problem: ‘making the phone call.’ (adapted from UMLFJP R.C. Martin )

24 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram building the diagram How do you start making a phone call ? You press a button with a digit on it. We imagine some controlling piece of machinery capable of dialing, that remembers the digits we entered, say a dialer. :Button :Dialer 1*:digit(n)

25 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram building the diagram Anything else happening when you press a digit button ? Yes. The dialer needs to get the digit to be displayed on screen and maybe a sound to be emitted by a speaker. :Button :Dialer :Screen:Speaker 1*:digit(n) 1.1:displayDigit(n) 1.2:tone(n)

26 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram building the diagram You keep on hitting digit buttons forever ? No. Eventually you press the green phone button, lets say send button. You expect the dialer to do what needs to be done. :Button send:Button :Dialer :Screen:Speaker 1*:digit(n) 1.1:displayDigit(n) 1.2:tone(n) 2: Send

27 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram: building the diagram Lets say the dialer delegates the work of ‘sending the phone number to the network’. It delegates this to a piece called radio. When a connection is finally established, the screen might need to show an ‘in Use’ message. This is beyond the direct control of the cellular phone (different thread). :Button send:Button :Dialer:Radio :Screen:Speaker 1*:digit(n) 1.1:displayDigit(n) 1.2:tone(n) 2.1:connect(pno) A1: inUse 2: Send

28 System Analysis & Design Methods: UML diagrams using a Collaboration Diagram: Deriving an initial class diagram +digit(n:int) +send +tone(n:int) +displayDigit(n:int) +connect(pno:String) Button Speaker Screen Dialer Radio -lastpno:String * Directions of messages becomes navigatabilities Directions of messages becomes navigatabilities Sent messages become methods Sent messages become methods Object counts becomes cardinalities Object counts becomes cardinalities