Welcome Guest, Not a member yet? Register   Sign In
Best way to design OO classes
#1

[eluser]Jon L[/eluser]
So I've been working with classes/objects for awhile now, and while I can't say I've 100% grasped MVC (I understand the concept, just implementing isn't always fully clear), I feel comfortable working with classes.

Something I've struggled with, is what is the best way to design new classes?

Example: customers

I have two viewpoints when dealing with customers. One is that I would want to be able to focus specifically on a single customer, and the class deals specifically with the currently loaded customer

The other is that I may want to do large scale selects, updates, etc, to customers. I don't want to have to do individual queries per customer (which would be the case using the previous viewpoint), as that's not efficient, but I *do* want to ensure that all changes to the customers are processed by the managing class, so it can execute any triggers if needed, based on the data that's changing.


What do you do for situations like this? Do you favor the focused single-customer view, or do you favor the large scale overview, or have you found a good solution for dealing with both?


Messages In This Thread
Best way to design OO classes - by El Forum - 12-02-2008, 10:43 AM
Best way to design OO classes - by El Forum - 12-03-2008, 03:53 AM
Best way to design OO classes - by El Forum - 12-03-2008, 05:09 PM
Best way to design OO classes - by El Forum - 12-08-2008, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB