Module - 2
Module - 2
• Traditional database applications have data-processing tasks, such as banking and payroll
management, with relatively simple data types that are compatible with the relational data
model. As database systems were applied to a wide range of applications, such as
computer-aided design and geographic information systems, the limitations imposed by
the relational model emerged as a constraint.
Name of Institution
• 1. Object Structure:
The structure of an object refers to the properties that an object is made up of. These
properties of an object are referred to as an attribute. Thus, an object is a real-world entity
with certain attributes that makes up the object structure. Also, an object encapsulates the
data code into a single unit which in turn provides data abstraction by hiding the
implementation details from the user.
Name of Institution
• The object structure is further composed of three types of components: Messages, Methods,
and Variables.
1. Messages –
A message provides an interface or acts as a communication medium between an object and
the outside world. A message can be of two types:
1. Read-only message: If the invoked method does not change the value of a variable, then
the invoking message is said to be a read-only message.
2. Update message: If the invoked method changes the value of a variable, then the
invoking message is said to be an update message.
Name of Institution
2. Methods –
When a message is passed then the body of code that is executed is known as a
method. Whenever a method is executed, it returns a value as output.
3. Variables –
It stores the data of an object. The data stored in the variables makes
the object distinguishable from one another.
Name of Institution
3. Object Classes:
• In the above example, we can see, CLERK is a class that holds the object
variables and messages.
• An OODBMS also supports inheritance in an extensive manner as in a
database there may be many classes with similar methods, variables and
messages. Thus, the concept of the class hierarchy is maintained to depict the
similarities among various classes.
• The concept of encapsulation that is the data or information hiding is also
supported by an object-oriented data model. And this data model also
provides the facility of abstract data types apart from the built-in data types
like char, int, float. ADT’s are the user-defined data types that hold the values
within them and can also have methods attached to them.
Name of Institution
• An ODBMS stores and manages data as objects, and provides mechanisms for
querying, manipulating, and retrieving the data. In an ODBMS, the data is
typically stored in the form of classes and objects, which can be related to each
other using inheritance and association relationships.
Name of Institution
• However, there are also some disadvantages to using an ODBMS. One of the
main disadvantages is that they can be more complex and harder to use than
traditional relational databases.
• Finally, some applications may not require the advanced features and
performance provided by an ODBMS, and may be better suited for a simpler
database solution
Name of Institution
• Features of ODBMS:
• Object-oriented data model: ODBMS uses an object-oriented data model to store and
manage data. This allows developers to work with data in a more natural way, as objects are
similar to the objects in the programming language they are using.
• Complex data types: ODBMS supports complex data types such as arrays, lists, sets, and
graphs, allowing developers to store and manage complex data structures in the database.
• Advantages:
• Reduced Development Time: ODBMS can reduce development time since it eliminates the
need to map objects to tables and allows developers to work directly with objects in the
database.
• Supports Rich Data Types: ODBMS supports rich data types, such as audio, video,
images, and spatial data, which can be challenging to store and retrieve in traditional
relational databases.
• Scalability: ODBMS can scale horizontally and vertically, which means it can handle larger
volumes of data and can support more users.
Name of Institution
• Disadvantages:
• The first obstacle faced by programmers using the relational data model was
the limited type of system supported by the relational model.
• Such features are indeed supported in ER and extended ER notation, but they
had to be translated into simpler SQL data types.
Name of Institution
• The second obstacle was the difficulty of accessing database data from
programs written in programming languages such as C++ or Java. Simply
expanding the type system supported by the database was not enough to
completely solve this problem.
• The difference between the type system of a database and the type system of a
programming language makes data storage and retrieval more complex, and,
and need to be minimized. Expressing database access using a language other
than a programming language (SQL) again makes the programmer’s job
difficult.
Name of Institution
• The three main building blocks of the OODBMS are object structure, object
classes, and object identity. The following explains them.
• A real-world entity with certain qualities that makes up the object structure is
hence referred to as an object. Also, an object contains the data code in a
solitary piece, which in turn creates data abstraction by shielding the user
from the implementation specifics.
Name of Institution
1. Messages - A message operates as a communication channel or as an interface between an entity and the outside world.
There are two sorts of messages:
2. Read-only message: The invoking message is referred to as a read-only message if the called method does not alter the
value of a variable.
3. Update message: The invoking message is referred to as an update message if the invoked method modifies the value of
a variable.
4. Methods: A method is a chunk of code that is executed when a message is given. Every time a method is used, a value is
returned as output. There are two categories of methods:
5. Read-only method: A method is referred to as a read-only method when it has no effect on the value of a variable.
6. Update-method: An update method is one that modifies a variable's value in some way.
7. Variables are used to store an object's data. The variables' data allows the objects to be distinguished from one another.
Name of Institution
2.Object-relational database.
Name of Institution
• 1) Object-oriented Database
• The object-oriented database or standalone object-oriented database stores data in the form
of objects using the object data model.
• And when object-oriented programming creates a data object, it can be directly stored in the
OODB without needing any conversion or mapping.
• In an object-oriented programming language, we mainly use classes and objects to deal with
data, and an OODB acts as a perfect database to store data created by a program’s classes
and objects.
• This is also one of the main reasons why the object-oriented database is much faster than the
relational database.
Name of Institution
• 2) Object-relational database –
• Advantages of OODB –
• Disadvantages OODB –
• RDBMS Vs ODBMS –
• The type of DBMS that is now used the most frequently is a relational database management system
(RDBMS). Most IT workers have a solid understanding of the relational abstraction of rows and columns
accessible via Structured Query Language (SQL).
• Yet, object database systems may be more effective in managing and storing complicated data relationships.
Accessing data with several relationships spread across various tables in an RDBMS might be more
challenging for applications than accessing the same data as an object in an ODBMS.
• In a nutshell, you either make money or save money when you satisfy a business
requirement. High performance in the context of an ODBMS refers to the possibility of a
performance increase of ten to a thousand times above that of an RDBMS.
• Finally, if your data resembles a linked graph, like a bill of goods or a schema with several
intersection elements, you can be certain that it contains complicated information. Let's
imagine, for illustration, that you use an automated stock trading program.
Name of Institution
• British Airlines' Origin and Destination (O&D) Revenue Management System makes use of the Versant
Object Database. The O&D Revenue Management System is employed by British Airways to increase income
from its global route networks and alliances.
• FastObjects are used by bio matrix to store and retrieve sophisticated data from blood tests. Designing,
developing, producing, and marketing diagnosis systems for use in medical and industrial applications are
what bio matrix, a company that specialize in vitro diagnostics, does.
• Siemens' CONDIS system, which maintains network and system infrastructures in real time using object
technology, uses GemStone Smalltalk technology as an object cache and backbone. The Siemens Company
sells the GemStone Smalltalk object cache as a value-added reseller.
Name of Institution
• Intention of object oriented modeling and design is to learn how to apply object -oriented
concepts to all the stages of the software development life cycle.Object-oriented modeling
and design is a way of thinking about problems using models organized around real world
concepts.
• The fundamental construct is the object, which combines both data structure and behavior.
• Purpose of Models:
1. Testing a physical entity before building it
2. Communication with customers
3. Visualization
4. Reduction of complexity
Name of Institution
• Types of Models:
There are 3 types of models in the object oriented modeling and design are:
1. Class Model:
The class model shows all the classes present in the system. The class model shows the
attributes and the behavior associated with the objects. The class diagram is used to show the
class model.The class diagram shows the class name followed by the attributes followed by
the functions or the methods that are associated with the object of the class.Goal in
constructing class model is to capture those concepts from the real world that are important
to an application.
Name of Institution
• State Model:
• Interaction Model:
• Interaction model is used to show the various interactions between
objects, how the objects collaborate to achieve the behavior of the
system as a whole.
• What is Aggregation?
• Unlike composition, aggregation implies a looser coupling between the objects, allowing
the parts to exist independently of the whole.
• This relationship emphasizes the concept of "has-a" rather than "is-a," indicating that the
whole object has or is associated with the parts, but does not own or control them.
• Aggregation is crucial for modeling complex systems and promoting modularity and
flexibility in software design.
Name of Institution
• Importance of Aggregation in OOAD –
• Aggregation holds significant importance in Object-Oriented Analysis and Design (OOAD) for various
reasons:
• Modularity and Reusability: Aggregation allows objects to be composed of other objects, promoting
modular design. This modular approach enhances code reusability as individual components can be reused in
various contexts.
• Flexibility and Scalability: Aggregation provides flexibility by enabling the dynamic assembly of objects at
runtime. This flexibility supports scalability as systems can adapt to changing requirements by adding or
removing components.
• Encapsulation and Information Hiding: Aggregation facilitates encapsulation by hiding the internal details
of complex objects. Objects encapsulated within a whole object can only be accessed through well-defined
interfaces, promoting information hiding and reducing dependencies.
Name of Institution
• In this notation:
• The hollow diamond (◇) indicates aggregation.
• The line connecting the containing class to the contained class represents the
association between them.
• The containing class is responsible for the lifecycle of the contained class, but
the contained class can exist independently.
• This notation helps to visually represent the "has-a" relationship between
objects, indicating that one object is composed of or contains other objects, but
does not necessarily own or control them.
Name of Institution
• Aggregation
• Ownership: Aggregation implies a weaker form of ownership. The containing object (whole) is responsible
for managing the lifecycle of the contained objects (parts) to some extent, but it does not fully own them. The
contained objects can exist independently and may be shared among multiple containing objects.
• Lifecycles: Since the containing object doesn't fully own the contained objects, their lifecycles can be
independent. The containing object may create or destroy instances of the contained objects, but the contained
objects can also exist outside the scope of the containing object. Therefore, their lifecycles are not tightly
coupled.
Name of Institution
• Use Aggregation for Modularity: Employ aggregation to promote modularity and encapsulation. Use it to
break down complex systems into smaller, more manageable components.
• Define Clear Interfaces: Define clear interfaces for interacting with aggregated objects. Encapsulate the
interactions with aggregated objects through well-defined methods and properties. This promotes information
hiding and reduces dependencies between components.
Name of Institution
• Now, let's consider the relationship between a Course and the Students enrolled in it:
• Aggregation Relationship: The relationship between a Course and the Students enrolled in it can be
represented using aggregation. A Course "has-a" collection of Students who are enrolled in that course.
• Class Diagram Representation: In a class diagram, the Course class would have an aggregation relationship
with the Student class. The aggregation would be represented by a line with a hollow diamond at the Course
end.
• Implementation: In the software implementation of this system, the Course class would contain a collection
(e.g., a list or array) of Student objects representing the students enrolled in that course.
Name of Institution
• Flexibility and Modularity: Using aggregation allows for flexibility in the system.
Students can be enrolled in multiple courses simultaneously, and the relationship between a
Course and its enrolled Students is not tightly coupled. Each Student object can exist
independently of any specific Course object.
• Example Usage: When a student enrolls in a course, the Student object would be added to
the collection of enrolled students within the corresponding Course object. Conversely,
when a student drops a course, the Student object would be removed from the collection.
• Modularity: Aggregation promotes modularity by allowing complex systems to be broken down into
smaller, more manageable components. This modular approach simplifies the design process, making it easier
to understand, maintain, and extend the system over time.
• Reusability: Aggregation facilitates reusability by enabling the reuse of individual components in multiple
contexts. Objects encapsulated within an aggregated relationship can be reused in different parts of the system
without the need for significant modification, leading to reduced development time and effort.
• Flexibility: Aggregation offers flexibility in system design by allowing objects to be dynamically assembled
at runtime. This flexibility enables systems to adapt to changing requirements more easily, as components can
be added, removed, or modified without affecting the overall system architecture.
Name of Institution
• Specialization
• Specialization is a top-down approach, and it is opposite to
Generalization. In specialization, one higher level entity can be
broken down into two lower level entities.
• Specialization is used to identify the subset of an entity set that shares
some distinguishing characteristics.
• Normally, the superclass is defined first, the subclass and its related
attributes are defined next, and relationship set are then added.
Name of Institution
• For example: In an Employee management system, EMPLOYEE entity can be specialized as TESTER or
DEVELOPER based on what role they play in the company.
Name of Institution
• An example of an association
• An example of a relationship is a one-to-many association
between departments and employees. They might have a
relationship where the Dept entity object has a Deptno
attribute that is related to the Deptno attribute of the Emp entity
object (Dept.Deptno = Emp.Deptno), as shown in the nest
figure.
• The DEPT and EMP tables are at the bottom of the figure, and
the Dept and Emp entity objects are at the top of the figure.
They have a master-detail relationship.
Name of Institution
Name of Institution
Module – 2 - Completed