[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


...difference between object oriented programming and...

<< Back to: Objective-C FAQ

Question by mohsin ali
Submitted on 10/14/2003
Related FAQ: Objective-C FAQ
Rating: Rate this question: Vote
what is difference between object oriented programming and structured programming?


Answer by ravi
Submitted on 4/14/2004
Rating:  Rate this answer: Vote
ravida

 

Answer by John
Submitted on 6/28/2004
Rating:  Rate this answer: Vote
Object Oriented programming is a superset of structured programming.  Structured programming is as follows:

--Program start
var
var
var

function { ... }
function { ... }
function { ... }

main { ... }
--- Program End

You have units of code, which operate on variables, and are called in reference to those variables, to follow a structure acting on those variables.

Object oriented is as follows:

--- Program Start
object {
var
var
function { ... }
function { ... }
function { ... }
}

var
var

function { ... }
main { ... }
--- Program end

Variables can be objects, which have their own data and functions.  Think like C and structures, except structures can have functions "in them" which operate specificly on their own data.  Thus, instead of referencing a function (a block of code) and telling it to operate on a variableq you reference an object and tell it to perform an operation, most often on itself, specific to itself, using its own data.  Instead of creating units of data to pass to functions which operate on them, you create objects and have them perform operations [on themselves].

Functions attatched to objects don't need a specific name; rather than task_struct_sort_children(task) and acl_rules_struct_sort_children(task), you can have task and acl_rules with task->sort_children() and acl_rules->sort_children(), which have completely different specific function but the same logical function, and operate on the specific instance of the object.

 

Answer by blackmagic
Submitted on 7/1/2004
Rating:  Rate this answer: Vote
object oriented is like calling someone from outside for help diong things in  their own way .whereas structure is like  you make  it up

 

Answer by bhoo
Submitted on 10/19/2006
Rating: Not yet rated Rate this answer: Vote
Structured Programming:- we can declare only the member
OOP :- we can declare members & define methods

 

Answer by purna
Submitted on 12/26/2006
Rating: Not yet rated Rate this answer: Vote
Structured Programming language can view like data and functions as separate entites, whereas Object oriented language view as data and functions are single entity by using class feature

 

Answer by muhammad umair
Submitted on 4/24/2007
Rating: Not yet rated Rate this answer: Vote
Object Oriented has attributes and functionality but Structures has only attributes.

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Objective-C FAQ


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.