OBJECT ORIENTED DESIGN
Object oriented design is design strategy where a system designer thinks in terms of things instead of operations or functions. An object oriented design process involves designer involves design realized as an executing program. The required objects are created dynamically using the class definition.
Object oriented design is part of object oriented development where an object oriented strategy is used throughout the development process.
Object oriented analysis is concerned with developing an object oriented model of the application domain. The identified object reflects entities and operations that are associated with problems to be solved.
Object oriented design is concerned with developing an object oriented model of a software system to implement the identified requirements. The objects in object oriented design are related to the solutions to the problem that is being solved.
Object oriented programming is concerned with realizing a software design using an object oriented programming language such as Java supports direct implementation of objects and provide facilities to define objects.
Object and object classes:
The term object and object oriented are now widely used. They are applied to different types of entity, design methods, systems and programming languages.
An object is an entity that has a state and defined set of operations which operate on that state. The state is represented as a set of object attributes. The operations associated with object provide services to other objects which request these services when some computations are required.
The class Employee defines a number of attributes that hold information including name, address, SSN, tax code etc.
Operations associated with objects are join ( ), leave ( ), retire ( ), change detail.
Objects communicate to each other by requesting services for exchanging information.
For communication, we use inheritance feature.
The child class inherits attributes and operations from the parent class.
Concurrent objects:
Objects may be implemented sequentially or concurrently.
A concurrent object may be a passive object whose state is only changed through its interface or an active object that can change its own state without intervention.
Object oriented design process:
There are number of stages:-
Understand and define the context and modes of use of the system.
Design the system architecture.
Identify the principal objects in the system
Develop design models.
Specify object interfaces.
System context and models of use:
The first stage in any software design process is to develop an understanding of relationships between the software that is being designed and its external environment. Developing the understanding helps you decide how to provide the required system functionality and how to structure the system so that it can communicate effectively with its environment.
The system context and model of the system use represent two complementary models of relationships between a system and its environment.
1 The system context is a static model that describes the other systems in that environment.
2 The model of the system use is a dynamic model that describes how the system actually interacts with its environment.
The context model of a system may be represented using associations where essentially a simple block diagram of overall system architecture is produced.
Architectural design:-
Once the interaction between the software system that is being designed and the system’s environment have been designed, you can use this information as a basis for designing the system architecture. You can combine your general knowledge of principals of architectural design and with more detailed domain knowledge.
The automated weather station is relatively a simple system and its architecture can again represented as layered model.
The three layers in the weather system software are
1. The interface layer which is concerned with all communications with other parts of system and with providing the external interfaces of the system.
2. The data collection layer which is concerned with managing collections of data from instruments and with summarizing the weather data before transmission to mapping system.
3. The instrument layer which is an encapsulation of all of the instruments that are used to collect raw data about weather conditions.
Object identifications:
There are various proposals about how to identify object classes
These objects are related to different levels in the system architecture.
2. The weather data object class encapsulates the summarized data from the different instruments in the weather stations. Its associated operations are concerned with collecting and summarizing the data that is required.
Design models:
Data model show the object or object classes in a system and where appropriate, different kinds of relationships between the entities.
An important step in design process is to decide which design models you need and level of details of these models. This also depends on the type of system that is being developed.
There are two types of design models:
The UML provides a number of possible static and dynamic models
Object interface specification:
An important part of any design process is the specification of the interface between different components in the design. You need to specify interfaces so that objects and other components can design in parallel.
Designer should avoid interface representation information in their interface design.
E.g. array representation of stack may be changed to a list representation without affecting other objects with use of stack.
Object interface design is concerned with specifying details of an interface to an object or to a group of objects. This means defining the signatures and semantics of services that are provided by the object or by the group of objects.
Design Evolution:
An important
advantage of object oriented approach to design is that it simplifies the
problem of making changes to the design.