Converting procedural type code to OO code

M

Mohitz

Any pointers as to how one should go about porting procedural type
code into object
oriented code??
 
L

liqfemail

Any pointers as to how one should go about porting procedural type
code into object
oriented code??
From my perspective, the most importance point is that you should put
data and relevant operations in one class. What's more, only when
necessary, data and operations should be "public".
In addition, inheritance, encapsulation and polymorphism are the three
major characteristics of object-oriented programming.
 
V

Victor Bazarov

Mohitz said:
Any pointers as to how one should go about porting procedural type
code into object
oriented code??

Simple: don't.

If you have a model you need to program, program that model.
But don't "port" anything anywhere.

V
 
O

osmium

Victor Bazarov said:
Simple: don't.

If you have a model you need to program, program that model.
But don't "port" anything anywhere.

That sounds like pretty good advice to me. I wonder if that is how
Microsoft Foundation Classes came to be? Someone told someone to convert
the code into objects and they came up with wrappers that no one outside of
Redmond could love.

If you are told to do it and can't get out of it, I would say "just do it".
 
J

Jim Langston

Mohitz said:
Any pointers as to how one should go about porting procedural type
code into object
oriented code??

Object oriented code is a different paradigm than procedural code. Meaning
that the design of the entire program is usually different in an OOPs
langauge than a procedural language. Trying to force procedural code into
OOPs wrappers doesn't do much to change the paradigm of the code itself.

So basically, don't.

It is better to design an object oriented program from the ground up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top