View Full Version : Middle Tier Object Design

09-05-2003, 12:46 PM
This is just a quick question on your view of creating objects.

Is it better to have an object for each method?

i.e. obj1read, obj1write, obj1val - 3 objects

or - 1 object with 3 methods?

i.e. obj1 - - object
obj1_read - - method
obj1_write - - method
obj1_val - - method

What are your views on this?

09-15-2003, 08:21 PM
When you have an object per method you are really doing structured programming. When you have one object with three methods you are doing object oriented programming. Most people consider OO the better approach of the two.

I have done both (which shows my age) and prefer 00. The big advantages with OO are inheritance and data encasulation. The best use of structured programming that I found was the jods where millions of rows of data were being crunched in some nasty algoritm and run time was the major consideration. By doing some really bad programming, you could make the program run much faster.