Mapping UML to RDB, J.P.Nytun – page 1

Slides:



Advertisements
Similar presentations
UML: The Unified Modeling Language Excertos do livro: The Unified Modelling Language User Guide by Grady Booch, James Rumbaugh and Ivar Jacobson.
Advertisements

UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Chapter 1 Object-Oriented System Development
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Lecture 11: Chapter 22 Topics –Object Oriented Modeling –UML –Use case.
Principles of Object-Oriented Software Development Unified Modeling Language.
Copyright © 2004 Pearson Education, Inc.. Chapter 12 Practical Database Design Methodology and Use of UML Diagrams.
Itntroduction to UML, page 1 Introduction to UML.
Implementation classes and developing relational databases IS Development Lecture 9.
Distribution of Marks Internal Sessional Evaluation Assignments – 10 Quizzes – 10 Class Participation Attendence – 5 Mid – Term Test – 25 External Evaluation.
UML and Object Oriented Concepts
An Introduction to Models & The UML The Unified Modeling Language Copyright © 2007 Patrick McDermott College of Alameda Not really.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
Object Oriented Design and Programming Alan Goude Room: Sheaf 9323.
Shaowen Wang CyberInfrastructure and Geospatial Information Laboratory (CIGI) Department of Geography and National Center for Supercomputing Applications.
Chapter One (Introduction) Objectives Introduction to Database Management Systems (DBMS) Relational Databases Model Restrictions of RD Database Life Cycle.
Unified Modeling Language, Version 2.0
1 Part 2: EJB Persistency Jianguo Lu. 2 Object Persistency A persistent object is one that can automatically store and retrieve itself in permanent storage.
CS-2852 Data Structures LECTURE 3B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
Objects and Classes Abstract Classes and Interface Sanjaya Karunasena
Object-Oriented Paradigm and UML1 Introduction to the Object- Oriented Paradigm.
Information Systems Engineering
Michael Schloh von Bennewitz 1. Oktober 2002 The Unified Modeling Language Overview of theory and practice of the OMG Unified Modeling.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Information Systems Analysis and Design Lesson Plan Ismiarta Aknuranda PTIIK UB Spring Semester
UML: The Unified Modeling Language Excertos do livro: The Unified Modelling Language User Guide by Grady Booch, James Rumbaugh and Ivar Jacobson.
UML Diagrams for Caradon developers Daniel DG Moth Core Development Group, Research Student University of Brighton, MSc Object Oriented Software Technology.
HIGH-LEVEL Language Revision Guide By Tom. Declarative programming The computer is given a set of facts......And a Goal This finds all members with 2G.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 1: Introduction.
MADALINA CROITORU Software Engineering week 4 Practical Madalina Croitoru IUT Montpellier.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Object Oriented Analysis and Design 1 CREATED BY RUONAN RAO Object-Oriented Analysis and Design.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Distributed Java Programming Distributed Java Programming Class #1 August 20, 2002.
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Geographic Information Systems GIS Data Databases.
Modeling with UML – Class Diagrams
New Technology: Why, What ,How
Fundamentals of Object Oriented Modeling
Embedded Systems Software Engineering
Entity- Relationship (ER) Model
Introduction to OOP and UML
Principles of GIS Fundamental database concepts – II Shaowen Wang
Object-Oriented Modeling with UML
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Object Relational DBMSs
Systems Analysis and Design With UML 2
Object-Oriented Modeling and Design
Introduction to Unified Modeling Language (UML)
James Miller, Julia John
University of Central Florida COP 3330 Object Oriented Programming
Chapter 2, Modeling with UML
CSCI-100 Introduction to Computing
SNSCT_CSE_PROGRAMMING PARADIGM_CS206
ניתוח מערכות מידע א' הרצאה 3
Introduction to Unified Modeling Language (UML)
Introduction to UML.
Database Modeling using Entity Relationship Model (E-R Model)
Looking “Behind” Some Languages - Describing with Help of UML (Many Simplifications) Jan Pettersen Nytun UiA.
And Some Of Their Elements
Behavioral Modeling with UML
Object Relational Mapping Tools
Some Data Models & Mapping to/from UML
Geographic Information Systems
Presentation transcript:

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 1 Mapping Objects to Relational Databases Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 1

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 2 Why This Mapping? Object technology, like Java, is in wide use and relational databases are the preferred approach for storage of persistent information. The relational paradigm is based on mathematical principles: Set theory. The object paradigm has a quite different basis: Inheritance, encapsulation,…. Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 2

Why This Mapping Continues... In the object paradigm objects are traversed by following links between objects (a link can be an instance of an ordinary association). In the relational paradigm rows in different tables are connected with foreign keys (joining rows in different tables). (Mapping from UML class diagrams to tables and then back to class diagrams will lead to loss of information.) Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 3

UML to Relational Mapping: Class to Table Class diagram B is a derived attribute. C a : Integer c : Double /b : Integer NB! Not all classes are persistent. Table Table: C A: Integer C: Double Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 4

UML to Relational Mapping: one-to-one associations X Y x_pkey x_a1 y_pkey y_a1 1 Total participation Class diagram Object diagram X1 Y2 X2 Y3 X3 Y1 x_pkey Tables: Three different solutions x_a1 y_pkey y_a1 Table: XY Table: X and Y Table: Y and X Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 5

UML to Relational Mapping: one-to-many associations Object diagram X Y x_pkey x_a1 y_pkey y_a1 1 * Class diagram X1 Y2 X2 Y1 Y3 X3 Y4 X4 Tables: One possible solution y_pkey y_a1 x_pkey x_a1 Table: Y Table: X Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 6

UML to Relational Mapping: many-to-many associations Object diagram X1 Y2 Y3 X2 Y1 X4 Y4 X3 X Y x_pkey x_a1 y_pkey y_a1 * Class diagram Tables: One possible solution y_pkey y_a1 x_a1 Table: Y x_pkey Table: X Table: XY Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 7

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 8 Example Type name 1 1 Unit * * Search name Consist word * * description * * * * sequenceNo : int Collection Atom * * url Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 8

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 9 Mapping to Tables - 1 Unit typeId name Type unitId name description typeId Type name 1 1 Unit * * Search searchId word Search name word description * * * * UnitSearch unitId searchId Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 9

Mapping to Tables - 2A unitId name description Unit typeId url Collection Atom Here is only one solution presented ( [2] has four different solutions) Unit name description Collection Atom url Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 10

Mapping to Tables - 2B Using the object relational features of Postgres CREATE TABLE Unit (id INTEGER, name VARCHAR(150), description VARCHAR(500), typeId INTEGER) CREATE TABLE Atom (url VARCHAR(180)) INHERITS (Unit) CREATE TABLE Collection() INHERITS (Unit) Unit name description Collection Atom url Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 11

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 12 Mapping to Tables - 3 Unit {ordered} name Consist * * description sequenceNo : int Collection * * unitId collectionId Consist sequenceNo Collection Unit unitId unitId name description typeId Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 12

Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 13 References [1]Grady Booch, James Rumbaugh, Ivar Jacobson: The Unified Modeling Language User Guide. Addison-Wesley, 1999 [2]Elmasri, Navathe: Fundamentals of database Systems. Addison-Wesley, 2000 [3]Grady Booch, James Rumbaugh, Ivar Jacobson: The Unified Modeling Language Reference Manual. Addison-Wesley, 1999 Mapping UML to RDB, 14.01.2019 - J.P.Nytun – page 13