SlideShare a Scribd company logo
UML for Data Architects:
A Painless Introduction

Dr. Vladimir Bacvanski
vladimir.bacvanski@scispike.com
About the Speaker: Dr. Vladimir Bacvanski

 Mission: to make organizations successful in
  solving problems through adoption of modern
  software technologies
  – Founder of SciSpike – a training and consulting firm
    specializing in advanced software technologies
  – Over two decades of experience with software and data
    technologies
  – Vladimir has helped a number of organizations
    including US Treasury, Federal Reserve Bank, US Navy,
    IBM, Dell, Hewlett Packard, JP Morgan Chase, Nokia,
                                      g
    Lucent, Nortel Networks, General Electric, BAE Systems,
    AMD, and others
  – Frequent speaker at leading industry events.
       q        p              g        y
  – For three years in a row awarded the title "IBM
    Information Champion" for his contributions to the
    information management community
                       g                  y


                        www.scispike.com   Copyright © SciSpike 2011   2
Outline

 What is UML?
 How to approach UML? (aka "Avoiding pain")
 UML diagrams: use only what you need!
         g             y      y
 Representing structure: class (aka type) diagrams
 UML for database design
 Automation
 Conclusion




                   www.scispike.com   Copyright © SciSpike 2011   3
What is UML?

 The UML is a graphical language for
  software intensive systems
    f
  – Note: UML is just a notation:
    the way we visualize our decisions
     h           i li        d ii
 UML covers a broad area of software
  development
  d l         t
 UML is a standard: it enables you to
  express your models i a way th t
                  d l in        that
  can be understood by others




                   www.scispike.com   Copyright © SciSpike 2011   4
Models and Diagrams




 Model is a view of a system from a particular perspective
 Diagram visually presents elements of a model
  – One model can be presented with several diagrams, each
    focusing on a separate aspect

                   www.scispike.com   Copyright © SciSpike 2011   5
UML Diagrams




                                                 Diagrams in italics are introduced in UML 2

           www.scispike.com   Copyright © SciSpike 2011                                        6
Choose your Approach to UML!

        Painful                                                  Painless

• Focus on > 95% of UML                   • Focus on < 5% of UML
  that
  th t you d 't need
           don't     d                      that
                                            th t you need d
• Start with a 1000+                      • Start with a subset
  pages UML Reference                       relevant to data
• Avoid practical                           modeling
  examples                                • Seek practical guides
• Use UML for all the                       and examples
  wrong reasons                           • Use UML to
                                            communicate and
                                            automate

                  www.scispike.com   Copyright © SciSpike 2011              7
Modeling Data with UML Class Diagrams

 A subset of UML Class Diagram is very close to notations
  used in d
     d data modeling
                 d l
 UML Class Diagrams have features not needed for data
  modeling:
    d l
  – Operations (methods)
  – Visibility (public, private, …)
 We can use only a subset that make sense for data modeling:
  – Classes (aka "types")
  – Attributes
  – Associations
  – Generalization

                    www.scispike.com   Copyright © SciSpike 2011   8
UML Classes and Attributes
                                    Class
                                    Similar to entity in ERD.
    Customer
                                    Class name
                                    Typically capitalized.

                                    Attribute Compartment
                                    The only compartment we care about. 
                                    UML classes can have other 
                                    compartments, e.g. for operations.
                                    It is fine to skip parts we don't need!
                                                     pp



                                                                    Note:
                                                                    N t
Attribute Name   Attribute Type                                     High level class 
Typically        E.g. String, Integer,…                             diagrams typically don't 
lowercase.       but also other class names                         need primary and 
                                                                    foreign keys. 
                 www.scispike.com       Copyright © SciSpike 2011                               9
UML Associations
 Association             Association Name                        Multiplicity
                         Usually skipped.                        *: zero or many
                                                                 1..*: one or many
                                                                 0..1: zero or one




 Association Role
 Start from a class, follow the 
 Start from a class follow the                                  Note:
 association, read the role of the                              Foreign key attributes are 
                                                                not needed
 associated objects.


                       www.scispike.com   Copyright © SciSpike 2011                           10
Navigability


                    1..*                             *
     Person                                                        Address
                                       homeAddress




 High level diagrams typically do not show navigability
 Navigability is a design decision!
  – It is a bad practice to assign navigability prematurely
  – Typically not needed for modeling when we target
    relational databases


                    www.scispike.com   Copyright © SciSpike 2011             11
Associations vs. Attributes


       Person
       P                       Multiplicity
                               M lti li it                                   Company
                                                                             C


 employer: Company[*]
   p y        p y[ ]                                                   employee: Person[1..*]
                                                                         p y           [    ]




 In UML, attributes and associations are equivalent!
 Choose the representation that is more suitable to the
  reader
 Important relationships are often represented as
  associations – they bring the visual emphasis

                        www.scispike.com   Copyright © SciSpike 2011                            12
Association Class




                                                                  Association 
                                                                  Class
                                                                  Cl




 Association class allows to attach information to an
  association
  – Often refined into two associations to a class


                   www.scispike.com   Copyright © SciSpike 2011                  13
Association Class Refined




 Association classes are commonly refined in lower level
                                 y
  diagrams



                   www.scispike.com   Copyright © SciSpike 2011   14
Semantics of Aggregation and Composition

                                           1
          Car                                                     Engine


                               Aggregation
                                           1
          Car                                                     Engine


                               Composition

 Aggregation: shortcut for "has" relationship
                             has
  – Does not have a well defined semantics. Use sparingly!
 Composition lifetime of the owner determines the lifetime
  Composition:
  of the owned objects
  – Similar to "cascading"
                cascading
                   www.scispike.com   Copyright © SciSpike 2011            15
Generalization (aka Inheritance)

                                     Employee
                                                                             Generalization
                                                                             G     li i




         Engineer                        Manager                          TechWriter




 Subclasses extend superclasses with additional attributes
  and associations
 This relationship eventually needs to be mapped to tables
  for relational database design
  – Several solutions possible with different performance impact. Choice
                                                          impact
    depends on the typical pattern of usage.
                      www.scispike.com        Copyright © SciSpike 2011                       16
Constraints




 Constraints can be expressed as:
  – Plain text
  – OCL: Object Constraint Language, part of UML
    • Not common in mainstream projects
    • Enforcable



                   www.scispike.com   Copyright © SciSpike 2011   17
Organizing UML Models: Packages

                                          A package is a
                                           structuring element
  Customer
 Management                                – It contains other
                                             elements and
                                             diagrams
   Sales
                                          P k
                                           Packages are important
                                                          i
                                           for managing
                                           complexity of models
                                          Prefer models organized
  Inventory                                into packages to huge
                                           diagrams


              www.scispike.com   Copyright © SciSpike 2011          18
Mapping UML to ER Models…

 Class  Entity
  – Add primary key
 Simple Attribute Type  Column Type
 Complex Attribute Type  Relationship to an entity for the
  attribute type
 Association  Foreign Key relationships
  – Use role names for foreign keys
  – Many-to-many association  add an associative table
  – Aggregation: treat as ordinary relationships




                   www.scispike.com   Copyright © SciSpike 2011   19
…Mapping UML to ER Models

 Generalization: use the usual mappings:
  – Table per class hierarchy
  – Table per subclass
  – Table per concrete class
 Constraints
  – Set constraints on the database
  – Some only enforceable in application logic
             y                 pp          g



  This is just a simplified set of rules to get you going!


                     www.scispike.com   Copyright © SciSpike 2011   20
UML for Database Design




 Agile teams often use UML for both software and database
  design
 UML data modeling profile introduces extensions to UML:
  – <<PK>>, <<FK>>, <<Auto Generated>>, <<Not Null>>,
    <<View>>, <<Stored Procedures>>,…
 Use relational data types
  – String  CHAR(x), VARCHAR(x)

                    www.scispike.com   Copyright © SciSpike 2011   21
Automation

                                                                        Code

                                 Transformer
                                                                        DDL

          Input
                                                                        Models
         Models
                                                                    Output

 Tools can convert from UML to ERD and vice versa
 Model transformation tools operate at a MOF/EMF level and
  can transform UML to various targets
  – Visual Domain Specific Languages (DSLs) based on UML may provide
    better alignment with the p
              g               problem domain than vanilla UML

                     www.scispike.com   Copyright © SciSpike 2011                22
Conclusion

 You will need just a small part of UML!
 UML is a common starting point for data models
 Mapping of UML to ER is quite straightforward
    pp g                  q          g
 Knowing UML makes you a more significant player in the
  software development p
                 p     process




                   www.scispike.com   Copyright © SciSpike 2011   23
Getting in Touch

 Email: vladimir.bacvanski@scispike.com
 Blog: http://www.OnBuildingSoftware.com/
 Twitter: http://twitter.com/OnSoftware
              p
 LinkedIn: http://www.linkedin.com/in/VladimirBacvanski


 SciSpike Training and Consulting:
  http://www.scispike.com
  http://www scispike com
  – Related training for data architects:
    • Visual Modeling with UML
    • Mastering Data Modeling with InfoSphere Data Architect


                   www.scispike.com   Copyright © SciSpike 2011   24

More Related Content

What's hot (20)

PDF
Pm arabic ch2 دورة حياة المشروع وارتباطاته التنظيمية
khalid Dahleez
 
PDF
أنظمة المعلومات الإدارية المتقدمة 9001
Arab International Academy
 
PPT
هندسة العمليات الادارية
Zakarya Ameen
 
PDF
الادارة بالاهداف - الادارة بالنتايج
Dr- Heba Nour
 
DOC
نموذج تقييم أداء موظف
Eldaw Ali Yousif
 
PDF
التخطيط التشغيلي
tanmya-eg
 
DOC
إدارة المخاطر
Abdullrahman Tayshoori
 
PDF
التقويم التربوى
Khaled Shehab El-din
 
PDF
السكرتارية وادارة المكاتب
رؤية للحقائب التدريبية
 
PDF
الاتجاهات والادوات التقنية الحديثة في تطوير الاداء المؤسسي
Saeed Al Dhaheri
 
PPTX
التخطيط الاستراتيجى- دليل إرشادى- د/ أحمد روحى- كلية التربية- جامعة الزقازيق
Dr,Ahmed Rawhy
 
PDF
ادارة الازمات والكوارث
tanmya-eg
 
PDF
التقويم التربوي
Essaid Ouazzouz
 
PPSX
E archive ادارة السجلات والارشفة الالكترونية - المفاهيم والمصطلحات
Essam Obaid
 
PDF
دورة استراتيجيات التعليم والتعلم
Wesam Rohouma
 
PDF
التحول الرقمي للوثائق والمحفوظات من النظم التقليدية لنظم المعلومات في المؤسسات
Dr. Essam Obaid ,Content Management ,6 Sigma,Smart Archiving
 
PPTX
ويبينار تطبيقات إنترنت الأشياء ودورها في إدارة المعرفة في المكتبات ومؤسسات ال...
Naseej Academy أكاديمية نسيج
 
PDF
صيـاغـة مقترحـات التمـويل الفعّـالة
Resources for Development Center (RDC)
 
PDF
الوثيقة المتكاملة للمنهجية الوطنية للبنية المؤسسية National Overall Reference...
YesserProgram
 
PDF
استراتيجيات التعليم والتعلم
أمنية وجدى
 
Pm arabic ch2 دورة حياة المشروع وارتباطاته التنظيمية
khalid Dahleez
 
أنظمة المعلومات الإدارية المتقدمة 9001
Arab International Academy
 
هندسة العمليات الادارية
Zakarya Ameen
 
الادارة بالاهداف - الادارة بالنتايج
Dr- Heba Nour
 
نموذج تقييم أداء موظف
Eldaw Ali Yousif
 
التخطيط التشغيلي
tanmya-eg
 
إدارة المخاطر
Abdullrahman Tayshoori
 
التقويم التربوى
Khaled Shehab El-din
 
السكرتارية وادارة المكاتب
رؤية للحقائب التدريبية
 
الاتجاهات والادوات التقنية الحديثة في تطوير الاداء المؤسسي
Saeed Al Dhaheri
 
التخطيط الاستراتيجى- دليل إرشادى- د/ أحمد روحى- كلية التربية- جامعة الزقازيق
Dr,Ahmed Rawhy
 
ادارة الازمات والكوارث
tanmya-eg
 
التقويم التربوي
Essaid Ouazzouz
 
E archive ادارة السجلات والارشفة الالكترونية - المفاهيم والمصطلحات
Essam Obaid
 
دورة استراتيجيات التعليم والتعلم
Wesam Rohouma
 
التحول الرقمي للوثائق والمحفوظات من النظم التقليدية لنظم المعلومات في المؤسسات
Dr. Essam Obaid ,Content Management ,6 Sigma,Smart Archiving
 
ويبينار تطبيقات إنترنت الأشياء ودورها في إدارة المعرفة في المكتبات ومؤسسات ال...
Naseej Academy أكاديمية نسيج
 
صيـاغـة مقترحـات التمـويل الفعّـالة
Resources for Development Center (RDC)
 
الوثيقة المتكاملة للمنهجية الوطنية للبنية المؤسسية National Overall Reference...
YesserProgram
 
استراتيجيات التعليم والتعلم
أمنية وجدى
 

Viewers also liked (20)

PPTX
Dache: A Data Aware Caching for Big-Data Applications Using the MapReduce Fra...
Govt.Engineering college, Idukki
 
PPT
UML and Data Modeling - A Reconciliation
dmurph4
 
PDF
Data Modeling for Big Data
DATAVERSITY
 
PDF
Win Friends and Influence People... with DSLs
Vladimir Bacvanski, PhD
 
PPTX
Introduction to pig
Uday Vakalapudi
 
PDF
High performance database applications with pure query and ibm data studio.ba...
Vladimir Bacvanski, PhD
 
PPTX
Introduction to Hadoop at Data-360 Conference
Avkash Chauhan
 
PDF
Introduction to Apache Pig
Avkash Chauhan
 
PDF
Data-Ed Slides: Data-Centric Strategy & Roadmap - Supercharging Your Business
DATAVERSITY
 
PDF
CDO Webinar: 2017 Trends in Data Strategy
DATAVERSITY
 
PDF
Data-Ed Slides: Exorcising the Seven Deadly Data Sins
DATAVERSITY
 
PDF
Data-Ed Slides: Data Architecture Strategies - Constructing Your Data Garden
DATAVERSITY
 
PDF
Big Data Modeling
Hans Hultgren
 
PDF
Data strategy in a Big Data world
Craig Milroy
 
PPTX
Data Governance
SambaSoup
 
PDF
Data Strategy
Jeff Block
 
PDF
A New Way of Thinking About MDM
DATAVERSITY
 
PDF
8 Steps to Creating a Data Strategy
Silicon Valley Data Science
 
PPTX
Big Data Analytics Strategy and Roadmap
Srinath Perera
 
PDF
Data Governance: Keystone of Information Management Initiatives
Alan McSweeney
 
Dache: A Data Aware Caching for Big-Data Applications Using the MapReduce Fra...
Govt.Engineering college, Idukki
 
UML and Data Modeling - A Reconciliation
dmurph4
 
Data Modeling for Big Data
DATAVERSITY
 
Win Friends and Influence People... with DSLs
Vladimir Bacvanski, PhD
 
Introduction to pig
Uday Vakalapudi
 
High performance database applications with pure query and ibm data studio.ba...
Vladimir Bacvanski, PhD
 
Introduction to Hadoop at Data-360 Conference
Avkash Chauhan
 
Introduction to Apache Pig
Avkash Chauhan
 
Data-Ed Slides: Data-Centric Strategy & Roadmap - Supercharging Your Business
DATAVERSITY
 
CDO Webinar: 2017 Trends in Data Strategy
DATAVERSITY
 
Data-Ed Slides: Exorcising the Seven Deadly Data Sins
DATAVERSITY
 
Data-Ed Slides: Data Architecture Strategies - Constructing Your Data Garden
DATAVERSITY
 
Big Data Modeling
Hans Hultgren
 
Data strategy in a Big Data world
Craig Milroy
 
Data Governance
SambaSoup
 
Data Strategy
Jeff Block
 
A New Way of Thinking About MDM
DATAVERSITY
 
8 Steps to Creating a Data Strategy
Silicon Valley Data Science
 
Big Data Analytics Strategy and Roadmap
Srinath Perera
 
Data Governance: Keystone of Information Management Initiatives
Alan McSweeney
 
Ad

Similar to UML for Data Architects (20)

PPT
UML
Ashish Jha
 
PPT
A&D - UML
vinay arora
 
PPT
08 class and sequence diagrams
kebsterz
 
PDF
Oop09 6
schwaa
 
PPT
Uml - An Overview
Raj Thilak S
 
PPT
Unified Modeling Language
Debajyoti Biswas
 
PDF
Introduction to UML, a guide to learn.pdf
TARGARYEN001
 
PDF
Software Testing and UML Lab
Harsh Kishore Mishra
 
PPT
Object modeling
Anand Grewal
 
PPT
UML-class_diagram.ppt diagrams ppt download
divijareddy0502
 
PPT
UML-class diagram for beginners to adance.ppt
WorkDrive2
 
PPT
cse 355 UML class diagram software engineering.ppt
Safaet Hossain
 
PPT
UML-class_diagram.ppt
PragnyaNandaSabat
 
PPTX
1. introduction to uml
PRABU M
 
PPT
ASP.NET System design 2
Sisir Ghosh
 
PPT
Visual Modelling and the Unified Modeling Language.ppt
girumdethio
 
PPT
Uml &amp; rup
◄ vaquar khan ► ★✔
 
PDF
Domain Modeling
Harsh Jegadeesan
 
A&D - UML
vinay arora
 
08 class and sequence diagrams
kebsterz
 
Oop09 6
schwaa
 
Uml - An Overview
Raj Thilak S
 
Unified Modeling Language
Debajyoti Biswas
 
Introduction to UML, a guide to learn.pdf
TARGARYEN001
 
Software Testing and UML Lab
Harsh Kishore Mishra
 
Object modeling
Anand Grewal
 
UML-class_diagram.ppt diagrams ppt download
divijareddy0502
 
UML-class diagram for beginners to adance.ppt
WorkDrive2
 
cse 355 UML class diagram software engineering.ppt
Safaet Hossain
 
UML-class_diagram.ppt
PragnyaNandaSabat
 
1. introduction to uml
PRABU M
 
ASP.NET System design 2
Sisir Ghosh
 
Visual Modelling and the Unified Modeling Language.ppt
girumdethio
 
Domain Modeling
Harsh Jegadeesan
 
Ad

Recently uploaded (20)

PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 

UML for Data Architects

  • 1. UML for Data Architects: A Painless Introduction Dr. Vladimir Bacvanski [email protected]
  • 2. About the Speaker: Dr. Vladimir Bacvanski  Mission: to make organizations successful in solving problems through adoption of modern software technologies – Founder of SciSpike – a training and consulting firm specializing in advanced software technologies – Over two decades of experience with software and data technologies – Vladimir has helped a number of organizations including US Treasury, Federal Reserve Bank, US Navy, IBM, Dell, Hewlett Packard, JP Morgan Chase, Nokia, g Lucent, Nortel Networks, General Electric, BAE Systems, AMD, and others – Frequent speaker at leading industry events. q p g y – For three years in a row awarded the title "IBM Information Champion" for his contributions to the information management community g y www.scispike.com Copyright © SciSpike 2011 2
  • 3. Outline  What is UML?  How to approach UML? (aka "Avoiding pain")  UML diagrams: use only what you need! g y y  Representing structure: class (aka type) diagrams  UML for database design  Automation  Conclusion www.scispike.com Copyright © SciSpike 2011 3
  • 4. What is UML?  The UML is a graphical language for software intensive systems f – Note: UML is just a notation: the way we visualize our decisions h i li d ii  UML covers a broad area of software development d l t  UML is a standard: it enables you to express your models i a way th t d l in that can be understood by others www.scispike.com Copyright © SciSpike 2011 4
  • 5. Models and Diagrams  Model is a view of a system from a particular perspective  Diagram visually presents elements of a model – One model can be presented with several diagrams, each focusing on a separate aspect www.scispike.com Copyright © SciSpike 2011 5
  • 6. UML Diagrams Diagrams in italics are introduced in UML 2 www.scispike.com Copyright © SciSpike 2011 6
  • 7. Choose your Approach to UML! Painful Painless • Focus on > 95% of UML • Focus on < 5% of UML that th t you d 't need don't d that th t you need d • Start with a 1000+ • Start with a subset pages UML Reference relevant to data • Avoid practical modeling examples • Seek practical guides • Use UML for all the and examples wrong reasons • Use UML to communicate and automate www.scispike.com Copyright © SciSpike 2011 7
  • 8. Modeling Data with UML Class Diagrams  A subset of UML Class Diagram is very close to notations used in d d data modeling d l  UML Class Diagrams have features not needed for data modeling: d l – Operations (methods) – Visibility (public, private, …)  We can use only a subset that make sense for data modeling: – Classes (aka "types") – Attributes – Associations – Generalization www.scispike.com Copyright © SciSpike 2011 8
  • 9. UML Classes and Attributes Class Similar to entity in ERD. Customer Class name Typically capitalized. Attribute Compartment The only compartment we care about.  UML classes can have other  compartments, e.g. for operations. It is fine to skip parts we don't need! pp Note: N t Attribute Name Attribute Type High level class  Typically  E.g. String, Integer,…  diagrams typically don't  lowercase.  but also other class names need primary and  foreign keys.  www.scispike.com Copyright © SciSpike 2011 9
  • 10. UML Associations Association Association Name Multiplicity Usually skipped. *: zero or many 1..*: one or many 0..1: zero or one Association Role Start from a class, follow the  Start from a class follow the Note: association, read the role of the  Foreign key attributes are  not needed associated objects. www.scispike.com Copyright © SciSpike 2011 10
  • 11. Navigability 1..* * Person Address homeAddress  High level diagrams typically do not show navigability  Navigability is a design decision! – It is a bad practice to assign navigability prematurely – Typically not needed for modeling when we target relational databases www.scispike.com Copyright © SciSpike 2011 11
  • 12. Associations vs. Attributes Person P Multiplicity M lti li it Company C employer: Company[*] p y p y[ ] employee: Person[1..*] p y [ ]  In UML, attributes and associations are equivalent!  Choose the representation that is more suitable to the reader  Important relationships are often represented as associations – they bring the visual emphasis www.scispike.com Copyright © SciSpike 2011 12
  • 13. Association Class Association  Class Cl  Association class allows to attach information to an association – Often refined into two associations to a class www.scispike.com Copyright © SciSpike 2011 13
  • 14. Association Class Refined  Association classes are commonly refined in lower level y diagrams www.scispike.com Copyright © SciSpike 2011 14
  • 15. Semantics of Aggregation and Composition 1 Car Engine Aggregation 1 Car Engine Composition  Aggregation: shortcut for "has" relationship has – Does not have a well defined semantics. Use sparingly!  Composition lifetime of the owner determines the lifetime Composition: of the owned objects – Similar to "cascading" cascading www.scispike.com Copyright © SciSpike 2011 15
  • 16. Generalization (aka Inheritance) Employee Generalization G li i Engineer Manager TechWriter  Subclasses extend superclasses with additional attributes and associations  This relationship eventually needs to be mapped to tables for relational database design – Several solutions possible with different performance impact. Choice impact depends on the typical pattern of usage. www.scispike.com Copyright © SciSpike 2011 16
  • 17. Constraints  Constraints can be expressed as: – Plain text – OCL: Object Constraint Language, part of UML • Not common in mainstream projects • Enforcable www.scispike.com Copyright © SciSpike 2011 17
  • 18. Organizing UML Models: Packages  A package is a structuring element Customer Management – It contains other elements and diagrams Sales  P k Packages are important i for managing complexity of models  Prefer models organized Inventory into packages to huge diagrams www.scispike.com Copyright © SciSpike 2011 18
  • 19. Mapping UML to ER Models…  Class  Entity – Add primary key  Simple Attribute Type  Column Type  Complex Attribute Type  Relationship to an entity for the attribute type  Association  Foreign Key relationships – Use role names for foreign keys – Many-to-many association  add an associative table – Aggregation: treat as ordinary relationships www.scispike.com Copyright © SciSpike 2011 19
  • 20. …Mapping UML to ER Models  Generalization: use the usual mappings: – Table per class hierarchy – Table per subclass – Table per concrete class  Constraints – Set constraints on the database – Some only enforceable in application logic y pp g This is just a simplified set of rules to get you going! www.scispike.com Copyright © SciSpike 2011 20
  • 21. UML for Database Design  Agile teams often use UML for both software and database design  UML data modeling profile introduces extensions to UML: – <<PK>>, <<FK>>, <<Auto Generated>>, <<Not Null>>, <<View>>, <<Stored Procedures>>,…  Use relational data types – String  CHAR(x), VARCHAR(x) www.scispike.com Copyright © SciSpike 2011 21
  • 22. Automation Code Transformer DDL Input Models Models Output  Tools can convert from UML to ERD and vice versa  Model transformation tools operate at a MOF/EMF level and can transform UML to various targets – Visual Domain Specific Languages (DSLs) based on UML may provide better alignment with the p g problem domain than vanilla UML www.scispike.com Copyright © SciSpike 2011 22
  • 23. Conclusion  You will need just a small part of UML!  UML is a common starting point for data models  Mapping of UML to ER is quite straightforward pp g q g  Knowing UML makes you a more significant player in the software development p p process www.scispike.com Copyright © SciSpike 2011 23
  • 24. Getting in Touch  Email: [email protected]  Blog: http://www.OnBuildingSoftware.com/  Twitter: http://twitter.com/OnSoftware p  LinkedIn: http://www.linkedin.com/in/VladimirBacvanski  SciSpike Training and Consulting: http://www.scispike.com http://www scispike com – Related training for data architects: • Visual Modeling with UML • Mastering Data Modeling with InfoSphere Data Architect www.scispike.com Copyright © SciSpike 2011 24