Development Cycles
  Home arrow Development Cycles arrow Page 9 - Entity Relationship Modeling
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DEVELOPMENT CYCLES

Entity Relationship Modeling
By: Alf A. Pedersen
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 49
    2004-04-05

    Table of Contents:
  • Entity Relationship Modeling
  • The Entity
  • Other Business Contacts
  • Attributes in entities
  • Business Rules
  • Three types of relationships
  • Supplier Entity
  • A Weak Relation
  • A Useful Relation
  • Involuted (or recursive) relationships
  • Many-to-Many
  • The Database Analysis Team - A Teamwork
  • Level of Knowledge
  • Experience vs. Inexperience
  • Complete Model?
  • Building Queries
  • Other Common Errors in ER Modeling
  • Second Normal Violation
  • More Specific
  • Generic or Specific Models?
  • Analysts Experience

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Entity Relationship Modeling - A Useful Relation


    (Page 9 of 21 )


    This is a very useful relationship: It implies what we call an "intersection entity", which will give an entity holding all legal combinations of orders and customers. This many-to-many relationship is much used in an early stage of analysis to indicate just that. This is such a useful relationship that I will evaluate it now. We return to the model of business contact and contact type we had earlier:

    business contact

    The way this is constructed, it only allows for a business to exist once. If we want a customer also to be a supplier, he must get a new contact id, and all information must be re-entered. We can (partly) solve it by making the primary key a combination of contact id and contact type:

    business contacts

    Note the vertical bar on the crow’s foot: It indicates that the relationship is part of the primary key in contact id. This is one of the most common errors being made in ER modeling.

    This is a violation of the Second Normal Form. Name, telephone and entered date have nothing to do with contact type, only with business contact. We see that we are not able to properly represent the fact that a business contact may be a number of contact types. Here we can take full use of the many-to-many relationship capabilities:

    business contact

    This relationship says that a business contact MAY BE categorized as zero or more contact types, while a given contact type MAY BE a category for zero or more business contacts. This is total freedom. However, as stated earlier, we have no way of representing this in a physical database, and we have no way of taking care of all intersections in the ER model either, so we dissolve the relationship like this:

    entity relationship

    We may now read all rows in contact role to find out which roles a given business contact has towards our business.

    Do not be afraid to use this construction. In my experience, it will always add flexibility into the finished analysis result.

    More Development Cycles Articles
    More By Alf A. Pedersen


     

    DEVELOPMENT CYCLES ARTICLES

    - More Pattern Matching Algorithms: B-M
    - Pattern Matching Algorithms Demystified: KMP
    - Coding Standards
    - A Peek into the Future: Transactional Memory
    - Learning About the Graph Construct using Gam...
    - Learning About the Graph Construct using Gam...
    - Learning About the Graph Construct using Gam...
    - How to Strike a Match
    - Entity Relationship Modeling
    - Tame the Beast by Matching Similar Strings
    - 5 Web Design Tips You Can't Live Without
    - Practising Best Practises in Your Software D...
    - The Art of Modelling: Part 1
    - Thoughts on the Craft of Programming: Abstra...
    - Hi 5: Part 4







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway