Upload
opal-richard
View
230
Download
0
Embed Size (px)
Citation preview
1
Data Modeling : ER Model…
Lecture 07
2
Summary of last lecture•ER model notation•Examples•Ternary relationship•Weak entities
•Extended ER Model•Process Modeling
3
EXTENDED E-R MODEL•extensions to capture more meaning•concepts of generalization, aggregation and sub-set hierarchies added• Similar to OO concepts : inheritance,
composite objects
4
Generalization•to generalize from two or more entity sets and factor out commonality
•Example : given two entities Faculty and Non-faculty, we can define a ‘general’ entity called Employee
•Common attributes are factored out to define ‘Employee’ entity; specific (non-common) attributes incorporated in ‘Faculty’ and ‘Non-faculty’ entities
•represented by IS-A relationship
5
6
Another example :
7
Specialization•also called subset hierarchy; we created
special cases for a given entity. - Teacher a specific case of Employee - Employee called superset, Teacher called
subset•entity E1 is subset of E if every instance of E1
is also an instance of E; this is also IS-A relationship
•E called superset and E1 as subset (or sub-class); E may have multiple and possibly over-lapping subsets
•every instance in E need not be present in subsets of E
8
Specialization…..•specialization allows classification of an entity in subsets based on some distinguishing attribute/property
•we may have several specialization of same entity
•the subsets may have additional attributes
9
10
Inheritance•there is inheritance of attributes from superclass or superset
•the subclass/subset automatically inherits attributes defined at superclass/superset level
•thus, inheritance present in both Generalization and specialization• Direction important : bottom-up in
generalization, top-down in Specialization
• Important to distinguish the two cases
11
Aggregation•for building complex entity from existing entities (or existing entities and relationships)
•two ways of defining complex entities : • create an attribute whose value is
another entity• define an entity as containing a group of
related entities
12
Examples :•Work-order object (entity) defined as consisting of entities Raw-material, Tools and Workers;
•Work-order itself related with Customer entity
•Aggregation notation not explicitly provided in Extended E-R model
13
Raw Material Tools
Worker
Customer
JobNo Quantity
Work-order
14
Summary•Data Modeling important to understand
data to be handled in a given application.•We develop a conceptual Model first.•ER model uses concepts of Entity,
Relationship and Attribute.•Provides Constraints: primary key,
cardinality….•Simple to use diagramming notation•User cam understand and validate our
model
15
Process Modeling
16
Outline
•Process decomposition diagrams•Data flow diagram (DFD)
17
Process Model•A process is a business activity which when executed produces certain outputs from given inputs
•The function(s) performed by a process may be complex, with multiple inputs, outputs and users
•The entire application itself is a process
•We use successive decomposition into sub processes to reveal greater details of the processing
18
Function Decomposition•Decomposition splits wok of a task into subtasks; subtasks together make-up the parent task; not like ‘calling’ a module
•Balanced decomposition: sub-tasks are roughly equal in complexity
19
Function Decomposition …•Top-down decomposition gives hierarchical structure
•Decompose into 2 or more; not more than 5
•A high cohesion (high independence) and minimum coupling (minimum interdependence) are fundamental criteria
•Continue decomposition until elementary processes are identified
20
Function Decomposition•Elementary process is a smallest unit of activity meaningful to end user (it sees and leaves data in consistent state)
•Process decomposition diagram• A tree structure• Elementary processes are leaf nodes• Data are not shown
21
FD Diagrams: Examples
22
FD Diagrams: Examples
23
•Exercise: prepare FDDs for• Railway reservation system• Hospital patient management• Employee payroll
24
Function Decomposition …•Use proper naming of processes•Business functions named as nouns (marketing, Inventory control, …)
•Process name consists of an active verb and an object (accept order, calculate interest, …)
25
Naming …•Avoid long names (sentences containing and, if, then, etc. indicate non-cohesive complex tasks)
•Real world is a good reference for selecting proper names; organizational units are organized functionally and each unit has a well-defined task