The OO Solution. Objects

Similar documents
Sommerville Chapter 7 Fowler Chapters 1, 3, 5, and 6. Conceptual Modeling and Class Diagrams

Lecture 13: Analysis Modeling

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Chapter 2: Entity-Relationship Model

COMP Instructor: Dimitris Papadias WWW page:

From Analysis to Design. LTOOD/OOAD Verified Software Systems

UML: Unified Modeling Language

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

Object-Oriented Analysis and Design

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

Entity Relationship Data Model. Slides by: Shree Jaswal


S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Model Driven Development Unified Modeling Language (UML)

CSCI315 Database Design and Implementation Singapore Assignment 2 11 January 2018

Chapter 6: Entity-Relationship Model

Object-Oriented Introduction

Course 3 7 March

UML Is Not a Methodology

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D

High Level Database Models

Represent entities and relations with diagrams

Chapter 6: Entity-Relationship Model

Object-Oriented Software Engineering Practical Software Development using UML and Java

Database Systems ER Model. A.R. Hurson 323 CS Building

The Entity-Relationship (ER) Model 2

Data Modeling Using the Entity-Relationship (ER) Model

CMPT 354 Database Systems I

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

Chapter 6: Entity-Relationship Model

OBJECT ORIENTED MODELLING & DESIGN 1

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček

Class Diagrams in Analysis

Definition. 02. Data Modeling. Example ABC Company Database. Data Modeling Importance

Object Oriented Software Development CIS Today: Object Oriented Analysis

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model

CSIT5300: Advanced Database Systems

Data Modeling Using the Entity-Relationship Model

Database Applications (15-415)

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Database Design Process

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Chapter 2. Database Design. Database Systems p. 25/540

Object Oriented Analysis and Design: An Overview

Prepared By:Mitali sonar

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Conceptual Data Modeling

IMS1002/CSE1205 Lectures 1

Conceptual Data Models for Database Design

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Object-Oriented Systems Development: Using the Unified Modeling Language

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

An Introduction To Object Modeling System Concept for Object Modeling The Overall View Components of UML Diagram

Object Oriented Modeling

CH3. Class Modeling Tae-Hoon Song. Michael Blaha, James Rumbaugh Object-Oriented Modeling and Design with UML SE LAB KAIST

Overview of db design Requirement analysis Data to be stored Applications to be built Operations (most frequent) subject to performance requirement

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

Lecture 1. Abstraction

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Chapter 8: Enhanced ER Model

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity Sets Extended E-R Features Design of the Bank Database Reduction to

CASE TOOLS LAB VIVA QUESTION

UML big picture. Perdita Stevens. School of Informatics University of Edinburgh

Suggested answers are provided below. These answers are presented top-down, left to right.

Contents Contents 1 Introduction Entity Types... 37

Database Management System. Fundamental Database Concepts

CSE 530A. ER Model. Washington University Fall 2013

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

Computer Science for Engineers

Intro to DB CHAPTER 6

Chapter 5: Structural Modeling

SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

SQL DDL. CS3 Database Systems Weeks 4-5 SQL DDL Database design. Key Constraints. Inclusion Constraints

Object-Oriented Systems Development: Using the Unified Modeling Language

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD: ,

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 5: Modelling with Classes

Object-Oriented Analysis and Design. Pre-UML Situation. The Unified Modeling Language. Unification Efforts

Sahaj Computer Solutions. Data Modeling using the Entity Relationship Model

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

MIS Database Systems Entity-Relationship Model.

UNIT-I. Introduction:

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

Database Design with Entity Relationship Model

Overview of Database Design Process. Data Modeling Using the Entity- Relationship (ER) Model. Two main activities:

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Enhanced Entity-Relationship (EER) Modeling

II. Data Models. Importance of Data Models. Entity Set (and its attributes) Data Modeling and Data Models. Data Model Basic Building Blocks

Transcription:

C870: Cheng 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 C870: UML Classes 1 Objects State of Michigan Drivers License J. Q. Public A-123456 03-12-63 VISA J. Q. Public 123 4567 887766 998 C870: UML Classes C870: Advanced Software Engineering (Cheng) 2 1

C870: Cheng objects State of Michigan Drivers License J. Q. Public A-123456 03-12-63 Attributes and Operations Card objects VISA abstracts to J. Q. Public 123 4567 887766 998 class Attributes age height weight Operations move change-job Card class Attributes height width id-number Operations issue change C870: UML Classes 3 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 C870: UML Classes 4 C870: Advanced Software Engineering (Cheng) 2

C870: Cheng The Class Diagrams C870: UML Classes 5 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 Drivers license C870: UML Classes 6 C870: Advanced Software Engineering (Cheng) 3

C870: Cheng Classes Describes a group of objects with: similar properties (attributes), common behavior (operations), common relationships to other classes, and common semantics J. Q. Public Joe Smith D. Q. Public Card Credit card Drivers license Teller card C870: UML Classes 7 Class Diagrams Class diagram Instance diagram D. Q. Public: J. Q. Public: age: integer age= 32 age= 35 Class with attributes Objects with values Objects have an identity Do not explicitly list object identifiers SSN OK! C870: UML Classes 8 C870: Advanced Software Engineering (Cheng) 4

C870: Cheng Examples C870: UML Classes 9 Operations and Methods Transformation that can be applied to or performed by an object May have arguments C870: UML Classes C870: Advanced Software Engineering (Cheng) 10 5

C870: Cheng Object Notation - Summary C870: UML Classes 11 Associations Conceptual connection between classes A credit card is issued-by a bank A person works-for a company Credit Card Issued-by Works-for J.Q. Public: Age=35 Bank Class diagrams Company Michigan State Univ: Works-for Company C870: UML Classes C870: Advanced Software Engineering (Cheng) Instance diagram 12 6

C870: Cheng Associations are Bi-directional There is no direction implied in an association (Rumbaugh - OMT) Country Has-capital City Is-issued Drivers-license lic.-number: integer C870: UML Classes 13 Associations Can Have Direction Unified adds a direction indicator Inconsistently used Country Has-capital City Is-issued Drivers-license lic.-number: integer C870: UML Classes 14 C870: Advanced Software Engineering (Cheng) 7

C870: Cheng Multiplicity One person holds one credit card Holds Credit-card card-number: integer One object can be related to many objects through the same association One person can hold zero or more credit cards Holds Credit-card card-number: integer C870: UML Classes 15 Multiplicity (Cont.) One person can hold zero or more credit cards () Each card has zero or one holder (0..1) age: integer 0..1 Holds Credit-card card-number: integer :JQPublic: = J. Q. Public age=35 Holds Holds Card789:Credit-Card card-number= 123 456 789 Card123:Credit-Card card-number= 111 222 333 :DQPublic: = D. Q. Public age=32 Card456:Credit-Card card-number= 444 555 666 C870: UML Classes 16 C870: Advanced Software Engineering (Cheng) 8

C870: Cheng Higher order associations Ternary association Project, language, person Seldom needed (and should be avoided) Language 1..* 1..* 1..* Project C++ :Language Compiler: Project Instance of ternary association J. Q. Public: Age=35 LISP:Language TicTacToe:Project C870: UML Classes 18 Link Attributes Associations can have properties the same way objects have properties age: integer SSN: integer Works-for Company How to represent salary and job title? age: integer SSN: integer Works-for Company Use a link attribute! salary: integer job-title: String C870: UML Classes 19 C870: Advanced Software Engineering (Cheng) 9

C870: Cheng Folding Link Attributes Why not this? age: integer SSN: integer salary: integer job-title: String Works-for Company Salary and job title are properties of the job not the person age: integer SSN: integer Works-for salary: integer job-title: String Company In this case, a link attribute is the only solution C870: UML Classes 20 Role Names Attach s to the ends of an association to clarify its meaning boss 0..1 Manages age: integer SSN: integer worker Works-for employee salary: integer job-title: String employer Company C870: UML Classes 21 C870: Advanced Software Engineering (Cheng) 10

C870: Cheng 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) Document Paragraph Sentence Aggregation symbol C870: UML Classes 22 Aggregation (Cont.) Often used in parts explosion Car 4 Wheel Body Gearbox Engine 1..* 1..* Door Hood Trunk Piston Valve Crankshaft C870: UML Classes 23 C870: Advanced Software Engineering (Cheng) 11

C870: Cheng Generalization and Inheritance The is-a association Card 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) Drivers License class: vehicle issued: date expires: date height: integer width: integer thickness: integer id-number: integer issue() revoke() ID Card issued: date expires: date expire() Credit Card credit-limit: integer issued: date validate() expire() C870: UML Classes 24 Example Owns City Based-In Airline Works-for Pilot license Located-In Offers Pilots 1..* Certified-On Airport heat() clean() Departs Arrives Flight date flight # cancel() delay() Used-For Plane model serial # hours flown heat() refuel() clean() 3 Passenger Confirmed-for Seat location reserve() C870: UML Classes 25 C870: Advanced Software Engineering (Cheng) 12

C870: Cheng 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 Company Division Department Works-for C870: UML Classes 26 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 Car Minivan Compact Jeep Roll Bar 4 Wheel Body Gearbox Engine C870: UML Classes 27 C870: Advanced Software Engineering (Cheng) 13

C870: Cheng Recursive Aggregates A recursive aggregate contains (directly or indirectly) an instance of the same kind of aggregate Program Block Compound Statement Simple Statement C870: UML Classes 28 Class diagram Metamodel I Eclipse.org C 435: Software Engineering C870: Advanced Software Engineering (Cheng) 14

C870: Cheng Class diagram Metamodel II Science direct C 435: Software Engineering Use Case Metamodel I uu: use case association relationship _i: includes _e: extends _g: generalization aa: actor relationship Image: Science Direct: ``Visual Modeling for Software Intensive Systems, Kooper et al, 2006. C 435: Software Engineering C870: Advanced Software Engineering (Cheng) 15

C870: Cheng Use Case Metamodel II C 435: Software Engineering Image: Jot.fm Meta Model Architecture M3 M2 M3: language for describing meta-models (MOF: Meta Object Facility) M2: meta model for a given modeling language M1 M1: class diagram M0 M0: instance of class diagram C870: UML Classes 34 C870: Advanced Software Engineering (Cheng) 16

C870: Cheng Interesting/Fun Metamodels Facebook: http://upload.wikimedia.org/wikipedia/co mmons/c/c6/facebook_metamodel_re presented_in_uml_notation_v01.jpg C870: UML Classes 35 C870: UML Classes 36 C870: Advanced Software Engineering (Cheng) 17

C870: Cheng Object Modeling Summary Classes Name Attributes Operations Associations Roles Link attributes Aggregation Inheritance C870: UML Classes 37 C870: Advanced Software Engineering (Cheng) 18