Information Modeling UML, ER, NIAM - what is the difference?

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

UML data models from an ORM perspective: Part 4

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

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2)

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

Chapter 2 Conceptual Modeling. Objectives

Chapter 2: Entity-Relationship Model

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Conceptual Design with ER Model

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

Enhanced Entity-Relationship (EER) Modeling

Course Logistics & Chapter 1 Introduction

Chapter Outline. Note 1. Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

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

Chapter (4) Enhanced Entity-Relationship and Object Modeling

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

Q &A on Entity Relationship Diagrams. What is the Point? 1 Q&A

Requirement Analysis & Conceptual Database Design

Conceptual Data Models for Database Design

Represent entities and relations with diagrams

Lecture 14 of 42. E-R Diagrams, UML Notes: PS3 Notes, E-R Design. Thursday, 15 Feb 2007

Conceptual Database Modeling

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

Conceptual Data Modeling

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

Chapter 11 Object and Object- Relational Databases

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

Lecture 5. Lecture 5: The E/R Model

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

course: Database Systems (NDBI025) SS2017/18

Modeling Databases Using UML

Cardinality constraints,n:m notation

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

A database can be modeled as: + a collection of entities, + a set of relationships among entities.

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

An Approach to Software Component Specification

Introduction to modeling

ER modeling. Lecture 4

Entity Relationship modeling from an ORM perspective: Part 2

The Entity-Relationship Model (ER Model) - Part 2

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Chapter 6: Entity-Relationship Model

Object-Oriented Systems Development: Using the Unified Modeling Language

Data Modeling Using the Entity-Relationship (ER) Model

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

Practical Database Design Methodology and Use of UML Diagrams Design & Analysis of Database Systems

Chapter 6: Entity-Relationship Model

Chapter 7: Entity-Relationship Model

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

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

Object Relational Mappings

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

Become a Champion Data Modeler with SQL Developer Data Modeler 3.0

Let s briefly review important EER inheritance concepts

Object-role modelling (ORM)

Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis

Introduction to Data Management. Lecture #3 (Conceptual DB Design) Instructor: Chen Li

The Entity/Relationship (E/R) Model & DB Design. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

Lecture 13: Analysis Modeling

Entity Relationship Data Model. Slides by: Shree Jaswal

The Entity-Relationship Model. Steps in Database Design

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #5: Entity/Relational Models---Part 1

Lecture 4. Lecture 4: The E/R Model

OVERVIEW OF DATABASE DEVELOPMENT

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

LAB 2 Notes. Conceptual Design ER. Logical DB Design (relational) Schema Refinement. Physical DD

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

COMP Instructor: Dimitris Papadias WWW page:

Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM).

Chapter 6: Entity-Relationship Model

Comparative Analysis of Architectural Views Based on UML

Modeling Issues Modeling Enterprises. Modeling

Database Design with Entity Relationship Model

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

6.001 Notes: Section 6.1

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

Announcement. Relational Database Design Part I. Keys. Relational model: review. Schema vs. data. More examples of keys

Conceptual Design. The Entity-Relationship (ER) Model

MIS Database Systems Entity-Relationship Model.

Entity-Relationship Model

IS 263 Database Concepts

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN

COSC 304 Introduction to Database Systems. Entity-Relationship Modeling

Chapter 7: Entity-Relationship Model

Review The Big Picture

A l Ain University Of Science and Technology

Teiid Designer User Guide 7.5.0

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

Chapter 7: Entity-Relationship Model

Data Modeling Using the Entity- Relationship Model Design & Analysis of Database Systems

ENTITY-RELATIONSHIP MODEL. CS 564- Spring 2018

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Chapter 7: Entity-Relationship Model

Course on Database Design Carlo Batini University of Milano Bicocca Part 5 Logical Design


CMPT 354 Database Systems I

XV. The Entity-Relationship Model

Chapter 8: Enhanced ER Model

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

Transcription:

Information Modeling UML, ER, NIAM - what is the difference? Egil P.Andersen Norwegian Computing Center P.O.Box 4, Blindern, 034 Oslo, Norway Tel: +47 22 85 25 94, Fax: +47 22 69 76 60 Egil.Paulin.Andersen@nr.no Slides: http://www.nr.no/~egil/hit-model-0000.zip (PS: >4Mb) UML - (OMG) Unified Modeling Language (http://www.omg.com/uml) ER - Entity Relationship NIAM - Natural language Information Analysis Method (http://www.orm.net/overview.html) Norsk Regnesentral / Norwegian Computing Center

Information Modeling Methods Information Modelling To model the information in which we are interested for a particular system, i.e., facts, knowledge, etc, about what we perceive to be objects in the system being modelled, and this described as structural relationships between the objects involved. The essence of information modeling is a) to represent the information of interest to the modeling task b) to assure consistency with respect to the constraints that apply to the information represented Information modeling is important! Information persist - applications come and go... Information Modeling Methods ER - the first data or information modeling method (published 76 by Chen). NIAM () - NIAM is an information modeling method with a rather cumbersome syntax, but its underlying principles are very important and useful to understand the essential characteristics of information modeling (which are syntax independent - and thus ER/UML/NIAM independent!). (NIAM is now mostly known under the name of ORM (Object Role Modeling), which is an extension of the original NIAM to include behavioural object modeling). UML - a relatively new object-oriented analysis/design method. Good tool support. OMG (the Object Management Group) is in charge of developing and standardising UML. UML seems to become much of a standard for object-oriented and relational analysis/design. () G.M.Nijssen, T.A.Halpin; Conceptual Schema and Relational Database Design - A Fact Oriented Approach; Prentice-Hall, 989, ISBN 0-7248-05-0 Norsk Regnesentral / Norwegian Computing Center 2

Rule Number A picture may be worth a 000 words, but whatever modeling language you use - whatever syntax you prefer - whatever tool you are using always add the 000 words +/- for each drawing you make! A model diagram itself is of no value at all without an elaborate formal or informal description stating how to interpret it, exactly what is expressed by the diagram, and so on. Example: In any information model, you can add a many-to-many binary association between almost any pair of classes/entities without making any other error than perhaps forgetting to identify those relationships that are derivable. City Birthplace Person customer Bank PS - ikke glem dette på eksamen :-) ( dersom dere vet hva dere har modellert hvis ikke - gjør som dere ikke vet dette ) Norsk Regnesentral / Norwegian Computing Center 3

UML - Unified Modeling Language Information modeling is just one ingredient in a full system analysis/design process. UML supports many other analysis/design areas beside information modeling but on the downside: UML is huge(!) - not fully consistent - not very precise semantics - areas not supported by tools are mostly of academic value -... The following are some of the diagram types supported by UML: Class diagrams: for information modeling and static class/object behaviour modeling Object diagrams: for exemplifying actual object structures Use cases: for describing system services as perceived and accessed by its users Sequence diagrams: dynamic object interaction modeling - message sequences Collaboration diagrams: dynamic object interaction modeling - object interactions Statechart diagrams: object state modeling Activity diagrams: object state modeling Component diagrams: for implementation - structure of the code - software component dependencies Deployment diagrams: for implementation - structure of the run-time system and its processing OCL - Object Constraint Language A predicate based language for defining constraints and business rules. Norsk Regnesentral / Norwegian Computing Center 4

UML vs ER vs NIAM UML has some minor syntactical differences from ER (also depending on the ER dialect ), but when it comes to information modeling (via UML Class Diagrams), then for all practical purposes there is no principal difference between using UML versus using ER. The same is almost the case for NIAM as well, but NIAM has a construct called joint-unique, (see later on) which is very useful and quite frequently occuring, that is missing in UML and ER. In general, NIAM is conceptually better at handling n-ary associations where n>2, and thus for doing information analysis. Norsk Regnesentral / Norwegian Computing Center 5

+ Mainstream - well-known and seen as much of a standard + Information modelling and explicit object interaction modelling + Object model available via COM/automation - it can be extended and customised! + Code generation (but not production code ) + Informal (can be a plus) Business rules and behaviour other than explicit object interaction Conceptual errors cannot be detected - models are not correct/incorrect - no modelling tool can distinguish good from bad models (and this is difficult also for experienced modellers) Incomplete Characteristics of Rational Rose - a UML development tool Slightly confusing organisation (at least at first ) - quite awkward drawings Consider it mainly as a drawing tool and as a model repository Use only those parts that are well understood (or agreed upon within the project), and use it consistently - do not over-model Modeling syntax is not essential, but you are not likely to do e.g. Class Diagrams any better... Assuming that analysis/design is essential to large-scale software development, then a modelling tool can be useful to establish good routines for planning and documentation, and as a means for unambigous communication internally and externally. Norsk Regnesentral / Norwegian Computing Center 6

What is an attribute versus an association? Attributes and Associations An attribute should be considered as a many-to-one binary association where the opposite class is suppressed (i.e., it will not be explicitly implemented). Uniqueness constraints (due to mandatory constraints or joint unique ) should be specified for attributes similar to how this is specified for associations. Person ssn : String name : String adress : String gender : Char birthdate : Eate gender Char 0.. Person birth date Date ssn name 0.. adress String Object-Oriented versus Relational Associations What if a person can be employed by the same company several times? Company? Person object-oriented solution actual model C P c p c p2 c2 p c p error oid C P c p 2 c p2 3 c2 p 4 c p ok Company Person Object Norsk Regnesentral / Norwegian Computing Center 7

Relational vs Object-Oriented Information Models A mistake "We do OO so we do not need those traditional ER-based techniques, normalization and all that, it's irrelevant to us" Behaviour modelling - Interaction Modelling A key characteristic of object-oriented modeling; e.g. by collaboration diagrams or role models. Relational databases has implicit access routes via joins Object-Oriented implementations requires explicit object access routes Object Information Associations versus Access Routes Do not mix the two - How and which information associations to implement is a modeling decision - How and which access routes to implement is an implementation decision The use of information associations is strictly ruled by the information they represent, and the constraints that apply to them. information association The use of access routes is only concerned with how to achieve efficient access - they can be added and removed however it serves the implementation best. Customer cashwithdrawal ATM owner object access routes Account Account Manager Norsk Regnesentral / Norwegian Computing Center 8

NIAM Main characteristics NIAM, i.e., its principles, is particularly valuable for information analysis, i.e., to understand the information that we are supposed to represent correctly and efficiently within a computer system. NIAM achieves this by being relation-oriented rather than object-oriented This is a great benefit since it allows us to focus on more manageable subsets of the overall information modeling task - separation of concern How can we possibly know what are appropriate objects for an information domain that we may not really know very well? Hence, in the beginning, look for object relationships - not objects! Norsk Regnesentral / Norwegian Computing Center 9

NIAM - Uniqueness Constraints Norsk Regnesentral / Norwegian Computing Center 0

NIAM - Elementary Associations Elementary Association - sufficiently small to avoid repetition of information, but not so small that it implies loss of information. n- rule - an association is elementary if and only if: ) it has no uniqueness constraint with an arity less than n- (n=assos.arity) 2) there are no other constraints between the members of this association Norsk Regnesentral / Norwegian Computing Center

NIAM - Elementary Associations (cont.) Norsk Regnesentral / Norwegian Computing Center 2

NIAM - Joint Unique Norsk Regnesentral / Norwegian Computing Center 3

NIAM - Association Associations Norsk Regnesentral / Norwegian Computing Center 4

NIAM - Creating Objects from Associations Norsk Regnesentral / Norwegian Computing Center 5

NIAM - from n ary to Binary Associations Norsk Regnesentral / Norwegian Computing Center 6

NIAM - from n ary to Binary Associations (cont.) Norsk Regnesentral / Norwegian Computing Center 7

NIAM - from n ary to Binary Associations (cont.) Norsk Regnesentral / Norwegian Computing Center 8

Some UML constructs in NIAM Qualified Associations are binary associations where a qualifier is added to one of the objects involved in the association. Assume having a qualified association between class A and B where a qualifier Q is added to A. The qualifier Q is used to partition the set of B objects associated to a particular A object into disjoint subsets. Qualified associations are often used to model dictionary-like constructs with the qualifier as index. NIAMs joint-unique is more generally useful than qualified associations (as a special case). ) A Q 0.. 0.. B A Q ) x = 0.. y = 0.. ) A Q B 2) A Q 0.. B AQ 2) x = 0.. y = 2) A Q B 3) 4) A A Q Q 0.. B B x y B 3) x = y = 0.. 4) x = y = 3) 4) A A Q Q B B Association Classes UML association classes are classes representing properties of associations themselves. Company Person Company Person Job salary Job salary Norsk Regnesentral / Norwegian Computing Center 9

A convention for presenting Information Models There are usually different subsets of the overall set of associations that are more strongly related than others, or that should be considered together to better grasp the overall structure that they represent. Sets of associations that are more closely related should be presented separated from other associations that they are not intimately related to. Obviously, this is a matter of judgment on a case by case basis. Person member employer employee Company responsible Person ssn name 0.. adress String Project Member Project gender Char 0.. birth date Date The separate presentation of different subsets of an overall information model is orthogonal to the classes involved. Thus the same class can be illustrated several times within different associations, and this can make it difficult toget an overview of every association in which a particular class is involved. However, a tool supporting information modeling can automatically produce a model view where every association of a particular class is illustrated, but, due to no knowledge of the semantics involved, it cannot automatically produce a model split as by the above convention. Norsk Regnesentral / Norwegian Computing Center 20

Different models for different purposes Motivation To characterize two kinds of information models (IM's) that play different roles in the design, implementation and documentation of a set of related software components. This to avoid that implementation-oriented issues (at least to a lesser degree) "clutters up" the conceptual view provided to clients working with these components. "Traditional" Information Modeling In database terminology an IM is a schema; e.g. consisting of tables, columns, keys, etc, in a relational database. In logical database design an IM is expressed as an ER-like model, consisting of entities, attributes of entities and relationships between entities. Person employee employer member Project Member Company Project responsible implement DB Schema Norsk Regnesentral / Norwegian Computing Center 2

Component Object Models In component systems an object model consists of classes, interfaces, functions, etc, typically specified by an IDL. Example: Rational Rose COM/Automation interfaces illustrated in VB Object Browser Norsk Regnesentral / Norwegian Computing Center 22

Implementation versus Interface Information Models Two different kinds of IM for component-oriented systems where component implementations are encapsulated behind interfaces of functions offered to their clients Interface Information Models (IntIM) Conveys the common understanding necessary between a client and a set of related components by describing which objects are made available by the components, which information must be provided when information viewpoint invoking a function, Exam which information will be received, Student Course what is the effect of invoking this function Implementation Information Models (ImpIM) A basis for implementing the components Grade Interface Information Model common understanding computational viewpoint implementation Client Implementation Information Model components (IDL specification) Norsk Regnesentral / Norwegian Computing Center 23

Example - An Electronic Patient Record (EPR) Server Based on the results of Synapses - an EU project for the standardization of EPR's Implementation Information Model Property name : string value : string logtime : date loguserid : string dynamic attributes object class RecordElement nodeid : string localid : long classname : string type : short logtime : date loguserid : string target 0.. hyperlink above 0.. succ 0.. 0.. pred below Interface Information Model Property name : string value : string logtime : date loguserid : string dynamic attributes RecordElement recordid : string localelementid : long classid : string logtime : date loguserid : string Record Folder Document succ 0.. 0.. above 0.. succ 0.. 0.. pred pred below 0.. pred 0.. DocumentItem below localclassid : long HyperLink succ above 0.. DataField 0.. target Norsk Regnesentral / Norwegian Computing Center 24

Implementation-Oriented Information Models (ImpIM) Goals: a) to represent the information of interest, and b) to assure consistency in this information Assure Consistency - Elementary Associations - Normalization Find elementary associations - associations that are sufficiently small to avoid the "repetition of information" and "the inability to represent certain information" problems, but not so small that they imply a "loss of information". Handled by a normalization process - but the technical details of normalization theory is not a prerequisite for good modelling. Avoid Redundancy - Derivable Associations - Pragmatic considerations Derivable associations should be "read-only" and computed on demand to avoid redundancy that can lead to inconsistencies In practice not always possible - the essence is to be aware of it Constraints and Business Rules Constraints are equally important to associations in defining which information can be represented What are derivable associations depends upon the business rules Change Control Changes in ImpIM are often expensive ImpIMs are often made general and generic to better support changes It is easier to add, change or remove business rules than to change the association structure. Performance and Platform Oriented ImpIM focuses on achieving an efficient and flexible implementation - thus influenced by performance issues, e.g. relating to the implementation platform Norsk Regnesentral / Norwegian Computing Center 25

Interface Information Models (IntIM) Goal: provide a description and documentation of how to use a set of related software components A set of related components should always be accompanied by a corresponding IntIM Change Control IntIM is part of the contract between the components and their clients Changing them is a "paper excercise", but clients are affected IntIM can be more domain specific There is no benefit in making an IntIM more general or generic, as when defining ImpIM's Constraints and Business Rules Does not concern consistency - only how a client can work with the components Maximize Encapsulation An IntIM does not concern how component interfaces are implemented - there need not be any correspondence between the IntIM and the ImpIM Confine the effects of implementation changes - The design of component interfaces should not reveal how they are implemented - Focus on what an object offers to its clients, not how it does this Documentation E.g. IntIM may well describe detailed function signatures for documentation purposes Norsk Regnesentral / Norwegian Computing Center 26

Interface Information Models (cont.) Consistency and Redundancy Avoiding redundancy and distinguishing derivable versus non-derivable associations is irrelevant to IntIM. Redundancy in an IntIM can do no harm as long as consistency is maintained by the implementation Avoiding redundancy in an ImpIM implies that every "piece" of information is stored in one place, not duplicated several places. For every constraint that apply to an ImpIM there should be as few objects as possible, preferably just a single object, in charge of testing or maintaining this constraint. This is not an issue for IntIM where the same information, or the same functionality, can be offered several places without introducing redundancy, inconsistencies, or hamper maintenance. Norsk Regnesentral / Norwegian Computing Center 27

Interface Information Models (cont.) Connected Models and Logical Views ImpIM are connected models - or else models of independent systems Several IntIM can offer different logical views to the same system Implementation Information Model Property name : string value : string logtime : date loguserid : string dynamic attributes object class RecordElement target 0.. nodeid : string localid : long classname : string type : short hyperlink logtime : date loguserid : string above 0.. succ 0.. 0.. pred below Record Class View Interface Information Model Property name : string value : string logtime : date loguserid : string dynamic attributes RecordElementClass classid : string localclassid : long succ Record Class classname:string 0.. succ Template 0.. pred Folder Class classname:string Document Class classname:string Record Folder Template representative Template representative HyperLink Class DocumentItem Class 0.. 0.. pred below above 0.. DataField Class 0.. above below Norsk Regnesentral / Norwegian Computing Center 28

Summary We can distinguish two different kinds of information models for the design, implementation and documentation of sets of related software components. Implementation Information Models (ImpIM) Used as a basis for implementing components and their interfaces Primary concern is to assure consistency, achieve good performance, and being flexible w.r.t. future changes Interface Information Models (IntIM) An implementation-independent model that describe the components as perceived by clients using their interfaces Primary concern is conceptually simple (more domain specific), easy to use client interfaces with proper encapsulation such that technical, domain independent implementation changes are confined without affecting the interfaces and thus clients. Similarities They should both be the results of an analysis/design phase - for ImpIM to understand and design an implementation, and - for IntIM to understand and design good client interfaces They can both be described by the same notation, but - an ImpIM may not be considered a good IntIM since it is too implementation-oriented, too generic, or too awkward to use, and - an IntIM may not be considered a good ImpIM by being too specific and thus not good for handling changes Norsk Regnesentral / Norwegian Computing Center 29