SlideShare une entreprise Scribd logo
1  sur  14
UsingUML,Patterns,andJava
Object-OrientedSoftwareEngineering Chapter 10,
Mapping Models to
Relational Schema
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.
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
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.
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
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
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
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
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
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
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
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
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
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.

Contenu connexe

Tendances

Design pattern
Design patternDesign pattern
Design patternOmar Isaid
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
 
Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)APU
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns pptmkruthika
 
Software Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSoftware Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSergey Aganezov
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsMichael Heron
 

Tendances (19)

Ch08lect1 ud
Ch08lect1 udCh08lect1 ud
Ch08lect1 ud
 
Ch03lect2 ud
Ch03lect2 udCh03lect2 ud
Ch03lect2 ud
 
Ch04lect1 ud
Ch04lect1 udCh04lect1 ud
Ch04lect1 ud
 
Ch05lect1 ud
Ch05lect1 udCh05lect1 ud
Ch05lect1 ud
 
Ch01lect1 ud
Ch01lect1 udCh01lect1 ud
Ch01lect1 ud
 
Ch06lect1 ud
Ch06lect1 udCh06lect1 ud
Ch06lect1 ud
 
Ch02lect1 ud
Ch02lect1 udCh02lect1 ud
Ch02lect1 ud
 
Design pattern
Design patternDesign pattern
Design pattern
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
 
Eugenia
EugeniaEugenia
Eugenia
 
Software Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural PatternsSoftware Design Patterns. Part I :: Structural Patterns
Software Design Patterns. Part I :: Structural Patterns
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Software design
Software designSoftware design
Software design
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design Patterns
 

En vedette

Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2Sisir Ghosh
 
Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2wahab13
 
Object Modeling with UML: Behavioral Modeling
Object Modeling with UML: Behavioral ModelingObject Modeling with UML: Behavioral Modeling
Object Modeling with UML: Behavioral Modelingelliando dias
 
Ch9-Software Engineering 9
Ch9-Software Engineering 9Ch9-Software Engineering 9
Ch9-Software Engineering 9Ian Sommerville
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
 
Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9Ian Sommerville
 
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...Ahmed Al-Senosy Ph.D(cand),MSc,PMP,RMP
 
Texture mapping
Texture mapping Texture mapping
Texture mapping wahab13
 
Object Oriented Software Engineering
Object Oriented Software EngineeringObject Oriented Software Engineering
Object Oriented Software EngineeringAli Haider
 

En vedette (15)

organization charts....rules
organization charts....rulesorganization charts....rules
organization charts....rules
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Ch11lect2 ud
Ch11lect2 udCh11lect2 ud
Ch11lect2 ud
 
ASP.NET System design 2
ASP.NET System design 2ASP.NET System design 2
ASP.NET System design 2
 
Ch05lect2 ud
Ch05lect2 udCh05lect2 ud
Ch05lect2 ud
 
Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2Abbott's Textual Analysis : Software Engineering 2
Abbott's Textual Analysis : Software Engineering 2
 
Object Modeling with UML: Behavioral Modeling
Object Modeling with UML: Behavioral ModelingObject Modeling with UML: Behavioral Modeling
Object Modeling with UML: Behavioral Modeling
 
Ch9-Software Engineering 9
Ch9-Software Engineering 9Ch9-Software Engineering 9
Ch9-Software Engineering 9
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
 
Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9
 
Ch7 implementation
Ch7 implementationCh7 implementation
Ch7 implementation
 
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...
final thisis 2016,Ahmed Alsenosy,BPCPM of applying PMI Module in construction...
 
Texture mapping
Texture mapping Texture mapping
Texture mapping
 
Object Oriented Software Engineering
Object Oriented Software EngineeringObject Oriented Software Engineering
Object Oriented Software Engineering
 
Ch6 architectural design
Ch6 architectural designCh6 architectural design
Ch6 architectural design
 

Similaire à Ch10lect2 ud

ch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentsch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentstalldesalegn
 
Domains - Don't leave your data model without them
Domains - Don't leave your data model without themDomains - Don't leave your data model without them
Domains - Don't leave your data model without themPeter Heller
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptL14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptAronBalais1
 
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptL14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptAxmedMaxamuud6
 
Code That Writes Code : Automatic Programming for NHibernate
Code That Writes Code : Automatic Programming for NHibernateCode That Writes Code : Automatic Programming for NHibernate
Code That Writes Code : Automatic Programming for NHibernateDeepak Sahu
 
python workshop(one of the 15 chapters)
python workshop(one of the 15 chapters)python workshop(one of the 15 chapters)
python workshop(one of the 15 chapters)Mehul shah
 
Digital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingDigital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingIndira Priyadarshini
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Saajid Akram
 
Designing Optimized Symbols for InduSoft Web Studio Projects
Designing Optimized Symbols for InduSoft Web Studio ProjectsDesigning Optimized Symbols for InduSoft Web Studio Projects
Designing Optimized Symbols for InduSoft Web Studio ProjectsAVEVA
 
Chapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptChapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptnaveenkumarkiot12
 

Similaire à Ch10lect2 ud (20)

ch02lect1.ppt
ch02lect1.pptch02lect1.ppt
ch02lect1.ppt
 
ch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all studentsch02lect1.ppt learning education for all students
ch02lect1.ppt learning education for all students
 
ch01lect1.ppt
ch01lect1.pptch01lect1.ppt
ch01lect1.ppt
 
Domains - Don't leave your data model without them
Domains - Don't leave your data model without themDomains - Don't leave your data model without them
Domains - Don't leave your data model without them
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptL14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
 
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.pptL14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
L14_DesignGoalsSubsystemDecompositionc_ch06lect1.ppt
 
Code That Writes Code : Automatic Programming for NHibernate
Code That Writes Code : Automatic Programming for NHibernateCode That Writes Code : Automatic Programming for NHibernate
Code That Writes Code : Automatic Programming for NHibernate
 
python workshop(one of the 15 chapters)
python workshop(one of the 15 chapters)python workshop(one of the 15 chapters)
python workshop(one of the 15 chapters)
 
34. uml
34. uml34. uml
34. uml
 
Designmethodology1
Designmethodology1Designmethodology1
Designmethodology1
 
Introduction to HDLs
Introduction to HDLsIntroduction to HDLs
Introduction to HDLs
 
Digital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow ModelingDigital System Design-Gatelevel and Dataflow Modeling
Digital System Design-Gatelevel and Dataflow Modeling
 
Oops lecture 1
Oops lecture 1Oops lecture 1
Oops lecture 1
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Game Studio
Game StudioGame Studio
Game Studio
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]
 
Designing Optimized Symbols for InduSoft Web Studio Projects
Designing Optimized Symbols for InduSoft Web Studio ProjectsDesigning Optimized Symbols for InduSoft Web Studio Projects
Designing Optimized Symbols for InduSoft Web Studio Projects
 
Chapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.pptChapter12 python object oriented concepts.ppt
Chapter12 python object oriented concepts.ppt
 

Ch10lect2 ud

  • 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.

Notes de l'éditeur

  1. Litte Primer on Database concepts, a repeat for those of you that have already taken databases.
  2. Undisciplined change => degradation of system model