V
vze1r2ht
I have many types of classes and I'm deciding whether to use a single
class or multiple classes for EACH type of class.
For an example:
User class has 3 classes associated with it:
User Class - Holds user properties. Has NO DB related methods (infact
has NO methods, only properties lol) etc
User Collection class - Holds a collection of user objects
User Manager Class - Performs all Saving/Loading/Creating operations
for a user object/collections.
Should I have all the functions/methods in User Manager class inside
the User class? I read some where that this is the BEST way and that I
should stop using a "manager" class because its the "old technique" of
coding back in the days of fortran.
Also, if I use a single class like User and store it in the
session...does it store all the methods and functions too? That could
be very costly.
A good thing I guess about having the 3 classes is that my DAL is
implemented in only the User Manager class.
So is single or multiple classes better?
class or multiple classes for EACH type of class.
For an example:
User class has 3 classes associated with it:
User Class - Holds user properties. Has NO DB related methods (infact
has NO methods, only properties lol) etc
User Collection class - Holds a collection of user objects
User Manager Class - Performs all Saving/Loading/Creating operations
for a user object/collections.
Should I have all the functions/methods in User Manager class inside
the User class? I read some where that this is the BEST way and that I
should stop using a "manager" class because its the "old technique" of
coding back in the days of fortran.
Also, if I use a single class like User and store it in the
session...does it store all the methods and functions too? That could
be very costly.
A good thing I guess about having the 3 classes is that my DAL is
implemented in only the User Manager class.
So is single or multiple classes better?