UML object models can be mapped to relational databases by mapping classes to tables, attributes to columns, and associations as either buried foreign keys or separate tables. There are two approaches to mapping inheritance: using separate tables for each class or duplicating superclass columns in subclass tables. The tradeoff is between easier modification of the superclass versus faster queries.
Design patterns are optimized, reusable solutions to the programming problems that we encounter every day. A design pattern is not a class or a library that we can simply plug into our system; it's much more than that. It is a template that has to be implemented in the correct situation. It's not language-specific either. A good design pattern should be implementable in most—if not all—languages, depending on the capabilities of the language. Most importantly, any design pattern can be a double-edged sword— if implemented in the wrong place, it can be disastrous and create many problems for you. However, implemented in the right place, at the right time, it can be your savior.
EuGENia is a tool that automatically generates the .gmfgraph, .gmftool and .gmfmap models needed to implement a GMF editor from a single annotated Ecore metamodel. EuGENia provides high-level annotations that shield you from the complexity of GMF and lowers the entrance barrier for creating your first GMF editor. While EuGENia is very useful for getting started with GMF, it doesn't stop there and can be used all the way to the final polished version of your editor.
Software Design Patterns. Part I :: Structural PatternsSergey Aganezov
In a nutshell, software design patterns are generally reusable solutions to a commonly occurring problems. And this says it all! We are going to learn when it is completely unnecessary for you to reinvent the wheel, and what are the best ways to approach each particular problem during software development process.
Design patterns are known as best practices that the programmer can use to solve common problems when designing an application or system.
Singelton Design Pattern
Factory Design Pattern
Builder Design Pattern
Strategy Design Pattern
Iterator Design Pattern
Observer Design Pattern
Prototype Design Pattern
Command Design Pattern
Decorator Pattern
Proxy Pattern
Adapter Pattern
An introduction to structural design patterns in object orientation. Suitable for intermediate to advanced computing students and those studying software engineering.
Design patterns are optimized, reusable solutions to the programming problems that we encounter every day. A design pattern is not a class or a library that we can simply plug into our system; it's much more than that. It is a template that has to be implemented in the correct situation. It's not language-specific either. A good design pattern should be implementable in most—if not all—languages, depending on the capabilities of the language. Most importantly, any design pattern can be a double-edged sword— if implemented in the wrong place, it can be disastrous and create many problems for you. However, implemented in the right place, at the right time, it can be your savior.
EuGENia is a tool that automatically generates the .gmfgraph, .gmftool and .gmfmap models needed to implement a GMF editor from a single annotated Ecore metamodel. EuGENia provides high-level annotations that shield you from the complexity of GMF and lowers the entrance barrier for creating your first GMF editor. While EuGENia is very useful for getting started with GMF, it doesn't stop there and can be used all the way to the final polished version of your editor.
Software Design Patterns. Part I :: Structural PatternsSergey Aganezov
In a nutshell, software design patterns are generally reusable solutions to a commonly occurring problems. And this says it all! We are going to learn when it is completely unnecessary for you to reinvent the wheel, and what are the best ways to approach each particular problem during software development process.
Design patterns are known as best practices that the programmer can use to solve common problems when designing an application or system.
Singelton Design Pattern
Factory Design Pattern
Builder Design Pattern
Strategy Design Pattern
Iterator Design Pattern
Observer Design Pattern
Prototype Design Pattern
Command Design Pattern
Decorator Pattern
Proxy Pattern
Adapter Pattern
An introduction to structural design patterns in object orientation. Suitable for intermediate to advanced computing students and those studying software engineering.
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
Guest lecture at Informatics Institute of Technology (http://www.iit.ac.lk/) on 04th December 2015.
This lecture covered following UML 2.5 Diagrams: Use-Case, Activity, Class, Object, Sequence, State Machine.
I also showed some tools I have used: UMLet and Astah Community. Astah is the main tool I used when I was studying.
Then I focused on OOP Concepts, Software Design Principles and some Design Patterns.
I have included links to all related content in the 32nd slide.
Domains - Don't leave your data model without themPeter Heller
Presentation at the Data Modeling Zone (October2014).
They key to the presentation is that the domain is the fundamental building of reusable database objects.
It is built at the attribute level and bubbles up to the entity.
Also, it can be leveraged across a heterogeneous database environment.
It becomes a universal database concept with different target DDL.
The common denominator is the base ANSI SQL shared by your heterogeneous databases.
Note:
Prospectively, I would use inline SQL code the majority of the time for defaults and check constraints. There are rare exceptions where only a scalar functions will work and that is the only time that I would deviate from inline code.
Code That Writes Code : Automatic Programming for NHibernateDeepak Sahu
This white paper explores the power of automatic programming and its application on NHibernate Technology, allowing human-programmers to write their code on a higher level of abstraction ensuring homogenous and Error-Free code.
Tracking down redundant code and implementing a generic algorithm that generates such code is the Key factor in Automatic-Programming.
It takes sole discretion and independent judgement of the Developer to trace similar code-patterns in their application and making all efforts in reducing the overall Project-Development-Time by automating such process.
This PPT is intended to provide a thorough coverage of verilog HDL concepts based on fundamental principles of digital design. This is the basic fundamental concept for the programming of the digital electronics.
Introduction to HDLs: Overview of Digital Design with Verilog HDL, Basic Concepts, Data types, System tasks and Compiler Directives. Hierarchical modeling, concepts of modules and ports Gate level Modeling, Dataflow modeling-Continuous Assignments, Timing and Delays. Programming Language Interface
Design of Arithmetic Circuits using Gate level/ Data flow modeling –Adders, Subtractors, 4- bit Binary and BCD adders and 8-bit Comparators.
Verification: Functional verification, simulation types, Design of stimulus block.
Designing Optimized Symbols for InduSoft Web Studio ProjectsAVEVA
Because InduSoft Web Studio allows you to easily develop applications for mobile devices and embedded systems it’s easy to get lost in the rich feature set and develop symbols that are not optimized for the entire range of systems the application will be deployed to. In this webinar, we’d like to give InduSoft Web Studio users a guide to developing symbols that can be easily resized or easily optimized for deployment to mobile devices and embedded computers.
2. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2
Mapping an Object Model to a Database
• UML object models can be mapped to relational
databases:
• Some degradation occurs because all UML constructs
must be mapped to a single relational database
construct - the table
• Mapping of classes, attributes and associations
• Each class is mapped to a table
• Each class attribute is mapped onto a column in the
table
• An instance of a class represents a row in the table
• A many-to-many association is mapped into its own
table
• A one-to-many association is implemented as buried
foreign key
• Methods are not mapped.
3. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3
Mapping a Class to a Table
User
+firstName:String
+login:String
+email:String
id:long firstName:text[25] login:text[8] email:text[32]
User table
4. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4
Primary and Foreign Keys
• Any set of attributes that could be used to
uniquely identify any data record in a relational
table is called a candidate key
• The actual candidate key that is used in the
application to identify the records is called the
primary key
• The primary key of a table is a set of attributes whose
values uniquely identify the data records in the table
• A foreign key is an attribute (or a set of
attributes) that references the primary key of
another table.
5. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5
Example for Primary and Foreign Keys
User table
Candidate key
login email
“am384” “am384@mail.org”
“js289” “john@mail.de”
firstName
“alice”
“john”
“bd” “bobd@mail.ch”“bob”
Candidate key
Primary key
League table login
“am384”
“bd”
name
“tictactoeNovice”
“tictactoeExpert”
“js289”“chessNovice”
Foreign key referencing User table
6. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 6
Buried Association
LeagueLeagueOwner *1
id:long
LeagueOwner table
...
owner:long
League table
...id:long
• Associations with multiplicity “one” can be implemented
using a foreign key
For one-to-many associations we add the foreign key to the
table representing the class on the “many” end
For all other associations we can select either class at the end
of the association.
owner
7. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 7
Another Example for Buried Association
Transaction
transactionID
Portfolio
portfolioID
...
*
portfolioID ...
Portfolio TableTransaction Table
transactionID portfolioID
Foreign Key
8. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 8
Mapping Many-To-Many Associations
City
cityName
Airport
airportCode
airportName
* *Serves
cityName
Houston
Albany
Munich
Hamburg
City Table
airportCode
IAH
HOU
ALB
MUC
HAM
Airport Table
airportName
Intercontinental
Hobby
Albany County
Munich Airport
Hamburg Airport
cityName
Houston
Houston
Albany
Munich
Hamburg
Serves Table
airportCode
IAH
HOU
ALB
MUC
HAM
In this case we need a separate table for the association
Separate table for
the association “Serves”
Primary KeyPrimary Key
9. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 9
Another Many-to-Many Association
Mapping
PlayerTournament **
id
Tournament table
23
name ...
novice
24 expert
tournament player
TournamentPlayerAssociation
table
23 56
23 79
Player table
id
56
name ...
alice
79 john
We need the Tournament/Player association as a separate table
10. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 10
Realizing Inheritance
• Relational databases do not support inheritance
• Two possibilities to map an inheritance
association to a database schema
• With a separate table (”vertical mapping”)
• The attributes of the superclass and the subclasses
are mapped to different tables
• By duplicating columns (”horizontal mapping”)
• There is no table for the superclass
• Each subclass is mapped to a table containing the
attributes of the subclass and the attributes of the
superclass
11. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 11
Realizing inheritance with a separate table
(Vertical mapping)
User table
id
56
name ...
zoe
79 john
role
LeagueOwner
Player
Player
User
LeagueOwner
maxNumLeagues credits
name
Player table
id
79
credits ...
126
id
LeagueOwner table
56
maxNumLeagues ...
12
12. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 12
Realizing inheritance by duplicating
columns (Horizontal Mapping)
Player
User
LeagueOwner
maxNumLeagues credits
name
id
LeagueOwner table
56
maxNumLeagues ...
12
name
zoe
Player table
id
79
credits ...
126
name
john
13. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 13
Comparison: Separate Tables vs
Duplicated Columns
• The trade-off is between modifiability and
response time
• How likely is a change of the superclass?
• What are the performance requirements for queries?
• Separate table mapping (Vertical mapping)
We can add attributes to the superclass easily by
adding a column to the superclass table
Searching for the attributes of an object requires a join
operation.
• Duplicated columns (Horizontal Mapping)
Modifying the database schema is more complex and
error-prone
Individual objects are not fragmented across a number
of tables, resulting in faster queries
14. Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 14
Summary
• Four mapping concepts:
• Model transformation improves the compliance of the
object design model with a design goal
• Forward engineering improves the consistency of the
code with respect to the object design model
• Refactoring improves code readability/modifiability
• Reverse engineering discovers the design from the code.
• Model transformations and forward engineering
techniques:
• Optimizing the class model
• Mapping associations to collections
• Mapping contracts to exceptions
• Mapping class model to storage schemas.
Editor's Notes
Litte Primer on Database concepts, a repeat for those of you that have already taken databases.
Undisciplined change => degradation of system model