Executable UML The Models are the Code - Executable UML Lecture 4 - How to Build Class Models Paul Krause.

Slides:



Advertisements
Similar presentations
Structured Design The Structured Design Approach (also called Layered Approach) focuses on the conceptual and physical level. As discussed earlier: Conceptual.
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 6 Advanced Data Modeling.
Database Systems: Design, Implementation, and Management Tenth Edition
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington UML for design: Class Diagrams.
Design Principles: Faithfulness
Essentials of class models. 2 A very simple class model In UML, a class is shown in a class diagram as a rectangle giving its name.
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
1 CSE491-RE: UML Classes The OO Solution The OO model closely resembles the problem domain –Base your model on the objects in the problem domain Iteratively.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
CHAPTER 6 Statistical Analysis of Experimental Data
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
Use Case Analysis – continued
Foundations This chapter lays down the fundamental ideas and choices on which our approach is based. First, it identifies the needs of architects in the.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1.
Trisha Cummings.  Most people involved in application development follow some kind of methodology.  A methodology is a prescribed set of processes through.
The chapter will address the following questions:
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA.
ZEIT2301 Design of Information Systems Structural Design: Class Diagrams School of Engineering and Information Technology Dr Kathryn Merrick.
Executable UML The Models are the Code - Executable UML CS387 Paul Krause.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
Internet Software Development Putting it all together Paul J Krause.
DOMAIN MODEL— PART 2: ATTRIBUTES SYS466. Looking For Potential Classes “Know the business”. Ask Questions Identify business concepts; filter nouns (person,
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause.
More on “The Huddersfield Method” A lightweight, pattern-driven method based on SSM, Domain Driven Design and Naked Objects.
Structural Modeling Chapter 7
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Chapter 8 Data Modeling Advanced Concepts Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
Executable UML The Models are the Code - Executable UML Lecture 6 - Associations Paul Krause.
Lecture 13-17, chitkara university.  Gives a conceptual framework of the things in the problem space  Helps you think – focus on semantics  Provides.
Chapter 9 Applying UML and Patterns -Craig Larman
Lecture 6: Structural Modeling
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
The OO Solution The OO model closely resembles the problem domain
Design Model Lecture p6 T120B pavasario sem.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
Domain Model—Part 2: Attributes.  A logical data value of an object  (Text, p. 158)  In a domain model, attributes and their data types should be simple,
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Executable UML The Models are the Code - Executable UML Lecture 5 - Attributes and Relations Paul Krause.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Chapter 16 UML Class Diagrams.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Appendix H: The Semantic Object Model.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
Chapter 5: Structural Modeling
Algorithms and Problem Solving
Chapter 9 Domain Models.
OBJECT ORIENTED CONCEPT
Chapter 5: Structural Modeling
Chapter 16 UML Class Diagrams.
The OO Solution The OO model closely resembles the problem domain
Assignment and Arithmetic expressions
Business Process Measures
The OO Solution The OO model closely resembles the problem domain
Lecture Software Process Definition and Management Chapter 3: Descriptive Process Models Dr. Jürgen Münch Fall
Object Oriented Programming
SYS466 Domain Classes – Part 1.
DCT 2053 DATABASE CONCEPT Chapter 2.2 CONTINUE
Domain Model: Visualizing Concepts
Presentation transcript:

Executable UML The Models are the Code - Executable UML Lecture 4 - How to Build Class Models Paul Krause

Executable UML Lecture 4 - How to Build Class Models v Specifications vs Things v Interactions v Roles  working within our modelling goals v Attributes

Executable UML Specification Classes Aircraft Specification Model number {I} Stall profile Weight Wingspan Fuel consumption Aircraft Registration number {I} Maintenance status Assigned pilot Assigned mechanic Hours flown 1 design is specified by 0..* specifies design of R1 Abstract Properties common to a specific aircraft type Concrete Properties common to a specific aircraft instance Distinct lifecycles and properties

Executable UML Specification Pattern Widget Specification Model number {I} Widget Serial number {I} 1 design is specified by 0..* specifies design of R1 AbstractConcrete design characteristics, references to sub-specifications or other related specifications characteristics that vary from widget to widget, even when the widgets are defined by the same widget specification Will rarely need a state model to define its behaviour Will normally need a state model to define its behaviour

Executable UML Interaction Classes Passenger Name Phone number Flight Number {I} Airline {I} Departure date Departure time Departure airport Arrival date Arrival time Arrival airport 0..* is reserved for 0..* reserves R1 Seat Assignment ??

Executable UML Interaction Classes Passenger Name Phone number Flight Number {I} Airline {I} Departure date Departure time Departure airport Arrival date Arrival time Arrival airport 0..* is reserved for 0..* reserves R1 Reservation Ticket number {I} Airline {I, R1} Cost Class Seat assignment

Executable UML Role Classes WaferInspection Station 0..* contains 0..1 is loaded into R1 Wafer in Process Allignment Temperature Percent scan complete 0..1 directs scanning of 0..1 is scanned according to R2 Inspection Script Area to cover Scan method Delete once Wafer has been unloaded from the Inspection Station

Executable UML Relative Roles Front SideBack Side APPLICATION NOTE: The flat shape can rotate in 3D space and must have exactly one bitmap image on each of its two sides

Executable UML Multiplicity v Remember, an important characteristic of an association is the number of instances (objects) that participate in each instance of the domain relationship v UML allows specific numbers in a multiplicity relation v In xUML the recommendation is to only use four kinds:  unconditional;1, or 1..*  conditional;0..1, or 0..*

Executable UML Relative Roles Flat ShapeSide 1 can be shown by 1..* can show R1 Colour Texture The arguments for making this multiplicity “2” seem compelling, but can we work within our modelling guidelines?

Executable UML Two 1:1 associations? Flat Shape Side 1 is front of 1 has front R1 Colour Texture 1 is back of 1 has back R2 But a Side is either the Front or the Back of a Flat Shape, not both!

Executable UML Two 1:1 associations? Flat Shape Side 1 is front of 1 has front R1 Colour Texture 1 is back of 1 has back R2 But a Side is either the Front or the Back of a Flat Shape, not both!

Executable UML Two conditional associations? Flat Shape Side 0..1 is front of 1 has front R1 Colour Texture 0..1 is back of 1 has back R2 But this says that a Side might exist that does not belong to any Flat Shape!

Executable UML Two conditional associations? Flat Shape Side 0..1 is front of 1 has front R1 Colour Texture 0..1 is back of 1 has back R2 But this says that a Side might exist that does not belong to any Flat Shape!

Executable UML How about making the Sides attributes? Flat Shape Front colour Front texture Back colour Back texture Bitmap Image ? But we need to model the association between a Bitmap Image and a specific Side!

Executable UML Solution: Abstract Positional roles as Classes Side Colour Texture 0..* is drawn on 1 has drawn R1 Bitmap Image Front SideBack Side R4 Flat Shape has on front 1 is front of 1 has on back 1 is back of 1 R2R3 N.B. We have worked within our modelling goals and produced a better model!

Executable UML What is an Attribute? “A quality or characteristic inherent in or ascribed to someone or something” The American Heritage Dictionary of the English Language Star SAO Number {I} Name Diameter Mass Distance Alpha Centauri 1.26 M km 1.1 x Sun 4.3 ly Sirius 4.9 M km 3 x Sun 8.7 ly Two instances of Star Attributes: Prototypical characteristics Attribute Values: Characteristics of a specific instance

Executable UML Properties of Attributes v Purpose v Identification role v Dependency on other attributes v Value assignment v Universal meaning

Executable UML Purpose v Here the attribute either names or describes a class instance v Descriptive attributes  Size, Capacity, Colour, Stall speed v Naming attributes  Discovered names - Company name, Floor number, Driver’s licence number  Invented names - Pump ID, Transaction ID, Event ID  Using “ID” as a suffix makes it clear these names are the invention of an analyst

Executable UML Identification role v Every instance of a class is unique v Consequently, each object must have an attribute whose value can unambiguously identify that object v If an attribute is marked as an identifier, then it is constrained to have distinct values for each instance v In xUML there are three kinds of identifier  implicit identifiers  single-attribute identifiers  compound identifiers

Executable UML Implicit identifier location = right zoom = 2 location = centre zoom = 1 location = left zoom = 1.5 IDLocationZoom CAM_1right2 CAM_2centre1 CAM_3left1.5 Camera ID {I} Location Zoom

Executable UML Implicit identifier location = right zoom = 2 location = centre zoom = 1 location = left zoom = 1.5 IDLocationZoom CAM_1right2 CAM_2centre1 CAM_3left1.5 Camera ID {I} Location Zoom But this identifier is not adding anything to the model other than guaranteeing uniqueness

Executable UML Implicit identifier location = right zoom = 2 location = centre zoom = 1 location = left zoom = 1.5 LocationZoom right2 centre1 left1.5 Camera Location Zoom We can rely on an implicit identifier in this case to guarantee uniqueness

Executable UML Implicit vs. Explicit Identifiers v In the preceding example we were only interested in the service each camera performed in a studio  We don’t actually care which precise physical camera maps onto the class instances so long as the attribute values are correct v But sometimes we may need to model a real- world identification scheme  SAO Number, Aircraft registration, Flight number v In these cases we use an explicit identifier  may consist of single or multiple attributes

Executable UML Single explicit identifier Star SAO Number {I} Name Diameter Mass Distance Alpha Centauri 1.26 M km 1.1 x Sun 4.3 ly Sirius 4.9 M km 3 x Sun 8.7 ly Two instances of Star In contrast to implicit identifiers, typically the values of explicit identifiers will not be assigned by the model compiler

Executable UML Compound identifiers StateLicense Number ColourYearMakeModel CA12345pink1960CadillacEldorado CA65432purple1964ACCobra CO12345orange1972VWBeetle Licensed Vehicle State {I} License number {I} Colour Make Model These two attributes together mark a single identifier (State + License number)

Executable UML Referential attributes DirectionSideLengthGrade 13Single5000 ftGravel 27Left7000 ftPaved 27Right7000 ftPaved Runway Direction {I} Side {I} Length Grade But we could have two runways with the same value for (Direction + Side) at different airports

Executable UML Referential attributes Runway Direction {I} Side {I} Airport {I, R1} Length Grade Airport Code {I} Current visibility 1 is located at 1..* is location of R1 Refers to identifier of the associated Airport class (the renaming is legal)

Executable UML Summary v We have illustrated some good practice in developing class models and their associated attributes v Next time we will look at the remaining properties of attributes:  Dependency on other attributes  Value assignment  Universal meaning  Origin v Read Chapter 5 of Mellor and Balcer  also Chapters 1 & 2 of Starr