Professional Documents
Culture Documents
Information Modelling
Information Modelling
Information Modelling
MODELLING
E R DIAGRAMS
WHERE CAN WE AGREE?
Heterogeneity hinders the development of enterprise systems (Including
Distributed One)
There will not be consensus on
Hardware
Operating systems
Network protocols
Programming languages
We can agree at an higher level
Platform Independent Analysis & Specification of Problem
Model (Miniature shape of real time system)
CHARACTERISTICS OF A MODEL
Abstraction
Focus/Scope
Expressiveness vs. Analytic Power vs. Complexity
Intuitive vs. Non-intuitive Representation
Accuracy
Preserve all the properties of Actual System
MODELS
Software engineering models and methods impose structure on
software engineering with the goal of making that activity
systematic, repeatable, and ultimately more success-oriented.
Using models provides an approach to problem solving, a
notation, and procedures for model construction and analysis.
Methods provide an approach to the systematic specification,
design, construction, test, and verification of the end-item software
and associated work products.
Software engineering models and methods vary widely in scope
—from addressing a single software life cycle phase to covering
the complete software life cycle.
Modeling
Modeling of software is becoming a pervasive
technique to help software engineers understand,
engineer, and communicate aspects of the software
to appropriate stakeholders.
While there are many modeling languages,
notations, techniques, and tools in the literature
and in practice, there are unifying general
concepts that apply in some form to them all.
Properties of models are those distinguishing features of a
particular model used to characterize its
Completeness: the degree to which all requirements have
been implemented and verified within the model.
Consistency: the degree to which the model contains no
conflicting requirements, assertions, constraints,
functions, or component descriptions.
Correctness: the degree to which the model satisfies its
requirements and design specifications and is free of
defects.
within the chosen modeling notation and tooling used.
WHY DO WE MODEL
analysis, specification, design, verification,
and validation of a system.
As well as to communicate certain information.
One of the first principles of modeling is to clearly
Some of the purposes that models can serve throughout the system life cycle are:
Support for system integration and verification:
Models can be used to support integration of the hardware and software components into a
system, as well as to support verification that the system satisfies its requirements.
This often involves integrating lower level hardware and software design models with
system-level design models which verify that system requirements are satisfied.
System integration and verification may also include replacing selected hardware and
design models with actual hardware and software products in order to incrementally verify
that system requirements are satisfied. This is referred to as hardware-in-the-loop
testing and software-in-the-loop testing.
Models can also be used to define the test cases (glossary) and other aspects of the
test program to assist in test planning and execution.
.
Support for training:
Models can be used to simulate various aspects of the system
to help train users to interact with the system.
Users may be operators, maintainers, or other stakeholders.
Models may be a basis for developing a simulator of the
system with varying degrees of fidelity to represent user
interaction in different usage scenarios.
In the diagram, the information inside the oval shapes are attributes of a particular entity.
Entity Relationship Diagram (ERD) Symbols and Notations
There are three basic elements in an ER Diagram:
Entity, attribute, relationship.
There are more elements which are based on the main elements.
They are weak entity, multi valued attribute, derived attribute, weak relationship, and
recursive relationship.
Cardinality and Ordinality are two other notations used in ER diagrams to further
define relationships.
Entity
An entity can be a person, place, event, or object that is relevant to a given
system.
Elements in ER diagrams
For example, a school system may include students, teachers, major courses,
Primary and foreign keys are the most basic components
on which relational database theory is based.
subjects, fees, and other items.
Primary keys enforce entity integrity by uniquely Entities are represented in ER diagrams by a rectangle and named using singular
identifying entity instances. nouns.
Primary or Candidate key: A key used to uniquely
identify an entity set.
Weak Entity
Foreign keys enforce referential integrity by completing A weak entity is an entity that depends on the existence of another entity.
an association between two entities. In more technical terms it can be defined as an entity that cannot be identified by
Foreign key: Helps to identify relationships between
entities. its own attributes.
The next step in building the basic data model to: It uses a foreign key combined with its attributes to form the primary key.
Identify and define the primary key attributes for An entity like order item is a good example for this. The order item will be
each entity
Validate primary keys and relationships meaningless without an order so it depends on the existence of the order.
Migrate the primary keys to establish foreign keys
Super key: A set of attributes that helps together define
an entity uniquely, within an entity set.
Example of Entities:
A university may have some departments.
All these departments employ various lecturers and offer several
programs.
Some courses make up each program.
Students register in a particular program and enroll in various courses.
A lecturer from the specific department takes each course, and each
lecturer teaches a various group of students.
Relationship
Relationship is nothing but an association among two
or more entities. E.g., Tom works in the Chemistry
department.
. Entities take part in relationships. We can often
identify relationships with verbs or verb phrases.
Basic Elements in an ER Diagram
Weak Entities
A weak entity is a type of entity which doesn’t have its key attribute.
It can be identified uniquely by considering the primary key of another entity.
For that, weak entity sets need to have total participation.
It contains a Primary key represented by the underline It contains a Partial Key which is represented by a
symbol. dashed underline symbol.
The member of a strong entity set is called as The member of a weak entity set called as a
dominant entity set. subordinate entity set.
Primary Key is one of its attributes which helps to In a weak entity set, it is a combination of primary
identify its member. key and partial key of the strong entity set.
Attributes in ER diagrams, Note that an attribute can have its own attributes ( composite attribute )
If an attribute has more than one value,
it is called multi-valued attribute
Basic Elements In An ER Diagram
Attributes
It is a single-valued property of either an entity-type or a relationship-type.
For example, a lecture might have attributes: time, date, duration, place, etc.
An attribute in ER Diagram examples, is represented by an Ellipse.
Types of Attributes Description
Simple attributes can’t be divided any further. For
Simple attribute example, a student’s contact number. It is also
called an atomic value.
2.One-to-many:
One entity from entity set X can be associated with multiple entities of entity set
Y, but an entity from entity set Y can be associated with at least one entity.
For example, one class is consisting of multiple students.
MODALITY
Modality can be interpreted as a Required Connection OR a Not Required Connection.
This means if Modality is 0 then there doesn’t have to be a connection at all. If The value is 1 then we have that connection
EXAMPLE:
Think of a credit card company that has two tables:
a table for the person who gets the card and a table for the card itself.
A row from the cardholder table would have a relationship with a row in the card table because the cardholder
holds the card. (Fig. 1)
If a cardholder can have only one card this would be a one to one relationship.
If the card holder can have multiple cards it would be a one to
many relationship: Here the previous example updated with a one
to many relationship.(Fig 2)
In a one to one relationship we have a connection
from one row of the first table to one row of another
table. In a one to many relationship we have a
connection from one row of the first table to one or
multiple rows of the other table.
In the card table we have a column called holder_id.
This has a connection to the cardholder table because
a credit card is owned by somebody who will use it.
Now, if the modality is 0 or more, than we can have
a row without a holder_id value. If the modality is 1
or more, than we must have a value in the holder_id
column.
Modality of 0 or more = A card is not required to be held.
This means that the table not only holds active cards, but
it may hold cards that are not currently held by anybody.
This is called a null able column because it accepts an
empty field.
Modality of 1 or more = A card is required to be held. This
means that a card with no owner would not be able to be
put in this table. This is said to be a not null column
because it does not accept nulls.
We can also draw modality in our crow’s foot notation. If
the modality is zero or more, we put a little circle right
beside the cardinality. If the modality is one or more, we
put a vertical line next to the cardinality: (Fig 3)
CARDINALITY & MODALITY TOGETHER
Here is an illustration of modality. Notice that we can put both cardinality and modality on the
same line.
Modality goes on the inside and cardinality goes on the outside. (Fig 4)
Fig 4
Fig 5
Book Entity : It has authno, isbn number, title, edition, category, price. ISBN is the Primary Key for
Book Entity.
Reader Entity : It has UserId, Email, address, phone no, name. Name is composite attribute of
firstname and lastname. Phone no is multi valued attribute. UserId is the Primary Key for Readers
entity.
Publisher Entity : It has PublisherId, Year of publication, name. PublisherID is the Primary Key.
Authentication System Entity : It has LoginId and password with LoginID as Primary Key.
Reports Entity : It has UserId, Reg_no, Book_no, Issue/Return date. Reg_no is the Primary Key of
reports entity.
Staff Entity : It has name and staff_id with staff_id as Primary Key.
Reserve/Return Relationship Set : It has three attributes: Reserve date, Due
date, Return date.
Relationships between Entities –
A reader can reserve N books but one book can be reserved by only one
reader. The relationship 1:N.
A publisher can publish many books but a book is published by only one
publisher. The relationship 1:N.
Staff keeps track of readers. The relationship is M:N.
Staff maintains multiple reports. The relationship 1:N.
Staff maintains multiple Books. The relationship 1:N.
Authentication system provides login to multiple staffs. The relation is
1:N.
CASE STUDY FOR E-R DIAGRAM - II
ERD Case Study Examples with solution for a university management
system will help you understand how to translate a business scenario into
database example.
We will design a University Database Management System today , because it
is easy to understand the complete requirements for such scenario.
Before we rush towards designing , lets get introduced to a very simple
technique to crack case study. Use this and the whole entity-relation diagram
will be created before you know it.
There are four steps in designing a ERD for a DBMS .
1.IdentifyEntity and members
2.Decide relationships and Cardinality and Modality
3.Draw Entities separately
4.Connect relationships and entities
Now you know what to do with the user requirement , Just go through the entire case study
first and then apply these four steps on it.
ERD Case Study :