Advantages of Object-Oriented Architecture
Advantages of Object-Oriented Architecture
Introduction
Object
Object is an instance of a class.
Object is an entity that keeps together state and behaviors.
All the instance of a class have similar properties like class definition.
In object-oriented architecture, objects are the basic building blocks
and a real-world element which has a physical or a conceptual
existence.
Object model is a thing or an entity in the application domain.
For example, a student, a book, etc.
Object has a set of attribute values which define a state of the object.
For example, the status attribute of library book values: 'available',
'checkout', 'on reserve', 'missing' and 'removed'. These values are
used to determine the state of a book object.
Class
Class is a blueprint of an object.
A class represents description of objects that share same attributes
and actions.
It defines the characteristics of the object, such as attributes, actions
or behaviors.
Encapsulation
Encapsulation means hiding the data of a class from the object.
It is the process of binding the elements of an abstraction.
It binds the data in a single unit.
It hides the internal details of the class and implementation details of
the procedures.
It allows the elements of the class to be accessed from outside only
through the interface provided by the class.
Polymorphism
Polymorphism means having multiple forms.
It allows object with different internal structure to share some external
interface and particular effective while implementing inheritance.
For example, class draw is implemented for various graphic objects
like circle, rectangle, triangle etc. Here, draw operation is used to
draw of more than one type of graphic object.
Inheritance
Inheritance is a technique of deriving a new class from existing one.
It increases code reusability.
The existing class is called as base or parent or super class and the
new class are called the derived or child or subclasses.
Subclass inherits or derives the attributes and methods of the super
class.
Subclass can add its own attributes and methods and can modify any
of the super class methods.
For example, shape is a base class. Class Rectangle and Triangle are
the derived class. It is derived from the base class that is Shape class.
All the attributes and methods of the base class are accessible in a
derived class.
Message Passing
Sending and receiving information among objects through function
parameters is known as Message Passing.
Object communicates through invoking methods and sending data to
them.
Objects in a system communicates with each other by using message
passing.
Association
Association is a group of links having a common structure and
behavior.
Association illustrates the relationship between objects of one or more
classes.
A link is defined as an instance of an association.
The degree of association indicates the number of classes involved in a
connection.
Association is used to show that the instances of classifiers could be
either linked to each other or combined logically or physically into
some aggregation.
Composition and Aggregation
Aggregation is a specialized form of association among two or more
objects.
Composition is a specialized form of aggregation in which if the parent
object is destroyed, the child object would cease to exist. Composition
is also referred to as a death relationship.
Composition and aggregation is a relationship between classes by
which a class is made up of any combination of objects of other
classes.
It enables object to be placed directly within the body of other classes.
An aggregate object is composed of one or more objects.
1) Object Modeling
2) Dynamic Modeling
3) Functional Modeling
1. Object Modeling
Object modeling develops the static structure of the system regarding
to objects.
It recognizes the objects, relationship between the objects and the
classes in which the objects are grouped.
Following are the steps which shows the process of object modeling:
2. Dynamic Modeling
Dynamic modeling is a way of explaining how single object responds
to events (The activity occur at a point in time).
The aim of dynamic binding is to examine the behaviour of the object
regarding time and external changes.
Following diagram shows the process of dynamic modeling:
3. Functional Modeling
Functional modeling is the last component of the object oriented
analysis.
The functional model shows the processes executed in an object and
how the data change when it moves between the methods.
Following diagram shows the process of functional modeling:
Object-Oriented Design
I. Conceptual design
II. Detailed design
I. Conceptual design
Conceptual model recognizes all the classes required to build the
system.
In conceptual design, individual responsibilities are allocated to each
class.
In high-level design, class diagram is used to analyze the relationships
between classes and interaction diagram is used for showing the flow
of events.
ii. Detailed design
In detailed design, the attributes and operations are allocated to each
class based on their interaction diagram.
The state machine diagram is developed to explain the next details of
design is called as low level design.
1. Performance
The right architecture covers the way for system success and the
wrong architecture usually causes some form of disaster.
Performance depends on raw processing power of its hardware and is
important to make the system successful.
It helps to validate software architectural design choices with respect
to performance indices.
2. Scalability
Scalability of the system is related to performance.
It considers how quickly the system performs its current workload.
It focuses on the predictability of the system's performance as the
workload increases.
3. Reliability
Reliability is the probability of failure free software architecture design.
It is an important factor affecting on system reliability.
4. Security
Security provides method to deal with requirements.
It helps to manage the risk which may be arises in architectural
design.
5. Modifiability
It is possible to make minor changes in the architectural design.
6. Reusability
Reusability makes easy to reuse the code in a new system.
Architecture Views
1. Logical View
2. Process View
3. Development View
4. Physical View
Client-Server Architecture
The above figure shows two tier client-server architecture, where it works
when the client computer sends a request to the server over the network /
Internet connection and then delivered to the client.
1. Client-Queue-Client Systems
2. Peer-to-Peer (P2P) Applications
3. Application Servers
1. Client-Queue-Client Systems
Client-Queue-Client system allows client to communicate with other
clients through a server-based queue.
It allows client to distribute and synchronize files and information.
2. Peer-to-Peer (P2P) Applications
Peer-to-Peer application allows client and server to swap their roles in
order to distribute and synchronize the files and information across
multiple clients.
This approach extends the client/server style through multiple
responses to requests, shared data, resource discovery.
3. Application Servers
In this approach, client executing an application which runs on the
server through a framework such as Terminal services.
Client-Server Architecture Models
1. Thin Model
2. Thick Model
1. Thin Model
Thin model is used when legacy systems are migrated to client-server
architecture where legacy system acts as a server and implemented
on a client with a graphical interface.
It includes all the application processing and data management is
carried by the server.
This model has major disadvantage is that it places heavy processing
load on both the server and the network.
2. Thick Model
Thick model is also known as Fat Client Model.
This model is good for new client-server systems.
Thick model is more complex than a thin model.
Advantages of Client-Server Architecture
Client-Server architecture provides higher security. All the data is
stored on the server so the control of security is greater than client
machines.
It accesses centralized data because the data is stored only on the
server.
It ensures the ease of maintenance where a client remains and
unaffected by a server repair, upgrade or relocation.
Client-Server architecture simplifies the design and the
development of distributed applications.
Disadvantages of Client-Server Architecture
Client-Server architecture has traffic congestion problem when a
large number of clients send requests to the same server.
If server fails then user will not be able to request to the network until
the server is fixed or replaced. It has lack of robustness because of
centralized server.
Multi-Tier/N-Tier Architecture