Upload
rolf-carpenter
View
220
Download
0
Embed Size (px)
DESCRIPTION
Dr. Andy Seddon Staffordshire UNIVERSITY School of Computing What is an entity? An entity is a ‘thing’ which can be distinctly identified some distinct identifiable thing for which the system must store data in order to perform its fundamental activities
Citation preview
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Information Modelling
andthe logical data structure
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Information Modelling
What is an entity? What do we mean by relationship? Why model the data in a system? What is a logical data structure? LDS notation
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
What is an entity?
An entity is
a ‘thing’ which can be distinctly identified
some distinct identifiable thing for whichthe system must store data in order to
perform its fundamental activities
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Attributes of an entity
An entity (or object) will have certain features that can take different values. These features are called attributes.
An attribute isan elementary data element that describesan object or a fact about an object
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Entity examples
Entities can be described by:customer = customer number + customer name + customer addressperson = name + addr + NI# + occupation +
DOB + height etc...Orcustomer (customer number,
customer name, customer address)
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Entity guidelines
Entity names should be a noun or noun phrase
Names should represent the role or classification of the thing
Uniquely identifiable occurrences Entities must have attributes Should be of interest to the business
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Identifying entity occurrences (1)
A means to identifiy one entity occurrence from another is needed.A candidate key is
an attribute, or set of attributes, of anentity which uniquely identifies a single
occurrence from all others
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Identifying entity occurrences (2)
A primary key is
A alternate key is
the particular candidate key chosen toidentify a single entry
a candidate key not chosen to be the primary key
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
What do we mean by relationship?
A relationship represents a set of connections
between objects represents an association between
objects in the real world is an association between two (or
more) entities
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Relationship guidelines
Occurrences of a relationship created when events occur
Regard as a sentence with place holders<lecturer> works in <department>
Use active rather than passive namesreports to rather than is reported to
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Why model data in a system?
The information model describes the information required to support the system
It helps to organise information and define what it means
Examplesattendee namepublic course and coursefull course
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
The information model (1)
Carefully organised and defined info helps info to be understood avoids redundancy ensures correctness, validity and
completeness
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
The information model (2)
The information model concerns: entities - categories of things that
information describes relationships - associations
between entities attributes - qualities or properties
of entities
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Information example
Given the following statement of purpose of a system determine the entities, relationships between them and the attributes required.
Trent College requires a new student record system to be set up. It must be able to show who is on which course and in which department it is run. It should hold student information for mail shots etc.
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
What is a logical data structure (LDS)?
An LDS is a graphical representation which
It is a semantic modelling tool which helps to clarify concept
highlights important categories ofinformation (entities) and relevant
associations between them (relationships)
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
The LDS
Used to identify and organise information used by the system (not just stored)
A B
C
XY
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
LDS notation (1)
The entity
The relationship
Lecturer Course
teaches
taught by
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
LDS notation (2)
Connecting entities via relatioshipsLecturer Course
teaches
taught by
Project Partuses
used by
SupplierSupplies
Supplied by
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Cardinality of a relationship
1:1
1:N
M:N
Lecturer Courseteaches
taught by
Lecturer Courseteaches
taught by
Lecturer Courseteaches
taught by
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Participation in a relationship
Office Employeeoccupied by
occupies
Office Employeeoccupied by
occupies
Office Employeeoccupied by
occupies
Office Employeeoccupied by
occupies
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Recursive relationships
A relationship from one entity type to itselfEg, Employees may be managers too
May also be 1:1, or M:N
Employeemanaged
by
manages
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Sub-types/Supertypes
Treatment
In Patient
Patient
Out PatientDoctor
Out-patientTreatment
Out-patientDepartmentBed
providesprovidedby
given to
given
given to
givengiven by
gives
occupies
occupied by
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
LDS construction guidelines
Define the area for analysis Determine entities and attributes Determine key attributes of entities Add remaining attributes to entities Determine the relationships between the
entities Examine events and operations of system
to ensure that the model supports them
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Data dictionary entries
Entities Definition of its role Attributes that describe itRelationships Reference to entities involved Cardinality/Optionality
Dr. Andy Seddon
StaffordshireUNIVERSITY
Schoolof
Computing
Summary
Entities Attributes Relationships Logical data structure Cardinality of relationships Participation of relationships Data dictionary