7M822 UML Profile for Databases 11 November 2010
7M822 Database A database is a collection of data. Databases can be stored in one or more files, or can be managed by a software system called Database Management System (DBMS)
7M822 What makes a database Add Data Delete Data Change Data Lookup or search for data Organize Data
7M822 Key Terminology Table Column Record Field Primary Key Foreign Key Index
7M822 Database Example (1) NameAdresNumberCourseGrade JoranVRT m8227 JoranVRT m7018 JoranVRT m7116 JanVRT m8228 JanVRT m7017 Grades
7M822 Database Example (2) NameAdresNumber JoranVRT JanVRT NumberCourseGrade m m m m m7017 Student Grade
7M822 Types of databases Flat databases Indexed databases DBMS based databases
7M822 DBMS Services Schemas Consistency checks Guarantee of no data corruption after crash Concurrent access for multiple readers and writers. Backup and recovery Authentication and access control Support for Structured Query Language (SQL)
7M822 DBMS Flavors From relational To object oriented
7M822 DBMS Systems Oracle Sybase Microsoft SQL Server MySQL
7M822 Jet Database Engine Database Engine of MS-Access Contained in an *.MDB or *.ACCDB File Accessed trough ADO or DAO Allows multiuser access Enforces referential integrity checks
7M822 UML Profiles Way to customize UML diagrams for your own needs. Stereotypes Tagged value Constraints Graphical representation
7M822 UML Profile Example
7M822 UML Profile for Database Design Rational Software Corporation For designing databases Uses tagged parameters and stereotypes Only a subset will be explained
7M822 Database Diagram Elements Table Column Primary key Foreign key Identifying relationship Non-identifying relationship
7M822 Database Diagram Elements (2) Table (stereotype >) Not used Primary key (stereotype >) Foreign key (stereotype >) Primary/Foreign key (stereotype >) Non-identifying relationship Identifying relationship
7M822 Example 1
7M822 Mapping Logical Design To Database Design Synchronization Classes > Tables Attributes > Columns Associations > Relations Normalization There are more ways to do it
7M822 Mapping Classes To Tables Map persisted classes to tables Many to many associations must be broken down to one to many associations using an association table.
7M822 Mapping Subtype Classes to Tables One table per class One table per concrete class One table per hierarchy
7M822 Mapping Attributes to Columns Map persistent attributes Dont map calculated attributes Can use Generic Types first, later use database specific types. Generic Types: Boolean, Currency, Date, Double, Integer, Long, Single, String
7M822 Example 2
7M822 Example 3 – Logical Diagram
7M822 Example 3 – Database Diagram
7M822 Microsoft Access Create and fill tables Execute database queries Build on the Jet Engine Visual Basic for Applications Forms and Reports IDE
7M822 Database Desktop Example (1)
7M822 Database Desktop Example (2) 0..1