Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 15198
  • Last Modified:

OOP vs Structured Programming

I have a quick questions.  I'm doing some discussing with my developers and they can't tell me what structured and object-oriented programming is.  Can an expert tell me what structured and object-oriented programming is and the pros and cons of each type.  As an experience programmming which is your favorite and why.  
6 Solutions
Structured Programming:~
Structured Programming (also known as modular programming) is a technique to organize a program in hierarchy of modules with a single entry point & a single exit point. It can also be said a hierarchial flow of programs which is a subset of procedural programming. Three kinds of flow control are used, sequential, test and iteration.

Pros: As Structured Programming enforces a logical structure on which the program being written. For this it is more efficient and easier to understand and modify.

Cons: No have much support for structure for data to the model.

Object Oriented Programming:~
Object Oriented Programming can be said one type of structured programming that uses structured programming for program flow and adds more structure for data to the model. In words "Object Oriented" means a collection of discreate objects that incorporates both data structure and behavior. OOP generally has four aspects: indentity, classification, polymorphism and inheritance.

Advantages of OOP over Structured Programming:~
[1] OOP combines Data and Behavior

[2] OOP promotes sharing at several different levels. Inheritance of both Data Structure and Behavior allows common structure to be shared among several similar subclasses without redundancy.

[3] Emphasis on Object Structure, not Procedural Structure. OOP stress specifying what an object is, rather than how it is used.

[4] Synergy, that means each concepts of OOP (indentity, classification, polymorphism and inheritance) can be used in isolation, but together they complement each other synergistically.

Those all the reasons why I prefer OOP over Structured Programming.
Hope you can understand what I'm trying to express.

Thanking You
Also take a look at the following Lecture:~

May be familiar with the following, anyways these are also informative:~
[1] http://en.wikipedia.org/wiki/Structured_programming
[2] http://en.wikipedia.org/wiki/Object-oriented_programming

all the best

hi engineer2006

MilanKM  already give very informative information about OOP vs Structured Programming.
I want to tell in what way is object-orientated methodology better than structured methodology?

This gets down to the programing equivalent of "religious issues" to give you a complete answer. Different people (even different experts) will see the question in a different light.

Object-oriented programming in its pure form allows you to design classes of objects, then create instances of those classes. A class is basically a "template" for the object, in that the class knows what kinds of things the object needs to know about (attributes), and what kinds of things the object does (methods). When you use this class template to instantiate or create an instance of an object, you basically cause a new object represented by that class to exist in the scope of your program.

Particularly when modeling physical objects with complex interactions such as planets, communications equipment, invoices, etc., the object model allows the developer to think on a different level of detail than is typically possible with structured code. The developer can think about what attributes an object needs to know about and how the object needs to act on those attributes. The system then tracks much of the detail involving interactions of objects, and manages much or all of the "gory details" of memory management, etc.

OOP languages also usually support inheritance, which means that you can define general objects that have basic features common to whole sets of objects, then build upon those generic definitions to create more specific objects from them. For instance, if you have a generic object for a Christmas tree decoration it might have characteristics like weight and color. You could then subclass this general definition to make new classes for light strands, garlands, and glass bubbles, each of which would have the basic weight and color, but would add new attributes and methods that would further define these new subclass of objects.

Simple tasks are usually much better accomplished through structured programming. Structured programming uses a "divide and conquer" metaphor, much like the way that outlining is taught in grade school. First pick out the major tasks that need to be accomplished, and these tasks become modules. Within each task or module, identify components or building blocks and they become functions. This stepwise refinement allows a problem to be broken down into its component pieces, and (at least hopefully) cleanly converted to application code. Typically, this results in FAR less overhead for the machine to execute in order to solve a problem than an OOP solution requires to solve the same problem.

There are a number of languages such as C++, Perl, C#, etc., that allow you to use either approach at will. Problems that are object oriented can be solved that way, while problems that are not can be solved using structured programming. There are a few trade offs when using these languages, but they generally offer the developer the most choice in how to deal with a problem.

If I had to create a model of an aquarium that would graphically show what happened over time, I'd definitely choose an object-oriented approach. If I had to write a script to backup my database and verify that the backup was safely and completely stored on another server, I'd choose the structured programming approach. Many times the environment in which my code must run selects which method I have to use, and sometimes those solutions become quite "interesting" due to the choices of tools available.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Just want to add one more point.

Structured Programming gives importance to logic rather than data. The data is not at all protected and can be modified by any anyone.

Object Oriented Programming gives utmost importance to data. Only the prefered set of methods can modify the data. Here data is not accessible to everyone.
Following OO , u can create reuseable components which is one of the best advantages that OOP is having over Structured Programming.

Hope i have not repeated the point.

Again,sorry my comment wasn't received .I have to add that on the roots of the structured analysis there's the base at the Yourdon siteL www.yourdon.com
If You use OOP tools like .Net or Java use OOP ,if procedural language like Perl use structured
If your developers don't know the difference I'd look for new developers. ;)

My favorite is whatever the solution calls for.  You're certainly not going to create an object model for running batch scripts on a server.
what is better?
Both and noone! It follows by the argument you want to threat. If you are speaking of neural intelligence both are no good and neural-net programming could be better.
If you are speaking of problem like what is the result of 2x2? Both structure could be good.
So, the question isn't what is the better, but what is the better in a context!
Programming could be applied to many algorithm (from cooking algorithm to space-robot algorithm).
The principal differences between them are given by the argument and structure they use:
ObjectOriented uses Object (and all this give you)
Structured uses some simple construct and simple data
Functional uses the function to construct the knowledge
Definitional uses the definition to manipulate algorithm data and logic
and so on.

Hope now is more clear for you.
Bye, Giant.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now