There are two fundamentally different approaches to software design that are in use today: function-oriented design and object oriented design. The object-oriented approach is a relatively newer technology and is still evolving. For development of large programs, the object-oriented approach is becoming increasingly popular due to certain advantages that it offers. On the other hand, function-oriented designing is a mature technology and has a large following.
Function-Oriented
Design:
Function
Oriented Design is an approach to software design where the design
is decomposed into a set of interacting units or modules where each unit or
module has a clearly defined function. Basically,
the system is designed from a functional viewpoint.
A function oriented design strategy relies
on decomposing the system into a set of interacting functions with a
centralized system state shared by these functions.
In function-oriented design approach, the
system is comprised of many smaller sub-systems known as functions. These
functions are capable of performing significant task in the system.
This design mechanism divides the whole
system into smaller functions, which provides means of abstraction by
concealing the information and their operation.. These functional modules can
share information among themselves by means of information passing and using
information available globally.
Generic Procedure:
- Start with a high level description of what the software / program does.
- Refine each part of the description one by one by specifying in greater details the functionality of each part.
- These points lead to Top-Down Structure
Function-Oriented
Design Strategies:
The following strategies
are used to implement Function-Oriented Design:
Data
Flow Diagram (DFD):
Data
flow diagram is graphical representation of flow of data in an information
system. Data-flow design is concerned with designing a series of functional
transformations that convert system inputs into the required outputs. The
design is described as data-flow diagrams. These diagrams show how data flows
through a system and how the output is derived from the input through a series
of functional transformations. Data-flow diagrams are a useful and intuitive
way of describing a system.
Data
Dictionaries:
Data
dictionaries are simply repositories to store information about all data items
defined in DFDs. A data dictionary lists all data elements appearing in the DFD
model of a system. The data items listed contain all data flows and the
contents of all data stores looking on the DFDs in the DFD model of a system.
A data dictionary lists the
objective of all data items and the definition of all composite data elements
in terms of their component data items.
Structure Charts:
Structure
chart is a chart derived from Data Flow Diagram. It represents the system in
more detail than DFD. It breaks down the entire system into lowest functional
modules, describes functions and sub functions of each module of the system to
a greater detail than DFD. Structure chart represents hierarchical structure of
modules. At each layer a specific task is performed.
Pseudo-code:
Pseudo-code notations can be
used in both the preliminary and detailed design phases. Using pseudo-code, the
designer describes system characteristics using short, concise, English
Language phases that are structured by keywords such as If-Then-Else, While-Do,
and End.
Object-Oriented
Design:
Object-oriented design
(OOD) is an approach to software design that uses a process of defining objects
and their interactions when planning code to develop software. In object oriented
design approach, instead of concentrating on function, we concentrate upon
objects. An object contains both data and function which are used to create
applications.
OOD approach is mainly
the process of using an object methodology to design a computing system or
application. This technique enables the implementation of a software solution
based on the concepts of objects.
An object-oriented
design process involves designing the object classes and the relationships
between these classes. In the object-oriented design approach, a system is
viewed as a collection of objects (i.e., entities). Each object has its own
state and behavior.
Concepts of Object Oriented Design:
The important concepts of Object Oriented Design:
Objects: All entities involved in the solution design are known as objects. For example, person, banks, company and customers are treated as objects. Every entity has some attributes associated to it and has some methods to perform on the attributes.
Classes: A class is a generalized description of an object. An object is an instance of a class. Class defines all the attributes, which an object can have and methods, which defines the functionality of the object.
Messages: Objects communicate via messages. Messages are implemented as procedure or function calls.
Abstraction: It is used for handling complexity. Removes irrelevant data and shows only essential data.
Encapsulation: It is the concept of information hiding. In OOD, the attributes (data variables) and methods (operation on the data) are bundled together is called encapsulation. Encapsulation not only bundles important information of an object together, but also restricts access of the data and methods from the outside world. This is called information hiding.
Inheritance: This is the ability of a class to extend or override the functionality of another class. OOD allows similar classes to stack up in hierarchical manner where the lower or sub-classes can import, implement and re-use allowed variables and methods from their immediate super classes. This property of OOD is known as inheritance. This makes it easier to define specific class and to create generalized classes from specific ones.
Polymorphism: This is the ability to define different functions or classes as having the same name, but taking different data type. OOD languages provide a mechanism where methods performing similar tasks but vary in arguments, can be assigned same name. This is called polymorphism, which allows a single interface performing tasks for different types. Depending upon how the function is invoked, respective portion of the code gets executed.
0 Comments
if you have any doubts plz let me know...