Professional Documents
Culture Documents
Final Project
CS619 VIVA
Preparation
Notes
We will Also Have a Project
Discussion,
If needed then Contact with me
0300-8959571
Mahar Waqas PHP Developer 0300-8959571
Classes and objects are separate but related concepts. Every object belongs to
a class and every class contains one or more related objects.
Class:
A class is the core of any modern Object Oriented Programming
language Class is a blueprint of an object that contains variables
for storing data and functions to performing operations on these
data.
Object:
“Object is an instance of a
class” what are data member
and functions
Aggregation. Child object does not have its lifecycle and if parent
object is deleted, all child objects will also be deleted.
System
Draw your system's boundaries using a rectangle that contains use
cases. Place actors outside the system's boundaries.
System is used to define the scope of the use case and drawn as a
rectangle. This an optional element but useful when your
visualizing large systems. For example you can create all the use
cases and then use the system object to define the scope covered
by your project. Or you can even use it to show the different areas
covered in different releases.
Use Case
Draw use cases using ovals. Label with ovals with verbs that
represent the system's functions.
Mahar Waqas PHP Developer 0300-8959571
Actors
Actors are the users of a system. When one system is the actor of
another system, label the actor system with the actor stereotype.
Relationships
The Special Order and Normal Order use cases are extended from
Order use case. So they have extends relationship. Another
important point is to identify the system boundary which is shown
in the picture. The actor Customer lies outside the system as it is
an external user of the system.
Mahar Waqas PHP Developer 0300-8959571
Cardinality
Types of Attributes
• Simple attribute − Simple attributes are atomic values, which
cannot be divided further. For example, a student's phone
number is an atomic value of 10 digits.
Types of Entity –
Relationship
Relationships are represented by diamond-shaped box. Name of
the relationship is written inside the diamond-box. All the entities
(rectangles) participating in a relationship, are connected to it by a
line.
Binary Relationship and Cardinality
A relationship where two entities are participating is called a
binary relationship. Cardinality is the number of instance of an
entity from a relation that can be associated with the relation.
Mahar Waqas PHP Developer 0300-8959571
Sequence Diagrams
The Sequence Diagram shows how the objects interact with others
in a particular scenario of a use case.
Class roles
Class roles describe the way an object will behave in context. Use
the UML object symbol to illustrate class roles, but don't list
object attributes.
Activation
Activation boxes represent the time an object needs to complete a
task.
Messages
Messages are arrows that represent communication between
objects. Use half-arrowed lines to represent asynchronous
messages. Asynchronous messages are sent from an object that
will not wait for a response from the receiver before continuing its
tasks.
Mahar Waqas PHP Developer 0300-8959571
Asynchronous Message
Asynchronous messages don't need a reply for interaction to
continue. Like synchronous messages, they are drawn with an
arrow connecting two lifelines; however, the arrowhead is usually
open and there's no return message depicted.
Self Message
Mahar Waqas PHP Developer 0300-8959571
Lifelines
Loops
A repetition or loop within a sequence diagram is depicted as a
rectangle. Place the condition for exiting the loop at the bottom
left corner in square brackets [ ].
Mahar Waqas PHP Developer 0300-8959571
Messages
Messages are arrows that represent communication between
objects. Use half-arrowed lines to represent asynchronous
messages. Asynchronous messages are sent from an object that
will not wait for a response from the receiver before continuing its
tasks. For message types, see below.
Lifelines
Lifelines are vertical dashed lines that indicate the object's
presence over time.
Mahar Waqas PHP Developer 0300-8959571
1. Presentation tier
2. Application tier
3. Data tier
Mahar Waqas PHP Developer 0300-8959571
3-tier Architecture
A 3-tier architecture separates its tiers from each other based on
the complexity of the users and how they use the data present in
the database. It is the most widely used architecture to design a
DBMS.
Class Diagram
Class diagrams are used to represents real life objects in our design
by capturing its data methods and relationships of these methods
with each other. These classes are basic building blocks of our
object oriented system. Class diagrams are represented with white
boxes which consist of three parts. Each of these parts has unique
characteristics.
Database Design
In our daily life every object has some data associated with it. This
data can be managed through data base design. Data large data can
be represented by this data base design. Data base design can be
represented in the form of physical, conceptual and logical.
Mahar Waqas PHP Developer 0300-8959571
Relational Model
The most popular data model in DBMS is the Relational Model. It
is more scientific a model than others. This model is based on
first-order predicate logic and defines a table as an n-ary relation.
Mahar Waqas PHP Developer 0300-8959571
Users
A typical DBMS has users with different rights and permissions
who use it for different purposes. Some users retrieve data and
some back it up. The users of a DBMS can be broadly categorized
as follows −
• End Users − End users are those who actually reap the
benefits of having a DBMS. End users can range from
Mahar Waqas PHP Developer 0300-8959571
Keys
Super Key
Super key is a set of one or more than one keys that can be used to
identify a record uniquely in a table. Example: Primary key,
Unique key, Alternate key are subset of Super Keys.
Candidate Key
Primary Key
Alternate key
Composite/Compound Key
Unique Key
Foreign Key
SQL Overview
SQL Commands:
The standard SQL commands to interact with relational databases
are CREATE, SELECT, INSERT, UPDATE, DELETE and
DROP. These commands can be classified into groups based on
their nature:
CREATE
Creates new databases, tables and views from RDBMS.
For example −
For example−
DELETE
DROP
TRUNCATE
It Removes all rows from a table, but the table structures and its
columns, constraints, indexes remains.
• SELECT/FROM/WHERE
Mahar Waqas PHP Developer 0300-8959571
• INSERT INTO/VALUES
• UPDATE/SET/WHERE
• DELETE FROM/WHERE
These basic constructs allow database programmers and users to
enter data and information into the database and retrieve
efficiently using a number of filter options.
SELECT/FROM/WHERE
• SELECT − This is one of the fundamental query command
of SQL. It is similar to the projection operation of relational
algebra. It selects the attributes based on the condition
described by WHERE clause.
For example −
Select author_name
From book_author
Where age > 50;
This command will yield the names of authors from the relation
book_authorwhose age is greater than 50.
INSERT INTO/VALUES
Mahar Waqas PHP Developer 0300-8959571
This command is used for inserting values into the rows of a table
(relation).
Syntax−
INSERT INTO table (column1 [, column2, column3 ... ]) VALUES
(value1 [, value2, value3 ... ])
Or
Syntax −
Syntax −
DELETE FROM
tutorialspoints WHERE
Author="unknown";
CRUD Operations
Normalization
If a database design is not perfect, it may contain anomalies, which
are like a bad dream for any database administrator. Managing a
database with anomalies is next to impossible.
Each attribute must contain only a single value from its pre-
defined domain.
To bring this relation into third normal form, we break the relation
into two relations as follows −
Anomalies
Update Anomalies
Delete Anomalies
Insert Anomalies
Insert Anomalies
An Insert Anomaly occurs when certain attributes cannot be
inserted into the database without the presence of other attributes.
For example this is the converse of delete anomaly - we can't add a
new course unless we have at least one student enrolled on the
course.
Mahar Waqas PHP Developer 0300-8959571
Delete Anomalies
Update Anomalies
Data Integrity
Domain constraints
Entity integrity
Column constraints
User-defined integrity constraints
Referential integrity
The data analysis stage will identify the requirements of these.
Domain Constraints
Entity Integrity
During the data analysis phase, business rules will identify any
column constraints. For example, a salary cannot be negative; an
employee number must be in the range 1000 - 2000, etc. User-
Defined Integrity Constraints
must have a matching primary key value in the related table. This
is the most common type of integrity constraint. This is used to
manage the relationships between primary and foreign keys.
Joins
Join is a combination of a Cartesian product followed by a
selection process. A Join operation pairs two tuples from different
relations, if and only if a given join condition is satisfied.
Notation
R1 θ R2
R1 and R2 are relations having attributes (A1, A2, .., An) and (B1,
B2,.. ,Bn) such that the attributes don’t have anything in common,
that is R1 ∩ R2 = Φ.
Equijoin
When Theta join uses only equality comparison operator, it is said
to be equijoin. The above example corresponds to equijoin.
Natural Join ( )
Natural join does not use any comparison operator. It does not
concatenate the way a Cartesian product does. We can perform a
Natural Join only if there is at least one common attribute that
Mahar Waqas PHP Developer 0300-8959571
Theta Join, Equijoin, and Natural Join are called inner joins. An
inner join includes only those tuples with matching attributes and
the rest are discarded in the resulting relation. Therefore, we need
to use outer joins to include all the tuples from the participating
relations in the resulting relation. There are three kinds of outer
joins − left outer join, right outer join, and full outer join.
Indexing