ERD Hoffer
Transcript of ERD Hoffer
-
8/12/2019 ERD Hoffer
1/54
Modern Systems Analysisand DesignFourth Edition
Jeffrey A. HofferJoey F. George
Joseph S. Valacich
2005 by Prentice Hall 2005 by Prentice Hall
ap erStructuring System Data
Requirements
-
8/12/2019 ERD Hoffer
2/54
Learning ObjectivesDefine key data modeling terms.Draw entity-relationship (E-R) and class diagrams torepresent common business situations.Explain the role of conceptual data modeling in IS
2005 by Prentice Hall 2005 by Prentice Hall9-2
ana ys s an es gn.Distinguish between unary, binary, and ternaryrelationships.Define four types of business rules.
Compare the capabilities of class diagrams vs. E-Rdiagrams.Relate data modeling to process and logic modeling.
-
8/12/2019 ERD Hoffer
3/54
2005 by Prentice Hall 2005 by Prentice Hall9-3
-
8/12/2019 ERD Hoffer
4/54
2005 by Prentice Hall 2005 by Prentice Hall9-4
-
8/12/2019 ERD Hoffer
5/54
Conceptual Data Modeling
A detailed model that captures theoverall structure of data in anorganization
2005 by Prentice Hall 2005 by Prentice Hall9-5
Independent of any databasemanagement system (DBMS) or otherimplementation considerations
-
8/12/2019 ERD Hoffer
6/54
Process of Conceptual DataModeling
Develop a data model for the current systemDevelop a new conceptual data model thatincludes all requirements of the new system
2005 by Prentice Hall 2005 by Prentice Hall9-6
In the design stage, the conceptual datamodel is translated into a physical designProject repository links all design and data
modeling steps performed during SDLC
-
8/12/2019 ERD Hoffer
7/54
Deliverables and OutcomePrimary deliverable is an entity-relationship(E-R) diagram or class diagramAs many as 4 E-R or class diagrams areproduced and analyzed
2005 by Prentice Hall 2005 by Prentice Hall9-7
-projects applicationE-R diagram for the application being replacedE-R diagram for the whole database from whichthe new applications data are extractedE-R diagram for the whole database from whichdata for the application system being replaced isdrawn
-
8/12/2019 ERD Hoffer
8/54
Deliverables and Outcome (cont.)
Second deliverable is a set of entries aboutdata objects to be stored in repository orproject dictionary.
2005 by Prentice Hall 2005 by Prentice Hall9-8
epos ory n s a a, process, an og c mo e sof an information system.Data elements included in the DFD must appear inthe data model and vice versa.
Each data store in a process model must relate tobusiness objects represented in the data model.
-
8/12/2019 ERD Hoffer
9/54
2005 by Prentice Hall 2005 by Prentice Hall9-9
-
8/12/2019 ERD Hoffer
10/54
Gathering Information forConceptual Data Modeling
Two perspectivesTop-down
Data model is derived from an intimate
2005 by Prentice Hall 2005 by Prentice Hall9-10
understanding of the business.Bottom-up
Data model is derived by reviewing
specifications and business documents.
-
8/12/2019 ERD Hoffer
11/54
Requirements DeterminationQuestions for Data ModelingWhat are subjects/objects of the business?
Data entities and descriptionsWhat unique characteristics distinguish betweensubjects/objects of the same type?
2005 by Prentice Hall 2005 by Prentice Hall9-11
Primary keysWhat characteristics describe each subject/object?
Attributes and secondary keys
How do you use the data?Security controls and user access privileges
-
8/12/2019 ERD Hoffer
12/54
Requirements DeterminationQuestions for Data Modeling (cont.)
Over what period of time are you interested in the
data?Cardinality and time dimensionsAre all instances of each object the same?
2005 by Prentice Hall 2005 by Prentice Hall9-12
, ,What events occur that imply associations betweenobjects?
Relationships and cardinalities
Are there special circumstances that affect the wayevents are handled?Integrity rules, cardinalities, time dimensions
-
8/12/2019 ERD Hoffer
13/54
Introduction to Entity-Relationship (E-R) Modeling
Entity-Relationship (E-R) DiagramA detailed, logical representation of theentities, associations and data elements for
2005 by Prentice Hall 2005 by Prentice Hall9-13
an organization or businessNotation uses three main constructs
Data entitiesRelationshipsAttributes
-
8/12/2019 ERD Hoffer
14/54
Association
between theinstances of one ormore entity types
2005 by Prentice Hall 2005 by Prentice Hall9-14
Person, place, object,event or concept aboutwhich data is to bemaintained
Entity type : collection ofentities with commoncharacteristicsEntity instance : single
entity
named property orcharacteristic of anentity
-
8/12/2019 ERD Hoffer
15/54
Identifier Attributes
Candidate keyAttribute (or combination of attributes) thatuniquely identifies each instance of an
2005 by Prentice Hall 2005 by Prentice Hall9-15
entity typeIdentifier
A candidate key that has been selected asthe unique identifying characteristic for anentity type
-
8/12/2019 ERD Hoffer
16/54
Identifier Attributes(cont.)
Selection rules for an identifier1. Choose a candidate key that will not
change its value.
2005 by Prentice Hall 2005 by Prentice Hall9-16
2. Choose a candidate key that will never benull.
3. Avoid using intelligent keys.
4. Consider substituting single valuesurrogate keys for large composite keys.
-
8/12/2019 ERD Hoffer
17/54
Multivalued Attributes
An attribute that may take on more thanone value for each entity instanceRe resented on E-R Dia ram in two
2005 by Prentice Hall 2005 by Prentice Hall9-17
ways:
double-lined ellipseweak entity
-
8/12/2019 ERD Hoffer
18/54
Entity and Attribute Example
Simple attributes
2005 by Prentice Hall 2005 by Prentice Hall9-18
Identifier attributeeach employee hasa unique ID.
Multivalued attributean employee may havemore than one skill.
-
8/12/2019 ERD Hoffer
19/54
Degree of RelationshipDegree: number of entity types that participate in a
relationshipThree casesUnary: between two instances of one entity type
2005 by Prentice Hall 2005 by Prentice Hall9-19
Ternary: among the instances of three entity types
-
8/12/2019 ERD Hoffer
20/54
2005 by Prentice Hall 2005 by Prentice Hall9-20
-
8/12/2019 ERD Hoffer
21/54
CardinalityThe number of instances of entity B that can or must
be associated with each instance of entity AMinimum CardinalityThe minimum number of instances of entity B that may beassociated with each instance of entity A
2005 by Prentice Hall 2005 by Prentice Hall9-21
Maximum CardinalityThe maximum number of instances of entity B that may beassociated with each instance of entity A
Mandatory vs. Optional Cardinalities
Specifies whether an instance must exist or can be absent inthe relationship
-
8/12/2019 ERD Hoffer
22/54
Cardinality Symbols
2005 by Prentice Hall 2005 by Prentice Hall9-22
-
8/12/2019 ERD Hoffer
23/54
Unary Relationship Example
2005 by Prentice Hall 2005 by Prentice Hall9-23
-
8/12/2019 ERD Hoffer
24/54
Binary Relationship Examples
2005 by Prentice Hall 2005 by Prentice Hall9-24
-
8/12/2019 ERD Hoffer
25/54
Associative EntitiesAn entity type that associates the instances ofone or more entity types and containsattributes that are peculiar to the relationshipbetween those entit instances
2005 by Prentice Hall 2005 by Prentice Hall9-25
An associative entity is:An entityA relationship
This is the preferred way of illustrating arelationship with attributes
-
8/12/2019 ERD Hoffer
26/54
A relationship with an attribute
2005 by Prentice Hall 2005 by Prentice Hall9-26
as an associative entity
-
8/12/2019 ERD Hoffer
27/54
Ternary relationship
2005 by Prentice Hall 2005 by Prentice Hall9-27
as an associative entity
-
8/12/2019 ERD Hoffer
28/54
A relationshipthat itself isrelated toother entities
2005 by Prentice Hall 2005 by Prentice Hall9-28
relationshipmust berepresentedas anassociativeentity.
-
8/12/2019 ERD Hoffer
29/54
Supertypes and Subtypes
Subtype: a subrouping of the entities inan entity type that shares commonattributes or relationships distinct from
2005 by Prentice Hall 2005 by Prentice Hall9-29
other subtypesSupertype: a generic entity type thathas a relationship with one or moresubtype
-
8/12/2019 ERD Hoffer
30/54
Rules for Supertype/SubtypesRelationships
Total specialization: an entity instance of thesupertype must be an instance of one of thesubtypesPartial specialization: an entity instance of the
2005 by Prentice Hall 2005 by Prentice Hall9-30
supertype may or may not e an nstance oone of the subtypesDisjoint: an entity instance of the supertypecan be an instance of only one subtype
Overlap: an entity instance of the supertypemay be an instance of multiple subtypes
-
8/12/2019 ERD Hoffer
31/54
2005 by Prentice Hall 2005 by Prentice Hall9-31
-
8/12/2019 ERD Hoffer
32/54
Business RulesSpecifications that preserve the integrity ofthe logical data modelFour types
2005 by Prentice Hall 2005 by Prentice Hall9-32
Entity integrity: unique, non-null identifiersReferential integrity constraints: rules governingrelationshipsDomains: valid values for attributesTriggering operations: other business rulesregarding attribute values
-
8/12/2019 ERD Hoffer
33/54
Domains
The set of all data types and ranges ofvalues that an attribute can assumeSeveral advantages
2005 by Prentice Hall 2005 by Prentice Hall9-33
1. Verify that the values for an attribute arevalid2. Ensure that various data manipulation
operations are logical3. Help conserve effort in describing
attribute characteristics
-
8/12/2019 ERD Hoffer
34/54
Triggering OperationsAn assertion or rule that governs the validity of data
manipulation operations such as insert, update anddeleteComponents:
2005 by Prentice Hall 2005 by Prentice Hall9-34
the triggerEvent: data manipulation operation that initiates theoperationEntity Name: name of entity being accessed or modifiedCondition: condition that causes the operation to betriggeredAction: action taken when the operation is triggered
-
8/12/2019 ERD Hoffer
35/54
2005 by Prentice Hall 2005 by Prentice Hall9-35
-
8/12/2019 ERD Hoffer
36/54
Packaged Data ModelsGeneric data models that can beapplied and modified for an organizationTwo categories
2005 by Prentice Hall 2005 by Prentice Hall9-36
UniversalIndustry-specificBenefits
Reduced implementation time and costHigh-quality modeling
-
8/12/2019 ERD Hoffer
37/54
Packaged data modelsprovide generic models
2005 by Prentice Hall 2005 by Prentice Hall9-37
a can e cus om zefor a particularorganizations businessrules
-
8/12/2019 ERD Hoffer
38/54
Object Modeling Using ClassDiagrams
Object-oriented approachBased on Unified Modeling Language(UML)
2005 by Prentice Hall 2005 by Prentice Hall9-38
FeaturesObjects and classesEncapsulation of attributes and operations
PolymorphismInheritance
-
8/12/2019 ERD Hoffer
39/54
ObjectsObject: an entity with a well-defined rolein an applicationEach object has:
2005 by Prentice Hall 2005 by Prentice Hall9-39
,values, and relationships of an objectBehavior: represents how an object actsand reacts
Identity: uniqueness, no two objects arethe same
-
8/12/2019 ERD Hoffer
40/54
Classes
Class: a logical grouping of objects withsimilar attributes and behaviorsO eration: a function or service
2005 by Prentice Hall 2005 by Prentice Hall9-40
provided by all instances of a classEncapsulation: the technique of hidinginternal implementation details of anobject from external view
-
8/12/2019 ERD Hoffer
41/54
Class DiagramA diagram showing the static structure
of an object-oriented model
2005 by Prentice Hall 2005 by Prentice Hall9-41
UML classes areanalogous to E-R entities
-
8/12/2019 ERD Hoffer
42/54
Types of OperationsConstructor
Creates a new instance of a classQuery
2005 by Prentice Hall 2005 by Prentice Hall9-42
UpdateAlters the state of an object
ScopeApplies to a full class rather than anindividual instance
-
8/12/2019 ERD Hoffer
43/54
Representing Associations
Association: a relationship amonginstances of object classesAssociation role: the end of an
2005 by Prentice Hall 2005 by Prentice Hall9-43
association where it connects to a classMultiplicity: indicates how many objectsparticipate in a give relationship
-
8/12/2019 ERD Hoffer
44/54
UML associationsare analogous toE-R relationships.
2005 by Prentice Hall 2005 by Prentice Hall9-44
mu t p c t esare analogous toE-R cardinalities.
-
8/12/2019 ERD Hoffer
45/54
rolesmultiplicities
2005 by Prentice Hall 2005 by Prentice Hall9-45
Multiplicity notation:0..10 means minimum of 0 and maximum of 101, 2 means can be either 1 or 2* means any number
-
8/12/2019 ERD Hoffer
46/54
Association ClassAn association with its own attributes,operations, or relationships
UML
2005 by Prentice Hall 2005 by Prentice Hall9-46
associationclasses areanalogousto E-Rassociative
entities.
D i d A ib A i i
-
8/12/2019 ERD Hoffer
47/54
Derived Attributes, Associations,and Roles
Derived attributes are calculated
based on other attributes
2005 by Prentice Hall 2005 by Prentice Hall9-47
Derived items are represented with a slash (/).
-
8/12/2019 ERD Hoffer
48/54
Generalization
Superclass-subclass relationshipsSubclass inherits attributes, operations,and associations of the su erclass
2005 by Prentice Hall 2005 by Prentice Hall9-48
Types of superclassesAbstract: cannot have any direct instancesConcrete: can have direct instances
-
8/12/2019 ERD Hoffer
49/54
2005 by Prentice Hall 2005 by Prentice Hall9-49
Generalization and inheritance implemented viasuperclass/subclasses in UML,supertypes/subtypes in E-R
-
8/12/2019 ERD Hoffer
50/54
Polymorphic OperationsThe same operation may apply to two ormore classes in different waysAbstract operations
2005 by Prentice Hall 2005 by Prentice Hall9-50
defined in abstract classesdefined the protocol, but not theimplementation of an operation
Methodsthe implementation of an operation
-
8/12/2019 ERD Hoffer
51/54
Abstraction:Student is an abstract class and calc-
2005 by Prentice Hall 2005 by Prentice Hall9-51
Polymorphism:Here, each type of student hasits own version of calc-tuition()
Class scope:tuitionPerCred is a class-wide attribute
-
8/12/2019 ERD Hoffer
52/54
Aggregation and CompositionAggregation
A part-of relationship between acomponent and an aggregate object
2005 by Prentice Hall 2005 by Prentice Hall9-52
CompositionAn aggregation in which the part objectbelongs to only one aggregate object and
lives and dies with the aggregate object
-
8/12/2019 ERD Hoffer
53/54
Aggregation is represented withopen diamonds
2005 by Prentice Hall 2005 by Prentice Hall9-53
Composition is represented withfilled diamonds
-
8/12/2019 ERD Hoffer
54/54
SummaryIn this chapter you learned how to:
Define key data modeling terms.Draw entity-relationship (E-R) and class diagramsto represent common business situations.
2005 by Prentice Hall 2005 by Prentice Hall9-54
analysis and design.Distinguish between unary, binary, and ternaryrelationships.Define four types of business rules.
Compare the capabilities of class diagrams vs. E-R diagrams.Relate data modeling to process and logicmodeling.