Towards Design Entity Relationship Models - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Towards Design Entity Relationship Models

Description:

Navigability. Arrow-head means the association can be followed in the direction shown. In implementation view, navigability requires attributes to hold the link(s) to ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 18
Provided by: NESCtrai8
Category:

less

Transcript and Presenter's Notes

Title: Towards Design Entity Relationship Models


1
Towards Design Entity / Relationship Models
  • Richard Hopkins
  • rph_at_nesc.ac.uk
  • UML for Use Cases
  • NeSC, Edinburgh, Jan 5/6 2006

2
Contents
  • Goal
  • An appreciation of how UML class diagrams can be
    used to elucidate technical detail
  • Contents
  • Internal vs External class diagrams
  • Details of class diagrams
  • Practical

3
Development Process
Partially articulated requirements
to elucidate requirements what entities exist
and how each behaves
Capture Requirements
Use Case Diag.
Requirements
Construct Model of Overall system
Class Diag.
Structure

Behaviour
  • Requirements level Class Diagram externally
    visible entities
  • Design level Class Diagram model of external
    entities internal entities gt OO design

4
Internal vs External
User
Item
Is part of
contains
has out
Is copy of
Student
Staff Member
Journal
Copy
Article
Book
has out
Ordered print-off
of
to
User
Loan
Lendable
for
Student
Staff
Copy
Journal
print-off order
in
of
Book
Article
of
  • Similarities used external classes as starting
    point differences, e.g.
  • A lendable entity is may be a more useful
    abstraction than Item greater commonality
  • but need additional constraints for
    User-to-Loan

5
Internal vs External
User
Item
Is part of
contains
has out
Is copy of
Student
Staff Member
Journal
Copy
Article
Book
has out
Ordered print-off
of
to
User
Loan
Lendable
for
Student
Staff
Copy
Journal
print-off order
in
of
Book
Article
of
  • Similarities used external classes as starting
    point differences, e.g.
  • Relationship entities need information about
    the relationship
  • when the loan is to be returned
  • In this case, 1N, could put that info with the
    Copy

6
Internal Entities
  • Introduce Modelling of required internal state

need to keep track of fines what for how much
paid
Overdue
Damage
Loss
of
to
User
Loan
Lendable
for
Student
Staff
Copy
Journal
print-off order
in
of
Book
Article
of
7
Contents
  • Goal
  • An appreciation of how UML class diagrams can be
    used to elucidate techniocal detail
  • Contents
  • Internal vs External class diagrams
  • Details of class diagrams
  • Practical

8
Aggregation and Composition
Journal
Article
Author
composition
general aggregation
  • Special Associations
  • Aggregation To model a collection of things
  • Journal has a collection of Articles
  • Article has a collection of Authors
  • Composition
  • A special case of aggregation ownership /
    component
  • An article is a component of a journal
  • Part can only belong to one whole
  • The part cannot exist without the whole
  • Role name - Not given explicitly implicit in
    the end-point is part of
  • Multiplicity by default (1) --- (0..)

9
Multiplicity
1..
0..
Overdue
Damage
Loss
1
1
1
1
1
1
User
Loan
Lendable
1
1
Student
Staff
Copy
Journal
print-off order
0..
Book
Article
1..
  • Compactly communicates a lot of
    properties/assumptions one picture of whole
    design
  • A payment can relate to several fines
  • An article cant be in more than one Journal
    (issue)
  • .
  • Can be very useful as reality check on
    requirements with user
  • Can daunting notation for user may be better to
    extract all assumptions made!

10
Attributes
Copy
Book
ShelfMark Int
Title String
of
IsCopyOf Book
Title String
  • Attribute Information associated with each
    instance of class
  • Each attribute will have a type (could be
    omitted)
  • Attributes are inherited Title would be
    attribute of book, not Copy
  • Show Whats important for understanding
  • Maybe not all that exists in implementation
  • Dont show IsCopyof attribute because duplicates
    Of association
  • Could put in virtual information
  • Title for copy even though only held for Book - ?

11
Specialised Class vs Attribute
Vs.
Book
Book
hardBack bool
HardBackBook
SoftBackBook
  • Use specialised class if a significant difference
    to user,
  • e.g. hardBack has a reBind operation, but
    softBack doesnt

12
Navigability
Is copy of
of
Copy
Copy
Book
Book
One-way from copy to the Book it is a copy of
Two-way Also - From a Book to any of its copies
  • Arrow-head means the association can be followed
    in the direction shown
  • In implementation view, navigability requires
    attributes to hold the link(s) to associated
    object(s)
  • In VP-UML default is no navigability signs
  • either both un-specified or both navigable

13
Complex Class Structures
Class Diagram
0..
Book
1
by
0..
1..
0..
contains
Author
Division
1
by
1..
0..
Part
Chapter
  • The intended structure would be elucidated by
    giving some examples !
  • Particularly if audience is not familiar with
    this particular view on the possible structure of
    book
  • So illustrate the class diagram by one or more
    instance diagrams

14
Object Diagrams
Class Diagram
0..
Book
1
by
  • An Instance diagram
  • Does not show full range of possibilities
  • The lines are links instances of associations
  • Can annotate links with navigability and role if
    useful

0..
1..
0..
contains
Author
Division
1
by
1..
0..
Part
Chapter
Object Diagram
P11 Part Title UML
P12 Part Title WSDL
15
Questions ?
  • Can we express/derive full OO design from UML?
  • Yes
  • Additional features
  • operations
  • using UML-defined classes as attribute types
  • visibility
  • interfaces
  • .
  • ?????

16
Contents
  • Goal
  • An appreciation of how UML class diagrams can be
    used to elucidate techniocal detail
  • Contents
  • Internal vs External class diagrams
  • Details of class diagrams
  • Practical

17
Practical Entity/ Relationship Model
  • Clarifying technical detail 1 hour
  • One group member plays role of software developer
  • draft a class diagram for the design the system
    you have been working on
  • quickly!
  • could be two developers for 4-person group
  • Others play role of clients
  • with the developer discuss and evolve the
    detail
  • The point is to explore the potential of these
    diagrams as communication tool
  • Not to come up with the ideal design
Write a Comment
User Comments (0)
About PowerShow.com