Object Oriented Analysis and Design
Object Oriented Analysis and Design
Object Oriented Analysis and Design
TEXT BOOK : Ali Bahrami, “Object Oriented Systems Development”, TATA Mcgraw-
hill Edition, 2008.
PREPARED BY
DR. D. DEVAKUMARI
• Object-Oriented Design Axioms
• Design Patterns
• Designing classes
• Class visibility
• Refining attributes
• designing methods and protocols
• Access layer: DBMS
• OODBMS.
Object-Oriented Design Axioms
• An AXIOM is a fundamental truth that always is observed to be valid and for which
there is no counter example or exception.
• A theorem is a proposition that may not be self evident but can be proven from accepted
axioms.
• A corollary is a proposition that follows from an axiom or another proposition that has
been proven.
• Axiom l. The independence axiom. Maintain the independence of components.
• Axiom 2. The independence axiom. Minimize the information content of the design.
• Axiom I States that, during the design process, as we go from requirement and use case
to a system component each component must satisfy that requirement without affecting
other requirements.
• Axiom 2 is concerned with simplicity. "The best theory explains the known facts with a
minimum amount of complexity and maximum simplicity and straight forwardness.
Design Patterns
• Design patterns are devices that allow systems to share knowledge about
their design, by describing commonly recurring structures of
communicating components that solve a general design problem within a
particular context.
1. single-value attributes.
3. Conversion method: The method that converts a value from one unit of measure to another.
4. Copy method: The method that copies the contents of one instance to another instance.
5. Attribute set: The method that sets the values of one or more attributes.
6. Attribute get: The method that returns the values of one or more attributes.
7. I/O methods: The methods that provide or receive data to or from a device.
• Your goal should be to maximize cohesiveness among objects and software components to improve coupling because only
a minimal amount of essential information should be passed between components.
Design Issues: Avoiding Design pitfalls UML operation presentation
• It is much better to have a large set of • The following operation presentation has
simple classes than a few large, complex been suggested by the UML.
classes.
• The operation syntax is this:-
• Your goal should be maximum reuse of
what you have to avoid creating new • visibility name:(parameter-list): return-
classes as much as possible. type-
• Each class must have a single, clearly • expression
defined purpose.
• where Visibility is one of:
• Move some functions into new classes
that the object would use. Apply corollary • + public visibility (accessibility to all
1 ( uncoupled design with less classes).
information content). • # protected Visibility (accessibility to
• Break up the class into two or more subclasses and operations of the class).
classes. Apply corollary 3 (large number of • -private visibility (accessibility only to
simple classes). operations of the class).
Database Management systems
• A DBMS is a set of programs that
enable the creation and maintenance of
a collection of related data.
• The DBMS provides the database users with • Database Models may be grouped into two
categories:
a conceptual representation that is
• Conceptual models and implementation
independent of the low-level details
models.
(physical view) of how the data are stored.
• The conceptual model focuses on the logical
• The database can provide an abstract data nature of that data presentation.
model that uses logical concepts such as • Therefore, the conceptual model is
concerned with what is represented in the
field, records, and tables and their
database and the implementation model is
interrelationships. concerned with how it is represented.
Hierarchical Model: -
• The hierarchical model represents data as a single- rooted tree.
• Each node in the tree represents a data object and the connections represent a parent-child
relationship.
Network Model: -
• Unlike the hierarchical model, a network model's record can have more than one parent.
Relational Model:-
• The columns of each table are attributes that define the data or value domain for entries in
that column.
• The rows of each table are tuples representing individual data objects being stored.
• A relational table should have only one primary key. A primary key is a combination of one or
more attributes whose value unambiguously locates each row in the table.
• In soup-ID, Lust-ID, and order-ID are primary keys in soup, customer, and order tables.
• A foreign key is a primary key of one table that is embedded in another table to link the tables.
Database Interface:-
• The interface on a database must include a data definition language (DDL), a query, and data manipulation language (DML). Database
systems have adopted two approaches for interfaces with the system.
• One is to embed a database language, such as structured query language (SQL), in the host programming language. Another approach is
to extend the host programming language with database related constructs.
• A data definition language (DDL) is the language used to describe the structure of and relationship between objects stored in a database.
This structure of information is termed the database Schema.
For example,
CREATE TABLE INVENTORY (Inventory_Number CHAR (10) NOT NULL DESCRIPTION CHAR (25) NOT NULL PRICE DECIMAL (9,2)):
• A data manipulation language (DML) is the language that allows users to access and manipulate (such as, create, save, or destroy) data
organization. The Structured query language (SQL) is the standard DML for relational DBMSs.
object-oriented Database Management systems:
• The object-oriented language management
system is a marriage of object oriented
programming and database technology to
provide what we now call object-oriented
databases.
• Many advantages accrue from including the
definition of operations with the definition of
data.
• First, the defined operations apply universally
and are not dependent on the particular
database application running at the moment.
• Second, the data types can be extended to
support complex data Such as multimedia by
defining new object classes that have
operations to support the new Kinds of
information.
The rules that make it an object-oriented system are as follows-
1. The system must support complex objects. A system must provide simple atomic types of objects (integers, characters, etc.) from which complex objects can be
built by applying constructors to atomic objects or other complex objects or both.
2. Object identity must be supported. A data object must have an identity and existence independent of its values
3. Objects must be encapsulated. An object must encapsulate both a program and its data.
4. The system must support types or classes. The system must support either the type concept embodied by CTH) or the class concept (embodied by Smalltalk).
5. The system must support inheritance. classes and types can participate in a class hierarchy. The primary advantage of inheritance is that it factors out shared
code and interfaces.
6. The system must avoid premature binding. This feature also is known as late binding or dynamic binding.