Object Oriented Approach vs Function Oriented Approach

  Object Oriented Approach:  

  Object orientation is simply a way of thinking about or analysing a problem for which we want a software solution and for eventually developing the solution. To use this approach means that we have to learn to orientate our thinking and eventual understanding of a problem in terms of objects( and groups of objects) which make up the essentials of the problem. By focusing our thoughts and reasoning in this way, we are able to achieve a higher level of abstraction that is closer to the our real-world environment.

It is a way:

-of managing complexity

-of viewing a system(typically a software system)

-of understanding about a system in the way we are used to.

-of modeling a system.

OOA views the world as objects with data structures and behaviors and events that trigger operations, or object behavior changes, that change the state of objects.

It maps the real world problem domain as objects which reflect the capabilities and attributes of a system and classes which are a description of groups of objects with uniform set of attributes and services.  

  OOA potential benefits :  

·                 Better modeling of the problem domain (greater user satisfaction)

·                 Improved overall software design with a focus on class structure

·                 More flexible and maintainable systems through better class partitioning

·                 Good documentation (notations)

·                 Single central overall design notation(the Object Model)

·                 Flexible approach to project phasing

·                 Assistance in tie-ing down requirements

·                 Better long term efficiency  

 

  Function Oriented Design  

A function oriented design strategy relies on decomposing the system into a set of interacting functions with a centralized system state shared by the functions. Function oriented designs conceals the details of an algorithm in a function but system state information is not hidden. Side effects can kill you. Functions have a local state but shared system state is centralized and assessible by all functions. This approach is best when the amount of system state information is minimized and information sharing is explicit.

The best- known design methods are function oriented, which means that they focus on the algorithm to solve the problem.

Two simple rules of the stepwise refinement principle of problem solving:

· Decompose the task into subtasks,

· Consider each subtask independently and decompose it again into subtasks.

Continue the ongoing decomposition of large tasks into smaller subtasks until the subtasks become so simple that they can readily be expressed with statements in the selected programming language.

 

 

 

 
  Attributes of Function Oriented Design  

·       Function-oriented design is an approach to software design where the design is decomposed into a set of interacting units which each have a clearly defined function.

·       Functions have local state but shared system state is centralized and accessible by all functions.

·       It has been suggested that function-oriented design is obsolete and should be superseded by an object-oriented approach.

·       However, many organizations have developed standards and methods based on functional decomposition.

·       Many design methods and associated CASE tools are functionally oriented.

·       Function-oriented design conceals the details of an algorithm in a function but system state information is not hidden.

·       Changes to a function and the way in which it uses the system state may cause unanticipated interactions with other functions.

·       A functional approach to design is therefore most successful when the amount of system state information is minimized and information sharing is explicit.

·       Some systems, whose responses depend on a single stimulus or input and which are not affected by input histories are naturally functionally-oriented. 

 

 

  Function oriented vs Object oriented:  

It has been suggested that function-oriented design is obsolete and should be superseded by an object-oriented approach.

Unlike function-oriented design, in OOD the basic abstraction is not functions such as “sort”, “display”, “track”, etc., but real-world entities such as “employee”, “picture”, “machine”, “radar system”, etc.

In OOD: software is not developed by designing functions such as: update-employee-record, get-employee-address, etc. but by designing objects such as: employees, departments, etc.

Grady Booch sums up this fundamental difference saying: “Identify verbs if you are after procedural design and nouns if you are after object-oriented design.”

In OOD: state information is not shared in a centralized data. but is distributed among the objects of the system.

Function-oriented techniques group functions together if: as a group, they constitute a higher level function. On the other hand, object-oriented techniques group functions together: on the basis of the data they operate on.

Though outwardly a system may appear to have been developed in an object oriented fashion, but inside each class there is a small hierarchy of functions designed in a top-down manner.

 

 
  Why Object Oriented Analysis:  

At this current stage of preliminary system design, Object Oriented Modeling would be better suited for our system design purpose as it converts the real world objects into classes of objects that provides a clearer macro view of how individual components of the system interact with each other. However, this does not rule out the use of Function oriented analysis in the later design phase as it will aid in breaking down the major functions into smaller and more manageable sub-functions. Thus, it can be said that OOA and FOA are not mutually exclusive but rather complementary approaches to our overall system design.

 
1
Hosted by www.Geocities.ws