What should I look at to choose to code in OO vs. procedural code? I have a big project I am starting and I am thinking that I should do the main code as procedural but do all the DB interaction in OO to allow for easier changes to the system in the future. Does anyone know what all factors I should look at when choosing what to use for a particular part?
If the code manipulates an object (such as a DB table), then use OO. If your function is a standalone routine, use procedural in a namespace or static class (such as Math.abs, etc...). If your code falls into neither category, shoot yourself in the face 'cause you're wrong.
Kllrnohj wrote:
If the code manipulates an object (such as a DB table), then use OO. If your function is a standalone routine, use procedural in a namespace or static class (such as Math.abs, etc...). If your code falls into neither category, shoot yourself in the face 'cause you're wrong.


ok, I get that. The issue is what to do when manipulating multiple independant objects? I will have to manipulate groups of different sizes of the same object along with info from the user and create a new object from all of that. I can't figure out an effecient oo way to implement that. My thought was to put each object type with an oo interface and then create an instance per object needed in the calculations and then do the actual calculations in procedural code.

Thanks
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement