Database Design – Lecture 12 Object Oriented Database Design cont’d.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Chapter 14 (Web): Object-Oriented Data Modeling
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
Object-Oriented Databases
IMSE 11 - UML Class Diagrams
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Chapter 14: Object-Oriented Data Modeling
1 ODB Design: Handling Associations and Inheritance in ODL M. Akhtar Ali School of Informatics.
Object-Oriented Analysis and Design
Extending ER Diagrams (13) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems: A Practical Approach to Design, Information.
OBJECT ORIENTED PROGRAMMING LECTURE 12 Instructor: Rashi Garg Coordinator: Gaurav Saxena.
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.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
R McFadyen Chapter 7 Conceptual Data Modeling.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Lab 04.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
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.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
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.
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.
1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.
What is a Structural Model?
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.
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
Static Modeling Chapter 8 Part of Requirements Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Topics Inheritance introduction
Basic ER modeling was adequate for simpler databases, but in the 1980’s more demanding databases required more extensive modeling requirements. Some such.
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.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
Database Design – Lecture 14 Converting an OO Data Model to a Class Diagram.
Object-Level Sequence Diagrams with Composition Relationships.
PRJ566 : Project Planning and Management Converting Class Diagram to Relational Schema.
Unified Modeling Language (UML)
Object-Oriented Modeling
Lec-4 : Unified Modeling Language (UML)
EER Model – Chapter
OBJECT ORIENTED CONCEPT
Visit for more Learning Resources
Object-Oriented Analysis and Design
EKT472: Object Oriented Programming
Class diagram Description
OBJECT RELATIONSHIPS, ATTRIBUTES, AND METHODS
Object Oriented Analysis and Design
Domain Class Diagram Chapter 4 Part 2 pp
Engineering Quality Software
Software Engineering Lecture #11.
Software Engineering Lecture 10.
ITEC 3220A Using and Designing Database Systems
Object Oriented Analysis and Design
Object Oriented System Design Class Diagrams
Presentation transcript:

Database Design – Lecture 12 Object Oriented Database Design cont’d

2 Lecture Objectives Class Review Relationships Associations Aggregation/Composition Inheritance

3 Classes ClassName attributes operations() Structure: Attribute names start with a small capital. If an attribute name is made up of multiple words, there is no space between the words and each subsequent word begins with a capital letter Operation names start with a small capital. If an operation name is made up of multiple words, there is no space between the words and each subsequent word begins with a capital letter

4 Classes Class Example Employee name ADDRESS dob telephone DEPENDENT BENEFICIARY Address streetNumber street city province postalCode EMPLOYEE Denotes another abstract data Type (ADT); or another class Dependent name Dob EMPLOYEE Beneficiary name Relationship EMPLOYEE

5 Classes Class Example (different notation) Employee name address dob telephone dependents beneficiary Address streetNumber street city province postalCode Denotes another abstract data Type (ADT); or another class Dependent name dob Beneficiary name relationship employee

6 Lecture Objectives Classes Relationships Associations Aggregation/Composition Inheritance

7 Relationships 1:1 I.e. An employee has 1 address and an address belongs to 1 employee Address streetNumber street city province postalCode employee 1 Employee name address 1 dob telephone dependent beneficiary Denotes a mandatory participation

8 Relationships 1:M I.e. An employee has 0 or more dependents and a dependent belongs to 1 employee Employee name address 1 dob telephone dependent M beneficiary (no line) denotes an optional participation Dependent name dob employee 1

9 Relationships M:N (option 1) I.e. An employee has 1 or more beneficiaries and a beneficiary belongs to 1 or more employees employee M Beneficiary name percent relationship Employee name address 1 dob telephone dependent M beneficiary M

10 Relationships M:N (option 2) I.e. An employee has 1 or more beneficiaries and a beneficiary belongs to 1 or more employees Create an intersection class with associated attributes employeeBeneficiary M Beneficiary name Employee name address 1 dob telephone dependent M employeeBeneficiary M employee 1 EmployeeBeneficiary percent relationship beneficiary 1

11 Relationships – two notations Employee name address 1 dob telephone dependent M beneficiary M Dependent name dob employee 1 employee M Beneficiary name percent relationship Note how we can show M:N relationship in OODM

12 Lecture Objectives Classes Relationships Associations Aggregation/Composition Inheritance

13 Associations An association between two classes indicates the possibility that links will exist between the objects of the classes The links provide the ability for message passing to happen Links can be uni-directional or bi-directional associations as well as more complex type links such as aggregation/composition – need to clearly understand the navigability of the association Links also show multiplicity (1:1; 1:M; M:N)

14 Associations 1:1 Can be bi-directional or uni-directional which shows the direction a message can be sent Bi-directional – message goes in both directions Address streetNumber street city province postalCode employee 1 Employee name dob address Lives at Bi-directional; message goes in both directions

15 Associations 1:1 Uni-directional – message goes in direction of arrow only Note there is no reference to the Employee class in the Address class Address streetNumber street city province postalCode Employee name dob address 1 1Lives at Uni-directional; message goes in one direction only **Note there is no reference to employee abstract data type (ADT) in the Address class

16 Associations 1:M Can be bi-directional or uni-directional What would change if we made it a uni-directional association? Employee name address 1 dob telephone dependent M beneficiary Dependent name dob employee n Can have

17 Associations 1:M Can be bi-directional or uni-directional What would change if we made it a uni-directional association? – see below Employee name address 1 dob telephone dependent M beneficiary Dependent name dob employee 1 0..n Can have **Note there would be no reference to employee abstract data type (ADT) in the Dependent class

18 Associations M:N Can be bi-directional or uni-directional What would change if we made it a bi-directional association? Employee name address 1 dob telephone dependent M beneficiary M Beneficiary name relationship 1..n Can have

19 Associations M:N Can be bi-directional or uni-directional What would change if we made it a bi-directional association? – see below Employee name address 1 dob telephone dependent M beneficiary M Beneficiary name relationship employee M 1..n Can have **Note a reference to employee abstract data class would be added

20 Lecture Objectives Classes Relationships Associations Aggregation/Composition Inheritance

21 Aggregation/Composition A special kind of association. A whole (assembly) –part (components) relationship An instance of one class may consist of, or include instances of another class. The aggregate class assumes a special role for delegation of responsibility and leadership The number of ‘parts’ are shown by multiplicity Aggregations are usually 1-to-many (aggregate to components) but not always

22 Aggregation/Composition A “has a” or “consists of” relationship A Book contains Chapters Book Chapter contains Aggregate or whole Components or part Diamond symbol denotes an aggregation

23 Aggregation/Composition Example : An invoice has invoice items A car has tires A company has contacts

24 Aggregation/Composition Composition is a special kind of aggregation. The component parts depend on the aggregate for existence—delete the aggregate and the components disappear BookChapter contains Aggregate or whole Component or part Filled in diamond symbol denotes a composition

25 Aggregation vs Association Which of these are composition? An invoice has invoice items A car has tires A company has contacts

26 Aggregation vs Association Show compositions in OODM only – aggregations can be shown as associations only If you are not clear on the relationship between two classes, assume it is only an association – do not assume it has to be aggregation, composition or inheritance!

27 Lecture Objectives Classes Relationships Assoications Aggregation/Composition Inheritance

28 Inheritance Classes are organized into a hierarchy Hierarchy equates to inheritance Inheritance allows an object to inherit the data structure and behavior of the classes above it In OO systems, all objects are derived from the super class Object or the Root class

29 Inheritance Single Inheritance (~Hierarchical Structure) A class has only one immediate (parent) superclass above it

30 Inheritance Multiple Inheritance (~Network Structure) A class has more than one immediate (parent) superclass above it

31 Inheritance Defining Inheritance Two approaches: Generalization Look for common attributes and operations in a set of classes and create a new superclass and place the common attributes and operations into the superclass Specialization Create two or more subclasses to associate attributes and methods to

32 Inheritance Defining Inheritance Generalization Look for common attributes and operations in a set of classes and create a new superclass and place the common attributes and operations into the superclass Two classes that share common attributes and operations  create a new class called StaffMember and move common attributes and operations to new superclass

33 Inheritance Generalization

34 Inheritance Defining Inheritance Specialization One class  however, it may be determined that there are different types of staff members resulting in the creation of some sub classes

35 Inheritance Defining Inheritance Specialization