<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Data_Modelling_with_UML</id>
	<title>Data Modelling with UML - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Data_Modelling_with_UML"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Data_Modelling_with_UML&amp;action=history"/>
	<updated>2026-04-22T18:37:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=Data_Modelling_with_UML&amp;diff=43888&amp;oldid=prev</id>
		<title>Filip Stachecki at 13:25, 11 October 2016</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Data_Modelling_with_UML&amp;diff=43888&amp;oldid=prev"/>
		<updated>2016-10-11T13:25:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:UML|02]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;slideshow style=&amp;quot;nobleprog&amp;quot; headingmark=&amp;quot;⌘&amp;quot; incmark=&amp;quot;…&amp;quot; scaled=&amp;quot;false&amp;quot; font=&amp;quot;Trebuchet MS&amp;quot; &amp;gt;&lt;br /&gt;
;title: Data Modelling with UML&lt;br /&gt;
;author: Filip Stachecki (Filip@NobleProg.pl)&lt;br /&gt;
&amp;lt;/slideshow&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Short Introduction to Data Modelling⌘=&lt;br /&gt;
[[File:ClipCapIt-160203-194633.PNG]]&lt;br /&gt;
* Data modeling is used to define and analyze data requirements needed to support the business processes within the scope of corresponding information systems in organizations.&lt;br /&gt;
===References⌘===&lt;br /&gt;
* Keith Gordon, &amp;#039;&amp;#039;&amp;#039;Principles of Data Management - Facilitating information sharing Second edition&amp;#039;&amp;#039;&amp;#039;, BCS Learning &amp;amp; Development Limited&lt;br /&gt;
* David C. Hay, &amp;#039;&amp;#039;&amp;#039;UML and Data Modeling: A Reconciliation&amp;#039;&amp;#039;&amp;#039;, Technics Publications&lt;br /&gt;
* David C. Hay, &amp;#039;&amp;#039;&amp;#039;Data Model Patterns: Conventions of Thought&amp;#039;&amp;#039;&amp;#039;, Addison-Wesley Professional&lt;br /&gt;
&lt;br /&gt;
==Languages used to describe data⌘==&lt;br /&gt;
* Many notations for data modeling:&lt;br /&gt;
** Entity–relationship diagram &lt;br /&gt;
***Chen&amp;#039;s Notation&lt;br /&gt;
*** [[File:crow2.png]] Ellis-Barker notation (Crow&amp;#039;s foot notation)&lt;br /&gt;
*** IDEF1X&lt;br /&gt;
** UML&lt;br /&gt;
&lt;br /&gt;
==ERD and other pre UML notations⌘==&lt;br /&gt;
===Entity–relationship diagram⌘===&lt;br /&gt;
&amp;lt;!--:[[File:ClipCapIt-140620-161251.PNG]]--&amp;gt;&lt;br /&gt;
[[File:ClipCapIt-150101-141200.PNG]]&lt;br /&gt;
* Entity–relationship model (ER model) is a data model for describing the data or information aspects of a business domain or its process requirements&lt;br /&gt;
* Entity–relationship modeling was developed by Peter Chen and published in a 1976&lt;br /&gt;
&lt;br /&gt;
===Entity–relationship meta model⌘===&lt;br /&gt;
:[[File:ClipCapIt-140620-161424.PNG]]&lt;br /&gt;
&lt;br /&gt;
Entity types are represented by boxes, relationships by diamonds and attributes by ellipses attached to the entity type boxes.&lt;br /&gt;
===Entity–relationship elements⌘===&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Entity&amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
** something capable of an independent existence that can be uniquely identified&lt;br /&gt;
** thing of significance about which the organization wishes to hold information&lt;br /&gt;
** physical, &amp;#039;&amp;#039;&amp;#039;tangible&amp;#039;&amp;#039;&amp;#039; object: a house or a car, or a concept (&amp;#039;&amp;#039;&amp;#039;intangible&amp;#039;&amp;#039;&amp;#039; thing) such as a transaction, order or role.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Entity type&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** category, definition of a set of entities&lt;br /&gt;
** an entity is an instance of a given entity-type&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Relationship&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
** captures how entities are related to one another&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Attribute&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
**describes an entity or a relationship, defines one piece of information&lt;br /&gt;
===Entity–relationship cardinalities⌘===&lt;br /&gt;
:[[File:ClipCapIt-140625-104153.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Different diagramming conventions⌘===&lt;br /&gt;
&amp;lt;!--[[File:ERD_Representation.svg | 300px]] --&amp;gt;&lt;br /&gt;
[[File:ClipCapIt-150101-141500.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Why data modelling is not database modelling⌘==&lt;br /&gt;
* Data modeling is the process of creating a data model for an information system.&lt;br /&gt;
* Data modeling is used to define and analyze data requirements needed to support the business processes within the scope of corresponding information systems in organizations.&lt;br /&gt;
* Database model is a type of data model that determines the logical structure of a database and fundamentally determines in which manner data can be stored, organized, and manipulated.&lt;br /&gt;
===Three levels of modeling⌘===&lt;br /&gt;
====Conceptual⌘====&lt;br /&gt;
[[File:ClipCapIt-140625-111749.PNG]]&lt;br /&gt;
* the most abstract form of data model&lt;br /&gt;
* simplified, helpful for communicating ideas to a wide range of stakeholders&lt;br /&gt;
====Logical⌘====&lt;br /&gt;
[[File:ClipCapIt-140625-112254.PNG]]&lt;br /&gt;
* contains more details about structure of the data elements and the relationships&lt;br /&gt;
====Physical⌘====&lt;br /&gt;
[[File:ClipCapIt-140625-112702.PNG]]&lt;br /&gt;
* visually represents the structure of the data as implemented by a relational database schema&lt;br /&gt;
* must contain enough detail to produce a database&lt;br /&gt;
&lt;br /&gt;
==Concepts of storing the data ⌘==&lt;br /&gt;
* Relational, Hierarchical, Object Oriented, etc...&lt;br /&gt;
===Relational model⌘===&lt;br /&gt;
&amp;lt;!-- [[File:Relational_Model.svg |300px]] --&amp;gt;&lt;br /&gt;
[[File:ClipCapIt-150101-141649.PNG]]&lt;br /&gt;
* The most popular example of a database model&lt;br /&gt;
* All data is represented in terms of tuples (ordered list of elements), grouped into relations.&lt;br /&gt;
* Most relational databases use the SQL data definition and query language&lt;br /&gt;
&lt;br /&gt;
===Hierarchical model⌘===&lt;br /&gt;
* A hierarchical database model is a data model in which the data is organized into a tree-like structure.&lt;br /&gt;
* The structure allows representing information using parent/child relationships: &lt;br /&gt;
** each parent can have many children, but each child has only one parent (&amp;#039;&amp;#039;&amp;#039;1-to-many&amp;#039;&amp;#039;&amp;#039; relationship)&lt;br /&gt;
* It was the first database model created by IBM in the 1960s&lt;br /&gt;
* Hierarchical database example used currently: XML file, Windows Registry&lt;br /&gt;
====Hierarchical model example⌘====&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;film_list&amp;gt;&lt;br /&gt;
	&amp;lt;film&amp;gt;&lt;br /&gt;
		&amp;lt;title&amp;gt;Pirates of the Caribbean&amp;lt;/title&amp;gt;&lt;br /&gt;
		&amp;lt;director&amp;gt;Gore Verbinski&amp;lt;/director&amp;gt;&lt;br /&gt;
		&amp;lt;cast&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;M&amp;quot;&amp;gt;Johnny Depp&amp;lt;/actor&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;M&amp;quot;&amp;gt;Geoffrey Rush&amp;lt;/actor&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;M&amp;quot;&amp;gt;Orlando Bloom&amp;lt;/actor&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;F&amp;quot;&amp;gt;Keira Knightley&amp;lt;/actor&amp;gt;&lt;br /&gt;
		&amp;lt;/cast&amp;gt;&lt;br /&gt;
	&amp;lt;/film&amp;gt;&lt;br /&gt;
	&amp;lt;film&amp;gt;&lt;br /&gt;
		&amp;lt;title&amp;gt;What Women Want&amp;lt;/title&amp;gt;&lt;br /&gt;
		&amp;lt;director&amp;gt;Nancy Meyers&amp;lt;/director&amp;gt;&lt;br /&gt;
		&amp;lt;cast&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;M&amp;quot;&amp;gt;Mel Gibson&amp;lt;/actor&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;F&amp;quot;&amp;gt;Helen Hunt&amp;lt;/actor&amp;gt;&lt;br /&gt;
			&amp;lt;actor sex=&amp;quot;F&amp;quot;&amp;gt;Marisa Tomei&amp;lt;/actor&amp;gt;&lt;br /&gt;
		&amp;lt;/cast&amp;gt;&lt;br /&gt;
	&amp;lt;/film&amp;gt;&lt;br /&gt;
&amp;lt;/film_list&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Object-oriented model⌘===&lt;br /&gt;
* Information is represented in the form of objects as used in object-oriented programming.&lt;br /&gt;
* Object databases have been considered since the early 1980s.&lt;br /&gt;
* Most object databases also offer some kind of query language (e.g. Object Query Language)&lt;br /&gt;
===NoSQL⌘===&lt;br /&gt;
* A NoSQL or Not Only SQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. &lt;br /&gt;
* NoSQL databases are finding significant and growing industry use in big data and real-time web applications.&lt;br /&gt;
* Example: MongoDB&lt;br /&gt;
&lt;br /&gt;
=UML and Data Modelling=&lt;br /&gt;
===Why do we need UML?⌘===&lt;br /&gt;
:[[File:ClipCapIt-140624-153035.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Is UML for Data Modeling?⌘===&lt;br /&gt;
* Object-oriented data requires to be stored after the program is completed (persistence).&lt;br /&gt;
* The way data is organized in object-oriented program is &amp;#039;&amp;#039;&amp;#039;very different&amp;#039;&amp;#039;&amp;#039; from the the way it&amp;#039;s organized in relational database&lt;br /&gt;
** Example: OO inheritance is not directly supported in relational database&lt;br /&gt;
* OO world needs to be transformed to relational world&lt;br /&gt;
* Solution - use a subset of UML Class diagram&amp;#039;s elements&lt;br /&gt;
&lt;br /&gt;
==Class Basics⌘==&lt;br /&gt;
====Element⌘====&lt;br /&gt;
[[File:UMLElement.png]]&lt;br /&gt;
&lt;br /&gt;
Metaclass &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Element&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*An element is a constituent of a model.&lt;br /&gt;
*All elements are subclasses of Element&lt;br /&gt;
*Element can own other elements&lt;br /&gt;
*No notation for Element - it is &amp;#039;&amp;#039;abstract&amp;#039;&amp;#039;&lt;br /&gt;
====Relationship ⌘====&lt;br /&gt;
[[File:UMLRelationship.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Relationship&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; class&lt;br /&gt;
*Used to interconnect elements&lt;br /&gt;
*No notation for Relationship as it is &amp;#039;&amp;#039;abstract&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Directed Relationship ⌘====&lt;br /&gt;
[[File:DirectedRelationship.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;DirectedRelationship&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; class&lt;br /&gt;
*a specialization of a relationship&lt;br /&gt;
*source elements want something - a &amp;#039;&amp;#039;&amp;#039;client&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
*target element offers something - a &amp;#039;&amp;#039;&amp;#039;supplier&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Comment⌘===&lt;br /&gt;
[[File:UMLComment.png]]&lt;br /&gt;
* a textual annotation that can be attached to an element&lt;br /&gt;
* may contain information that is useful to a modeler&lt;br /&gt;
* can be attached to more than one element&lt;br /&gt;
&lt;br /&gt;
===Classifier⌘===&lt;br /&gt;
* an abstract base class&lt;br /&gt;
* describes a set of instances that have features in common&lt;br /&gt;
* Examples of Classifiers:&lt;br /&gt;
** Use Case&lt;br /&gt;
** Class&lt;br /&gt;
===Feature⌘===&lt;br /&gt;
[[File:Feature.png]]&lt;br /&gt;
* declares a behavioral or structural characteristic of instances of classifiers&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;structural feature&amp;#039;&amp;#039;&amp;#039; describes a structure of an instance of a classifier (e.g. property)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;behavioral feature&amp;#039;&amp;#039;&amp;#039; specifies an aspect of the behavior of classifier&amp;#039;s instances (e.g. operation)&lt;br /&gt;
====Property⌘====&lt;br /&gt;
* a special structural feature that if it belongs to a class, is an attribute&lt;br /&gt;
* represents a declared state of one or more instances&lt;br /&gt;
&lt;br /&gt;
====Operation⌘====&lt;br /&gt;
* a behavioral feature of a classifier, which specifies name, type, parameters, and constraints&lt;br /&gt;
* can have preconditions and postconditions&lt;br /&gt;
* can have a type (the type of the return parameter)&lt;br /&gt;
* example:&lt;br /&gt;
 + createWindow (location: Coordinates): Window&lt;br /&gt;
&lt;br /&gt;
===UML Class⌘===&lt;br /&gt;
[[File:UMLClass.png]]&lt;br /&gt;
* describes a set of objects that share the same specifications of features (attributes and operations)&lt;br /&gt;
* is a special classifier&lt;br /&gt;
* an object is an instance of a class&lt;br /&gt;
* class name always in singular (Person, not People)&lt;br /&gt;
&lt;br /&gt;
===Entity Class⌘===&lt;br /&gt;
:[[File:ClipCapIt-140624-153206.PNG]]&lt;br /&gt;
* Entity Class represents an entity&lt;br /&gt;
* Attribute is a characteristics of an entity class&lt;br /&gt;
* Attribute&lt;br /&gt;
** use: attribute name, isId, derived&lt;br /&gt;
** don&amp;#039;t use: attribute visibility, read only&lt;br /&gt;
&lt;br /&gt;
===Mapping classes to tables⌘===&lt;br /&gt;
* Simple approach: map class attribute to zero or more columns in a relational database&lt;br /&gt;
* Object-oriented Classes are mapped using one-to-one mapping only in very simple databases&lt;br /&gt;
** derived attributes are not mapped&lt;br /&gt;
** one attribute can map to several columns in the database&lt;br /&gt;
&lt;br /&gt;
===Association⌘===&lt;br /&gt;
[[File:AssociationWithMarks.png]]&lt;br /&gt;
* specifies a relationship between instances&lt;br /&gt;
* describes a set of tuples whose values refer to typed instances&lt;br /&gt;
* declares that there can be links between instances of the associated types&lt;br /&gt;
&lt;br /&gt;
====Multiplicity⌘====&lt;br /&gt;
* specifies how many objects of the opposite class an object can be associated with&lt;br /&gt;
* is a range of the minimum and maximum values&lt;br /&gt;
* syntax: &amp;#039;&amp;#039;&amp;#039;number&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;min..max&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Multiplicity !! Notation&lt;br /&gt;
|-&lt;br /&gt;
| zero || &amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;0..0&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| exactly one || &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| zero or one || &amp;#039;&amp;#039;&amp;#039;0..1&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| zero or more || &amp;#039;&amp;#039;&amp;#039;0..*&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;*&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| one or more || &amp;#039;&amp;#039;&amp;#039;1..*&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Multiplicity example⌘====&lt;br /&gt;
[[File:MultiplicityExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Multiplicity - order and uniqueness⌘====&lt;br /&gt;
* Multiplicity defines a specification of order and uniqueness of the collection elements.&lt;br /&gt;
* This option can specify whether the values should be &amp;#039;&amp;#039;&amp;#039;unique&amp;#039;&amp;#039;&amp;#039; and/or &amp;#039;&amp;#039;&amp;#039;ordered&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;ordered&amp;#039;&amp;#039;&amp;#039;: the collection of values is sequentially ordered (default: not ordered)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;unique&amp;#039;&amp;#039;&amp;#039;: each value in the collection of values must be unique (default: is unique)&lt;br /&gt;
&lt;br /&gt;
====Property = End or Attribute⌘====&lt;br /&gt;
[[File:Attribute.png]]&lt;br /&gt;
&lt;br /&gt;
====Navigability⌘====&lt;br /&gt;
[[File:Navigability.png]]&lt;br /&gt;
* specifies whether one object can be accessed directly from another&lt;br /&gt;
====Association as a relationship between entities⌘====&lt;br /&gt;
:[[File:ClipCapIt-140626-135153.PNG]]&lt;br /&gt;
:[[File:ClipCapIt-140625-125250.PNG]]&lt;br /&gt;
&lt;br /&gt;
* A relationship between two entities consists of two logical statements (one each way)&lt;br /&gt;
* Sytnax (by David Hay):&lt;br /&gt;
 Each &amp;quot;Entity1&amp;quot; (may be|must be) &amp;quot;role name&amp;quot; (exactly one|one or more) &amp;quot;Entity2&amp;quot;&lt;br /&gt;
* Relationship:&lt;br /&gt;
** Each Employee must be employed in exactly one Department&lt;br /&gt;
** Each Department may be employer for one or more Employees&lt;br /&gt;
&lt;br /&gt;
====Association roles⌘====&lt;br /&gt;
:[[File:ClipCapIt-140626-141601.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Association Mapping Exercise⌘====&lt;br /&gt;
:[[File:ClipCapIt-140709-112459.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Many-to-many Association Mapping Exercise⌘====&lt;br /&gt;
:[[File:ClipCapIt-140709-112234.PNG]]&lt;br /&gt;
====Many-to-many Association Mapping Exercise⌘====&lt;br /&gt;
[[File:ClipCapIt-140709-112617.PNG]]&lt;br /&gt;
&lt;br /&gt;
====Association Class⌘====&lt;br /&gt;
:[[File:ClipCapIt-140709-113706.PNG]]&lt;br /&gt;
* An Association Class is both an Association and a Class.&lt;br /&gt;
* Describes a set of objects that each share the same specifications of features, constraints, and semantics.&lt;br /&gt;
&lt;br /&gt;
====Aggregation⌘====&lt;br /&gt;
[[File:Aggregation.png]] [[File:ClipCapIt-140627-141909.PNG]]&lt;br /&gt;
* shows how something (&amp;#039;&amp;#039;&amp;#039;whole&amp;#039;&amp;#039;&amp;#039;) is composed of &amp;#039;&amp;#039;&amp;#039;parts&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* parts can exist separately - can be &amp;#039;&amp;#039;&amp;#039;shared&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* precise semantics of aggregation varies by application area and modeler :)&lt;br /&gt;
&lt;br /&gt;
====Composition⌘====&lt;br /&gt;
[[File:UMLComposition.png]] [[File:ClipCapIt-140627-142144.PNG]]&lt;br /&gt;
&lt;br /&gt;
* a strict form of aggregation&lt;br /&gt;
* the whole is the owner of its parts&lt;br /&gt;
* parts &amp;#039;&amp;#039;&amp;#039;can not&amp;#039;&amp;#039;&amp;#039; be shared&lt;br /&gt;
* the existence of its parts depends on the whole&lt;br /&gt;
&lt;br /&gt;
====Aggregation / Composition Example⌘====&lt;br /&gt;
[[File:AggregationBoatCarExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Association / Composition Mapping⌘====&lt;br /&gt;
:[[File:ClipCapIt-140709-112343.PNG]]&lt;br /&gt;
* reading/writing/deleting objects from the database should map relationship type (association, aggregation, composition)&lt;br /&gt;
* relationships in relational databases can be implemented using foreign keys&lt;br /&gt;
&amp;lt;!--cascading update or delete --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====N-ary association⌘====&lt;br /&gt;
[[File:TernaryAssociation.png]]&lt;br /&gt;
* if an association has more than two end points (here: ternary association)&lt;br /&gt;
* Notation: a rhombus is used as a connection point&lt;br /&gt;
&lt;br /&gt;
===Generalization⌘===&lt;br /&gt;
[[File:GeneralizationExample.png]]&lt;br /&gt;
* relationship between a more general classifier and a more specific classifier&lt;br /&gt;
* each instance of the specific classifier is also an indirect instance of the general classifier&lt;br /&gt;
* the specific classifier inherits the features of the more general classifier&lt;br /&gt;
====Generalization Example⌘====&lt;br /&gt;
[[File:GenExample.png]]&lt;br /&gt;
====Sub-types in entity/relationship model⌘====&lt;br /&gt;
[[File:ClipCapIt-140625-142908.PNG]]&lt;br /&gt;
====Sub-types example⌘====&lt;br /&gt;
[[File:ClipCapIt-140625-145428.PNG]]&lt;br /&gt;
====Inheritance example⌘====&lt;br /&gt;
:[[File:ClipCapIt-140626-160143.PNG]]&lt;br /&gt;
&lt;br /&gt;
How can we map this structure in relational database?&lt;br /&gt;
&lt;br /&gt;
====Multiple Inheritance⌘====&lt;br /&gt;
:[[File:ClipCapIt-140626-150922.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Dependency ⌘===&lt;br /&gt;
[[File:Dependency.png]]&lt;br /&gt;
* a relationship that signifies that a model element(s) requires other model element(s) for their &amp;#039;&amp;#039;&amp;#039;specification&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;implementation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* the complete semantics of the depending elements is dependent on the definition of the supplier element(s)&lt;br /&gt;
* the modification of the &amp;#039;&amp;#039;&amp;#039;supplier&amp;#039;&amp;#039;&amp;#039; may impact the &amp;#039;&amp;#039;&amp;#039;client&amp;#039;&amp;#039;&amp;#039; model elements&lt;br /&gt;
* the semantics of the &amp;#039;&amp;#039;&amp;#039;client&amp;#039;&amp;#039;&amp;#039; is not complete without the &amp;#039;&amp;#039;&amp;#039;supplier&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* the type of dependency can be specified by using a keyword or stereotype&lt;br /&gt;
&lt;br /&gt;
===Named Element⌘===&lt;br /&gt;
* represents an element that &amp;#039;&amp;#039;&amp;#039;may&amp;#039;&amp;#039;&amp;#039; have a name and a visibility&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Visibility Kind !! Notation&lt;br /&gt;
|-&lt;br /&gt;
| public || &amp;#039;&amp;#039;&amp;#039;+&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| private || &amp;#039;&amp;#039;&amp;#039;-&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| protected || &amp;#039;&amp;#039;&amp;#039;#&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| package || &amp;#039;&amp;#039;&amp;#039;~&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Namespace⌘===&lt;br /&gt;
&lt;br /&gt;
*named element that can own other named elements &lt;br /&gt;
*each named element may be owned by at most one namespace&lt;br /&gt;
* provides a container for named elements&lt;br /&gt;
* all the members of a &amp;#039;&amp;#039;&amp;#039;namespace&amp;#039;&amp;#039;&amp;#039; are distinguishable within it&lt;br /&gt;
&lt;br /&gt;
===Package⌘===&lt;br /&gt;
[[File:UMLPackage.png]]&lt;br /&gt;
* used to group elements, and provides a namespace for the grouped elements&lt;br /&gt;
* qualified name:&lt;br /&gt;
 package name::element name&lt;br /&gt;
&lt;br /&gt;
===Package Import, Access⌘===&lt;br /&gt;
[[File:PackageImportAccess.png]]&lt;br /&gt;
&lt;br /&gt;
A package import is defined as a directed relationship that identifies a package whose members are to be imported by a&lt;br /&gt;
namespace.&lt;br /&gt;
&lt;br /&gt;
Two types:&lt;br /&gt;
* «import» for a &amp;#039;&amp;#039;&amp;#039;public&amp;#039;&amp;#039;&amp;#039; package import&lt;br /&gt;
** transitive: if A imports B and B imports C then A indirectly imports C&lt;br /&gt;
* «access» for a &amp;#039;&amp;#039;&amp;#039;private&amp;#039;&amp;#039;&amp;#039; package import&lt;br /&gt;
** intransitive&lt;br /&gt;
&lt;br /&gt;
====Package Import Example⌘====&lt;br /&gt;
[[File:PackageImportExample.png]]&lt;br /&gt;
* elements in Types are imported to ShoppingCart, and then further imported to WebShop&lt;br /&gt;
* elements of Auxiliary are only accessed from ShoppingCart, and cannot be referenced from WebShop&lt;br /&gt;
&lt;br /&gt;
===Instance ⌘===&lt;br /&gt;
[[File:InstanceSpecification.png]]&lt;br /&gt;
* is a concrete instance in the modeled system&lt;br /&gt;
* instance = object&lt;br /&gt;
&lt;br /&gt;
=Attributes=&lt;br /&gt;
===Data type⌘===&lt;br /&gt;
&amp;lt;!-- [[File:DataTypeExample.png]] --&amp;gt;&lt;br /&gt;
[[File:ClipCapIt-150101-141839.PNG]]&lt;br /&gt;
&lt;br /&gt;
A data type is a type whose instances are identified only by their value - two instances with the same value are indistinguishable.&lt;br /&gt;
&lt;br /&gt;
A DataType may contain attributes to support the modeling of structured data types.&lt;br /&gt;
&lt;br /&gt;
====PrimitiveType⌘====&lt;br /&gt;
[[File:primitive.png]]&lt;br /&gt;
&lt;br /&gt;
A primitive type defines a predefined data type, without any relevant substructure.&lt;br /&gt;
&lt;br /&gt;
Four instances of primitive type:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Boolean&amp;#039;&amp;#039;&amp;#039; (true, false)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Integer&amp;#039;&amp;#039;&amp;#039; (..., -1, 0, 1, ...) symbol for infinity - *&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;UnlimitedNatural&amp;#039;&amp;#039;&amp;#039; (0, 1, 2, ...)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;String&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Enumeration⌘====&lt;br /&gt;
[[File:Enumeration.png]]&lt;br /&gt;
&lt;br /&gt;
An enumeration is a data type whose values are enumerated in the model as enumeration literals.&lt;br /&gt;
====Enumeration in ER⌘====&lt;br /&gt;
:[[File:ClipCapIt-140625-151124.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Constraint⌘===&lt;br /&gt;
[[File:Constraint.png]]&lt;br /&gt;
* condition or restriction related to an element &lt;br /&gt;
* it must always be true&lt;br /&gt;
* can be in formal (OCL) or human language&lt;br /&gt;
* syntax: &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;{&amp;#039;&amp;#039;&amp;#039; [name :] boolean expression &amp;#039;&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
===Constraints on relations⌘===&lt;br /&gt;
:[[File:ClipCapIt-140625-155936.PNG]]&lt;br /&gt;
&lt;br /&gt;
=Views of data models⌘=&lt;br /&gt;
[[File:ClipCapIt-150101-141957.PNG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;David C. Hay, UML and Data Modeling: A Reconciliation, Figure 1-1: The Players and Their Artifacts&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Views:&lt;br /&gt;
* Views of the Business (planner, owner, architect)&lt;br /&gt;
* Views of Technology (designer, builder)&lt;br /&gt;
&lt;br /&gt;
Each element has a different view of the world.&lt;br /&gt;
&lt;br /&gt;
=Other useful UML diagrams⌘=&lt;br /&gt;
==Composite structure diagram⌘==&lt;br /&gt;
:[[File:ClipCapIt-140721-203553.PNG]]&lt;br /&gt;
* Composite structure diagram can be used to specify internal structure of a class&lt;br /&gt;
&lt;br /&gt;
==Profile diagram⌘==&lt;br /&gt;
:[[File:ClipCapIt-140721-203941.PNG]]&lt;br /&gt;
* Profile diagram can be used as an extension mechanism to the UML.&lt;br /&gt;
* Custom &amp;quot;UML dialect&amp;quot; can be defined using stereotypes, tagged values, enumerations, and constraints.&lt;br /&gt;
&lt;br /&gt;
=Avoid Redundancies⌘=&lt;br /&gt;
===Data redundancy⌘===&lt;br /&gt;
* Data redundancy occurs in database systems which have a field that is repeated in two or more tables. &lt;br /&gt;
* Data redundancy leads to data anomalies and corruption and generally should be avoided by design.&lt;br /&gt;
[[File:ClipCapIt-150101-142154.PNG]]&lt;br /&gt;
===Database normalization⌘===&lt;br /&gt;
* Normalization means decomposing a table into less redundant and smaller tables without losing information, defining foreign keys in the old table referencing the primary keys of the new ones&lt;br /&gt;
* The objective is to &amp;#039;&amp;#039;&amp;#039;isolate data&amp;#039;&amp;#039;&amp;#039; so that additions, deletions, and modifications of an attribute can be made in just one table and then propagated through the rest of the database using the defined foreign keys.&lt;br /&gt;
&lt;br /&gt;
===Stereotype⌘===&lt;br /&gt;
[[File:stereotype.png]]&lt;br /&gt;
*Formal extensions to existing model elements&lt;br /&gt;
*They do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; introduce new elements&lt;br /&gt;
*They add semantics to existing model elements&lt;br /&gt;
*Elements can have multiple stereotypes&lt;br /&gt;
*Stereotype name goes above or before element name enclosed in «»&lt;br /&gt;
** special character not a pair of &amp;lt; or &amp;gt;&lt;br /&gt;
*Graphical symbols can be used to replace «»&lt;br /&gt;
* List of standard UML stereotypes: UML 2 Spec, &amp;#039;&amp;#039;&amp;#039;Annex C: Standard Stereotypes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
===Design Patterns⌘===&lt;br /&gt;
* Design pattern is a general reusable solution to a commonly occurring problem within a given context.&lt;br /&gt;
* It is a description or template for how to solve a problem that can be used in many different situations.&lt;br /&gt;
* Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.&lt;br /&gt;
====Party⌘====&lt;br /&gt;
:[[File:ClipCapIt-140627-154256.PNG]]&lt;br /&gt;
====Product and Product Type⌘====&lt;br /&gt;
:[[File:ClipCapIt-140627-155838.PNG]]&lt;br /&gt;
====Product Categories⌘====&lt;br /&gt;
:[[File:ClipCapIt-140627-161423.PNG]]&lt;/div&gt;</summary>
		<author><name>Filip Stachecki</name></author>
	</entry>
</feed>