0% found this document useful (0 votes)
73 views34 pages

Principles of Object Oriented Systems: Software Engineering Department

This document discusses principles of object oriented systems. It defines key concepts like abstraction, encapsulation, inheritance, polymorphism, concurrency and persistence. Object orientation focuses on defining complex data types and data abstraction. Inheritance allows code reuse through specialization of superclasses. Concurrency is achieved through active objects representing independent threads of control. Persistency allows objects to persist beyond the lifetime of a program.

Uploaded by

Quynh Khuong
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views34 pages

Principles of Object Oriented Systems: Software Engineering Department

This document discusses principles of object oriented systems. It defines key concepts like abstraction, encapsulation, inheritance, polymorphism, concurrency and persistence. Object orientation focuses on defining complex data types and data abstraction. Inheritance allows code reuse through specialization of superclasses. Concurrency is achieved through active objects representing independent threads of control. Persistency allows objects to persist beyond the lifetime of a program.

Uploaded by

Quynh Khuong
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 34

Principles of object oriented

systems

Software Engineering Department


Software Engineering and Databases
Software engineering is a profession and field of study
dedicated to designing, implementing, and modifying
software

The term software engineering first appeared in the 1968


NATO Software Engineering Conference, and was meant
to provoke thought regarding the perceived "software
crisis" at the time.
Software Engineering and Databases
Since the field is still relatively young compared to its
sister fields of engineering, there is still much debate
around what software engineering actually is, and if it
conforms to the classical definition of engineering.
The IEEE Computer Society's Software Engineering Body
of Knowledge defines "software engineering" as the
application of a systematic, disciplined, quantifiable
approach to the development, operation, and
maintenance of software, and the study of these
approaches; that is, the application of engineering to
software.
Software Engineering and Databases
One of the most important techniques reducing complexity
of software syetms is abstraction.
 An abstraction denotes the essential characteristics of an
object that distinguish it from all other kinds of objects and
thus provide crisply defined conceptual boundaries, relative to
the perspective of the viewer.

Exist in any design proceses.

Allows developers to modularize program easily and


naturally, speeding up designing large software projects.
Software Engineering and Databases
Database systems are often large software systems
with the following features:

A large data stored in the exteral memory and


need to be organized in a way that gurrantee
updating effectivelly

Data entities have complex inter-relationships

Data needs to be shared between users and the


integrity must be maintained
Software Engineering and
Databases
Providing appropriate tools for processing effectively
data, especially with large databases, is a difficult task
of conventional programming languages.
However, representing complex data objects can be
done with some modern languages.
This allows us defining abstract data objects and
equivalent methods => important for database
applications.
Software Engineering and Databases
Commercial database systems usually provide
simple data types
 => affects designer and programmers.

This requires new capabilities for creating complex


data types
 => forming object-oriented databases.
Software Engineering and
Databases
The difference between OOB and conventional
databases is that
 it focuses on defining complex data types and data
abstraction.

Certainly, it can be benefited from results of research


in OOP.
Software Engineering and
Databases
Objects in OOB and OOP are both used for data
encasulation
Differences:
 Objects in OOB are persistent (even the loop of creating it
is completed ) as oppose to objects in OOP.
 OOB supports versioning. This allows accessing different
versions of the same objects, i.e databases recording
 OOB can be interleaved with conditions from the
applications.
Cycle of databases
Requirement analysis

Data modelling and software design

Execution

Testing

Maintenance
Notes on software design
Three aspects of software design:
Reliability : The software follows the all
specifications and operate well in both normall
as well as abnormal conditions.
Extendability: Can be compatible with some
changes of specifications and database.
Reusability: Modules can be reused in other
applications.
Testing
Quality of a database system is measured based on
corectness and reliablity.
Goals of testing:
 Detect errors in periods of modelling and execution.
 Determine if the system satisfies the user needs?.
Maintenance
Practically it is not possible to carry a complete testing
for a large database system. Further, some errors might
happen during later use.
Tasks:
 Repair corruptions during the usage.
 Implement change sof systems responding to the new
requirements.
 Implement schames to improve effectiveness and user
interface.
Object Oriented Systems
The term object-oriented seems to be the buzzword of
the 1980s and 1990s.
Everybody is using it, but with such a wide range of
different meanings that no one seems to know exactly
what the other is saying.
It appears in several disciplines, including programming
languages, databases and knowledge bases, artificial
intelligence and computer systems in general.
Object-Orientation - What Does
it Mean?
 Object-orientation can be seen as a kind of technique of
organizing a system in terms of objects.

 The foundation of the whole approach is encapsulation. This


means that the properties of data and the procedures for the
manipulation of this data are combined into an object.

 Encapsulation restricts the effects of change by placing a wall


of code around pieces of data.
 The objects communicate through messages which invoke the
objects procedures, usually called methods.
 Hence, manipulation of the data is provided by those
methods only
Features of OO Systems
object,

type,

inheritance,

abstraction,

concurrency, and

persistence
Object and Abstraction
The dimensions object and abstraction reflect the basic
principle of encapsulation, which can be found in
conventional languages like Modula-2 or Ada.
An abstraction denotes the essential characteristics of an
object that distinguish it from all other kinds of objects
and thus provide crisply defined conceptual boundaries,
relative to the perspective of the viewer.
Object and Abstraction
Entity abstraction An object that represents a useful
model of a problem domain or solution domain entity
Action abstraction An object that provides a generalized
set of operations, all of which perform the same kind of
function
Virtual machine abstraction An object that groups
operations that are all used by some superior level of
control, or operations that all use some junior-level set
of operations
Coincidental abstraction An object that packages a set
of operations that have no relation to each other
Example: defining a class
Class Fruit{

int grams;

int cals_per_gram;

int total_calories() {

return(grams*cals_per_gram);

}
Inheritance
Inheritance is the more innovative part of the approach,
because it is not provided by these conventional
programming languages.
It is a tool for (automatically) broadcasting definitions
of attributes and methods from already defined pieces
of data and operations to pieces developed separately
and thus supports reusability.
Inheritance Example
Class C is a subclass of class B (its
superclass) if its declaration has the form
class C extends B {

}

The subclass is a specialization of the


superclass
The superclass is a generalization of the
subclass
Concurrency
The dimension of concurrency introduces the term
process.
 A process-based language extends the autonomy of objects
to the autonomy in time,
 that is, operations may be executed concurrently or
separately depending on the systems need or even started
by these needs (triggers, daemons)
Concurrency
 Concurrency focuses on process abstraction and
synchronization. The object is a concept that unifies these
two different viewpoints:
 Each object (drawn from an abstraction of the real world) may
represent a separate thread of control (a process abstraction).
Such objects are called active.

 In a system based on an object-oriented design, we can


conceptualize the world as consisting of a set of cooperative
objects, some of which are active and thus serve as centers
of independent activity. Given this conception, we define
concurrency as follows:
 Concurrency is the property that distinguishes an active object
from one that is not active.
Persistency
Adding the dimension of persistency reflects the fact,
that there is a trend toward extending object-oriented
programming languages in the direction of databases,
This occurs in parallel with the attempt of extending
database systems with object-oriented ideas.
Persistency
Object oriented languages and object-oriented
databases are natural complements of one another.
 The first one emphasizes processing, complex structuring
and local data,
 the second one focuses on a more declarative approach,
consistency, persistency, sharing, and support for very
large amounts of data.

The merger of these activities could be an object-


oriented database programming language which
combines the aspects of a programming language and a
database model.
Polymophism
 Further essential object-oriented concepts are object-
identity and polymorphism.
 The first one means that an object exists independent of the
value it represents. This allows objects to share subobjects
and to be cyclic. Furthermore, such objects can be updated
without loosing their identity.
 The latter one provides the overloading of methods such that
the same message elicits (semantically similar) responses
depending on the class of the receiver object.

 Note, that this is facilitated by the message-passing paradigm


as a message specifies only a method identifier for an object
and not the code to be executed.
Principles
 Encapsulation of data and methods:
 Encapsulation provides data abstraction.
 The state of an object is accessible only through its methods. The
state of the object is generally represented by variables which are
hidden from the clients.
 The implementation of the methods are not visible outside of an
object. A method is a piece of code that implements an operation on
an object state. The set of methods defined for an object determine
the behavior of the object.
 Objects communicate through message passing.

 Methods and message passing:


 A message consists of an addressee, a method selector, and possibly
several actual parameters. In response to a message, the receiver
invokes the method identified by the selector specified within the
message.
Principles
 Classification and instantiation:
 Objects are collected into classes. A class determines the
structural and behavioral properties of its instances. The
structural properties are specified by a set of variables, the
behavioral properties by a set of methods.

 Class taxonomy and inheritance:


 A class is interpreted as a template for the creation of the
instances of the class, i.e., it defines both the type of these
instances, and the way these instances are created as
reflections of real world 'things'. Classes are organized in a
lattice. A class may inherit operations from "superclasses" and
may have its operations inherited by "subclasses". Inheritance
is defined narrowly as a mechanism for resource sharing in
class hierarchies.
Advantages
 Extensibility, flexibility, and changeability:
 Most DBMSs provide a fixed set of data types (e.g., relational
DBMSs provide relations and field types).
 An object-oriented system provides (1) predefined classes/
types, (2) mechanisms to define new classes/types, and (3) a
uniform way of treating system and user defined
classes/types.
 Hence, new object classes/types including their methods can
be incorporated into the system.
 Changes of object types/ classes and their methods are localized
to the relevant types/classes and are much easier controlled than
in conventional record-based systems, where many record types
may be affected by a change.
Advantages
 Consistent interpretation of data:

 Because of encapsulation, the behavior associated with an object type is


predetermined by a fixed set of operations.

 Therefore, the database operations are constrained to be within the


specifications of these operations. This induces a more consistent interpretation
of data by application programs.

 Modeling power:

 Inheritance of both variables and methods is a very powerful tool for data
modeling.

 It is a kind of modularization and supports the specification of reusable type


definitions.

 In general, the modeling principles of generalization/specialization,


identification, and aggregation are well supported in some object-oriented data
models.
The motivation for object-
oriented data models
 Impedance mismatch:
 Applications using conventional database technology suffer
under the need of two different languages, a database
language (e.g., SQL) and a host language (e.g., COBOL, PL/1).
 Since the type systems of these languages, different data must
be converted from one language environment to the other
one, and often type checking is lost.
 Different processing strategies require concepts like a cursor
to scan relations. In contrast to the host language the
database language is incomplete with respect to computation
and recursion.
 Furthermore, the database language usually is a declarative
one, whereas the host language is procedural.
The motivation for object-
oriented data models
New applications require non-standard and complex
objects and operations:
 The conventional database technology does not satisfy
these special requirements e.g., in the field of AI,
CAD/CAM, Engineering, CASE, or (multimedia) office
automation, although database technology plays a crucial
role in all these fields.
 New modelling techniques, the handling of complex
structures and multimedia data are required as well as
extensibility and flexibility, next to a high degree of
modularity and reusability for building these complex
applications.
Extended concepts
 Object-oriented programming is a method of implementation
in which programs are organized as cooperative collections of
objects, each of which represents an instance of some class,
and whose classes are all members of a hierarchy of classes
united via inheritance relationships.
 Object-oriented design is a method of design encompassing
the process of object oriented decomposition and a notation
for depicting both logical and physical as well as static and
dynamic models of the system under design.
 Object-oriented design is a method of design encompassing
the process of objectoriented decomposition and a notation
for depicting both logical and physical as well as static and
dynamic models of the system under design.
The End

You might also like