Today in OOAD  The Domain Model Artifact UML Classes  EU-Bid Domain Model Exercise  EU-Lease Domain Model Assignment Guest Speaker  Kate Cunningham,

Slides:



Advertisements
Similar presentations
Object-oriented modeling Class/Object Diagrams
Advertisements

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.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Object-Oriented Analysis and Design
UML – Class Diagrams.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
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.
Chapter 14 (Web): Object-Oriented Data Modeling
Class Diagram & Object Diagram
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Chapter 14: Object-Oriented Data Modeling
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Object-Oriented Analysis and Design
Chapter 13 (Online): Object-Oriented Databases
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1 System models l Abstract descriptions of systems whose requirements are being.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Page 1  Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling captures essential parts of.
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
Engineering 5895: Software Design 9/11/01Class Diagrams 1.
Database Development Supertype, Subtype, and Business Rules Powered by DeSiaMore 1.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Lecture 6: Structural Modeling
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
1 The Unified Modeling Language. 2 The Unified Modeling Language (UML) is a standard language for writing software blueprints. The UML may be used to.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Object-Oriented Data Modeling
Design Model Lecture p6 T120B pavasario sem.
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.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
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.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 April 13, 2005.
Modeling data in the Organization
Object-Oriented Modeling
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Entity-Relationship Model
Introduction to Unified Modeling Language (UML)
OO Domain Modeling With UML Class Diagrams and CRC Cards
Today’s Objectives Define the Problem Domain
UML Class Diagrams: Basic Concepts
Lec 3: Object-Oriented Data Modeling
Object Oriented Analysis and Design Using the UML
UML Class Diagram.
Understand and Use Object Oriented Methods
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
Presentation transcript:

Today in OOAD  The Domain Model Artifact UML Classes  EU-Bid Domain Model Exercise  EU-Lease Domain Model Assignment Guest Speaker  Kate Cunningham, Flexcar

Entity Class terminology  name from the glossary entry  attributes 'nominal' at first  operations later  not shown graphically  definition recorded in the Glossary  rules constraints (aka "business rules)

 the data contained in an object of the class A student ‘knows’ its name A course ‘knows’ how many students it can hold A person ‘knows’ his or her date of birth What are some attributes for EU-Bid and EU-Lease classes? What about class variables? The Domain Model ~ Attributes

The following things can be specified about an attribute:  name – noun or noun phrase (documented in the Glossary)  multiplicity o typically only 1 (“mandatory”) or 0..1 (“optional”)  initial value – is there a system-supplied value at birth?  changeability – is the value: changeable, frozen, or addOnly?  visibility – (same as for operations) encapsulation Implementation perspective: Attribute values are considered hidden; an attribute’s value must be requested. Specification perspective: We will treat all attributes as visible (“public” with an assumed accessor operation).  type – datatype (we will define this later) Attribute properties

The Domain Model ~ Associations  Next, show where one entity has to know about another entity….  Relationship Association Generalization Aggregation rents Are we taking a static or dynamic view? Does an attribute of Customer contain a Vehicle object (or collection of Vehicle objects)? What about navigability? What are the advantages and disadvantages of deciding about navigability at this stage?

informal definition: An association is the shared knowledge that classes have about their long-lasting connections. example: A customer “knows” its accounts. An course “knows” its enrolled-students. An order “knows” its order-lines. UML definitions: An association is the representation of a set of links between objects (instances of classes). A link is an instance of an association. The Domain Model ~ Associations

 Each association has 2 * participating classes. These are the classes at each end of an association line.  Each participating class is said to "play a role" in the association. Each role represents one "direction" in the association.  Multiplicities – How many objects may participate in the given relationship. An exact number, e.g., 27 A range of numbers 0..1, or 1, or …. An arbitrary, unspecified number * * Associations that: involve more than 2 classes, have their own properties, or are promoted to full class status (“reified”) are “advanced concepts” and not covered here. The Domain Model ~ Association Roles

The Domain Model ~ Associations & Association Role properties

Consider the problem of keeping track of courses and specific offerings at a BrandX university. Professors must be assigned to teach courses, students must register for courses, and professors receive rosters for each course they teach.  Working with the person next to you, draw a simple class model for this system. Note: the entities of interest in this system some relationships between entities some attributes for each entity some interesting behavior for each entity Example Domain Model – A university registration system

The following things can be specified about each role in an association:  role name  verb phrase  multiplicity  navigability  changeability The Domain Model ~ Association Role properties

 Each role can be given an explicit name (a "rolename"). example: An employee plays the role of “sales rep” to a customer.  The default rolename is the class name. example: An order is placed by a customer. o Here, “customer” is both the class name and the rolename. Association Role properties ~ rolename

 An explicit rolename is usually optional – used only when it adds clarity to a class’ participation in an association. as in the examples just given  BUT...  Sometimes a rolename is required. example: A flight segment involves two cities – a departure city and an arrival city. Here, at least one association end requires a rolename. Association Role properties ~ rolename

 various labeling schemes: verb-phrase (natural language sentence style) gerund (applying to the association as a whole)  useful as an aid in communication between analysts and with users.  optional in the UML Association Role properties ~ verb phrase

Each association role also has multiplicity.  Multiplicity specifies "how many?" objects of a class may participate in a given link. It indicates both a lower and an upper bound for the number of participating objects.  notation – an annotation next to the class at the far end of the association line. default is the range 0..infinity o or shorthand representation as simply * 0..* other commonly-used multiplicity values: o exactly one: 1 o at least one: 1.. * o at most one: 0..1 o explicit range (e.g., between 2 and 4, inclusive):2..4 Association Role properties ~ multiplicity

for now, in the Domain Model we will assume each association is "navigable in both directions“ Association Role properties ~ navigability & changeability

Class model A Class Model defines the static structure of concepts, types, and classes.  concept – how users think and talk about the world ~ the semantics  type – software component interface ~ the interface  class – software component implementation ~ the realization note: in many 00 languages, the notion of ‘class’ combines both ‘interface’ & ‘implementation.’ but the distinction is important!  "Program to a class's interface (type)rather than to its implementation."

Class models & the development process 3 perspectives we can take when defining a class model:  Conceptual the terms & facts of the problem space i.e., the system glossary or domain model typically, business-focused  Specification the software, rather than the business only the software "type" (the interface)  Implementation language-specific realization the implementation – "the classes that implement the type" (or, “implement the interface”) ~ one type (interface) specification can have multiple implementations.  This course deals with the “conceptual” and “specification” perspective class models; the Java course deals with the "implementation" perspective.

Class model diagram elements Class – a description of a set of objects that share the same responsibilities (attributes, relationships, operations, rules) and semantics.  Attributes – the “value facts” the system records the “variables”  Relationships between classes – 3 types: association generalization (supertype/subtype) aggregation (“advanced”)  Operations – the behavior the "methods"  Rules – the constraints that govern both structure (relationships & attributes) and behavior (operations). Many of these elements can be shown visually as a Class Model Diagram.

Class behavior – Operations informal definition: An operation specifies what an object can “do.” – i.e., the processes a class knows how to carry out, when requested. example: An ATM machine knows how to “accept a deposit.” A reservation knows how to “close a reservation.” UML definition: An operation is the specification of a transformation or query that an object may be called on to execute.

Associations in perspective  Conceptual association = "facts" in the users' problem space facts relate concepts, applying terms to form sentences. example: “Customers place orders.” “Orders may have several order lines.”  Specification association = responsibilities an object is "responsible to know" the other objects it is associated with. example: “A customer knows the orders it has placed.” “An order knows the customer who placed the order.”  Implementation (e.g., Java) association = pointer specifications ("navigability") example:

Association properties – navigability different treatment for each perspective:  Conceptual – typically left undefined/unannotated interpretation is “not applicable”/"undecided"  Specification – directional knowledge knowledge in both directions (bi-directional) is assumed typically drawn without navigation arrowheads  Implementation – navigation arrowhead means implementation pointer  Note: bi-directional navigation implies an additional constraint  The two navigations must be inverses of each other.  This is true for all three perspectives.

Domain Model Relationships: Generalization / Specialization

Generalization / Specialization is a feature of OO languages that permits an object's class to be specified as a hierarchy (or network) of classes, ranging from more general classes to very specific classes. typically referred to as simply "generalization" also referred to as "supertype / subtype" relationships For example,  Employee a supertype  Relationship Manager and Branch Manager two, more-specialized types of Employee  Subtypes "inherit" responsibilities from the supertype. Domain Model relationships: Generalization / Specialization (cont)

 Conceptual generalization = a way of expressing "fact" hierarchies. e.g., everything we say about an Employee is also true for a Relationship Manager.  Specification generalization = the interface of a subtype must include all elements from the interface of the supertype.  the subtype's interface conforms to the supertype's interface.  the principle of ‘substitutability’ applies.  Implementation (e.g., Java) generalization = inheritance features in a programming language Generalization in perspective

Domain Model relationships: Aggregation Terminology Aggregation Examples order + order item --> product reservation + reservation detail -> reservable item Terminology Aggregation

Domain Model Diagram Elements: rule elements

definition A rule is a constraint or condition that limits or guides what an object can "know" or "do."  Many (structure) rules are expressible using the graphical language. e.g., limiting a relationship to "at most one" or an attribute value to being “mandatory.”  When you need to express a rule that the graphics don't support, state the rule in a “note” or use braces { } surrounding the rule statement. write in informal natural language, or use a formal rule language, e.g., UML's Object Constraint Language (OCL). Class responsibilities: Rules

 It is good practice to summarize the Domain Model rules and provide to the stakeholders in a form they can readily review.  Standard rules initial value rules mandatory value rules unique value rules frozen value rules at-most-one rules [associations]  Custom rules rules that are custom-written to support domain integrity requirements Class responsibilities: Rules (cont)