- Presentation Layer
- Application Layer
- Data Layer
DB lies the third, lowest layer in the architecture.
- Requirements Collection & analysis phase
- Conceptual Design (ERD's)
- Logical Design (Mapping)
- Physical Design
two types of requirements
- Functional
- Data - Employee number, address, name, etc.
here is the the EERD for nansoft EP management system
- there are 4 main entities
- Person
- Customer, which is specification of Person
- Employee, which is specification of Person
- Project
- Person has composite attribute: name
- primary key for customer is customer_id
- primary key for Customer is customer_id
- primary key for Employee is ssn
- primary key for Project is project_id
- Project has a multi valued attribute project type
- Customer and Employee are specification of Person with total & disjoint constraints
- Employee,Project:n:m relationship
- One Employee can work on 0 or many projects ( o or many symbol on the Project side )
- One Project can have 0 or many Employee ( o or many symbol on the Employee side )
- Customer,Project:1:m relationship
- One Customer can own on 1 or many projects ( 1 or many symbol on the Project side )
- One Project can have only one customer ( one and only one symbol on the Customer side )
- Employee has a recursive relationship for leadership :1:n
- Dependent is a week entity which is related with Employee
Note: There are 2 types of constraints: Completeness (total/partial) and Overlap/Disjoint
-
map strong entities
map strong entities with attributeswe need to discard multi value and derived attributes in ths phase.
- map week entities
week entities will be given a separate relation with partial key of week entity and primary key of strong entity being the new primary key of the relation
- map 1:1 relationships
Choose one of the relations and include its primary key as foreign key of the other relation. It is better to choose an entity type with total participation to add foreign key field. since this example has no 1:1 relationships, we will look at a different example.
- map 1:n relationships
the primary key of one side relation will be used in the many side as a foreign key. Also relationships attributes will go to the many side.
- map n:m relationships
a separate relation will be used. The new PK will be two primary keys.
- map multi valued attributes
a separate relation will be used. The new PK will be the primary keys of entity and the attribute itself.
- map n-nary relationships
Just like n:m mapping relationships we take a separate relation. The new PK will be n PKs of the strong entities. Any relationship attributes will also be in the relation.
- map specification and generalization
There are 4 ways to map inheritance in EER Diagrams.
- Option 1 - (total/partial, disjoint/overlap)
Have a super class relation with all the super class attributes. And for each subclass a relation which includes the primary key of the super class and the attributes of the subclass.
Note: This is the most flexible option because it suits any type and support the requirement changes in future.
- Option 2 - (total)
In our case this can be applied. But it won't cope with the changes to the total constraint in the future. In this option there will be no superclass relation because any type will belong to either one of subclasses. So all the attributes in superclass will be present in each subclass.
- Option 3 - (disjoint)
Only one relation. There will be a extra attribute to represent which subclass the record belongs to.This is suitable for both total and partial as long as it's disjoint.
- Option 4 - (overlap)
Only one relation. There will be flags (boolean attribute) for each subclass type to represent which subclass the record belongs to.This is suitable for both total and partial as long as it's a overlap. If there a disjoints there will be null values.
- Option 1 - (total/partial, disjoint/overlap)
- map union types