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.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Conceptual Data Modeling: ER
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Class Diagram & Object Diagram
Chapter Assistance -- Lamimi V. Kamat February 14, 1999 R. A. Volz1 OBJECT ORIENTED MODELING, CONCEPTS AND PRINCIPLES Chapter 20.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Classes Chapter 4. Terms and Concepts A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.
UML class diagrams (1) UML = Unified Modeling Language We use only class diagrams, not other UML diagrams Purpose: –keep OO concepts separate from implementation.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Conceptual Modeling A Short Discussion. Outline Conceptual modeling The goal of conceptual modeling The OO solution The object model (conceptual) Syntax.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
The Entity-Relationship Model. 421B: Database Systems - ER Model 2 Overview of Database Design q Conceptual Design -- A first model of the real world.
Introduction To System Analysis and design
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
the Entity-Relationship Model
Executable UML The Models are the Code - Executable UML Lecture 4 - How to Build Class Models Paul Krause.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
UML Class Diagrams: Basic Concepts
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.
Database. Basic Definitions Database: A collection of related data. Database Management System (DBMS): A software package/ system to facilitate the creation.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Class Modeling. Basic Class Modeling Concepts Object Class Link Association Generalization Inheritance.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Object Modeling (1) Chapter 3 (1) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
Object Modeling (2) Chapter 3 (2) Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
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.
The OO Solution The OO model closely resembles the problem domain
Class Diagram Classes are the most important building block of any object-oriented system. A class is a description of a set of objects that share the.
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Design Model Lecture p6 T120B pavasario sem.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
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.
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Lecture # 16 July 26,2012 Data Modeling using the Entity Relationship.
Data Modeling Using the Entity- Relationship (ER) Model
Databases (CS507) CHAPTER 7.
Data Modeling Using the Entity- Relationship (ER) Model
Unified Modeling Language (UML)
Business System Development
Visit for more Learning Resources
Entity-Relationship Model
The OO Solution The OO model closely resembles the problem domain
Analysis and Design with UML: Discovering Classes and Relationships
Analysis and Design with UML: Discovering Classes and Relationships
The OO Solution The OO model closely resembles the problem domain
UML Class Diagrams: Basic Concepts
Analysis and Design with UML: Discovering Classes and Relationships
UML Class Diagram.
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Analysis and Design with UML: Classes and Relationships
Cheng (Sp2001): Object-Oriented Development Overview
From Class Diagram to Contract Diagram
Presentation transcript:

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 refine the high-level model until you have an implementation –Attempt to avoid big conceptual jumps during the development process

2 CSE491-RE: UML Classes J. Q. Public VISA J. Q. Public Drivers License State of Michigan A Objects

Person class J. Q. Public VISA J. Q. Public Drivers License State of Michigan A Attributes name age height weight Operations move change-job Attributes height width id-number Operations issue change Person objects Card objectsCard class abstracts to Attributes and Operations

4 CSE491-RE: UML Classes Characteristics of Objects Identity –Discrete and distinguishable entities Classification –Abstract entities with the same structure (attributes) and behavior (operations) into classes Polymorphism –The same operation may behave differently on different classes Inheritance –Sharing of attributes and operations based on a hierarchical relationship

5 CSE491-RE: UML Classes The Class Diagrams

6 CSE491-RE: UML Classes Objects Something that makes sense in the application context (application domain) –J.Q. Public –Joe’s Homework Assignment 1 –J. Q. Public’s drivers license All objects have identity and are distinguishable NOT objects –Person –Drivers license

7 CSE491-RE: UML Classes Classes Describes a group of objects with similar properties (attributes), common behavior (operations), common relationships to other classes, and common semantics Person J. Q. Public Joe Smith D. Q. Public –Card Credit card Drivers license Teller card

8 CSE491-RE: UML Classes Class with attributesObjects with values Objects have an identity Do not explicitly list object identifiers SSN OK! Class diagram Instance diagram age: integer Person Class Diagrams D. Q. Public: age= 32 Person J. Q. Public: age= 35 Person

9 CSE491-RE: UML Classes Examples

10 CSE491-RE: UML Classes Operations and Methods Transformation that can be applied to or performed by an object May have arguments

11 CSE491-RE: UML Classes Object Notation - Summary

12 CSE491-RE: UML Classes Associations Conceptual connection between classes –A credit card is issued-by a bank –A person works-for a company J.Q. Public: Age=35 Person Michigan State Univ: Company Works-for Class diagrams Instance diagram Credit CardBank Issued-by PersonCompany Works-for

13 CSE491-RE: UML Classes Associations are Bi-directional There is no direction implied in an association (Rumbaugh - OMT) Country name Drivers-license lic.-number: integer Person name City name Has-capital Is-issued

14 CSE491-RE: UML Classes Associations Have Direction Unified adds a direction indicator –Inconsistently used Country name Drivers-license lic.-number: integer Person name City name Has-capital Is-issued

15 CSE491-RE: UML Classes Multiplicity One object can be related to many objects through the same association One person holds one credit card One person can hold zero or more credit cards (0..* stands for many) name: String Person card-number: integer Credit-card Holds name: String Person card-number: integer Credit-card Holds 0..*

16 CSE491-RE: UML Classes One person can hold zero or more credit cards (0..*) Each card has zero or one holder (0..1) Holds name: String age: integer Person card-number: integer Credit-card Holds 0..*0..1 Multiplicity (Cont.) :JQPublic:Person name= J. Q. Public age=35 :DQPublic:Person name= D. Q. Public age=32 card-number= Card789:Credit-Card card-number= Card123:Credit-Card card-number= Card456:Credit-Card

17 CSE491-RE: UML Classes J. Q. Public:Person Age=35 Compiler: Project C++ :Language TicTacToe:Project LISP:Language Higher order associations Ternary association –Project, language, person Seldom needed (and should be avoided) Note: hexagons should be rectangles to represent instances

18 CSE491-RE: UML Classes How to represent salary and job title? Use a link attribute! Link Attributes Associations can have properties the same way objects have properties

19 CSE491-RE: UML Classes Folding Link Attributes Why not this? Salary and job title are properties of the job not the person In this case, a link attribute is the only solution name: String age: integer SSN: integer address: String salary: integer job-title: String Person name: String address: String Company Works-for 0..* name: String age: integer SSN: integer address: String Person name: String address: String Company Works-for 0..* salary: integer job-title: String 0..*

20 CSE491-RE: UML Classes Role Names Attach names to the ends of an association to clarify its meaning name: String age: integer SSN: integer address: String Person name: String address: String Company Works-for 0..* salary: integer job-title: String employeremployee boss worker Manages 0..* 0..1

21 CSE491-RE: UML Classes Aggregation symbol Aggregation A special association, the is-part-of association –A sentence is part of a paragraph (a paragraph consists of sentences) –A paragraph is part of a document (a document consists of paragraphs)

22 CSE491-RE: UML Classes Aggregation (Cont.) Often used in parts explosion

23 CSE491-RE: UML Classes Generalization and Inheritance The is-a association –Cards have many properties in common –Generalize the common properties to a separate class, the base-card –Let all cards inherit from this class, all cards is-a base-card (plus possibly something more) issue() revoke() height: integer width: integer thickness: integer id-number: integer Card expire() class: vehicle issued: date expires: date Drivers License expire() issued: date expires: date ID Card validate() credit-limit: integer issued: date Credit Card

name City name Airline name license Pilot name Passenger heat() clean() name Airport cancel() delay() date flight # Flight heat() refuel() clean() model serial # hours flown Plane reserve() location Seat Based-In 0..* Departs Works-for Arrives Used-For Certified-On Owns Located-In 0..* Offers Pilots Confirmed-for 0..* 1..* 0..* 30..* Example

25 CSE491-RE: UML Classes CompanyDepartmentDivision Person 0..* Works-for 0..* Aggregation Versus Association Can you use the phrase is-part-of or is-made-of Are operations automatically applied to the parts (for example, move) - aggregation Not clear what it should be……

26 CSE491-RE: UML Classes Car Wheel Body Gearbox Engine 4 Minivan Compact Jeep Roll Bar Aggregation Versus Inheritance Do not confuse the is-a relation (inheritance) with the is-part-of relation (aggregation) Use inheritance for special cases of a general concept Use aggregation for parts explosion

27 CSE491-RE: UML Classes Recursive Aggregates A recursive aggregate contains (directly or indirectly) an instance of the same kind of aggregate Example of metamodel Program Simple Statement Compound Statement Block 0..*

28 CSE491-RE: UML Classes Object Modeling Summary Classes –Name –Attributes –Operations Associations –Roles –Link attributes Aggregation Inheritance