View Single Post
Old 05-25-2004, 02:41 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
to put data methods inside class or not?

i have 2 classes:

customer
product

should i put all my customer functions inside the customer class? or should they be in a seperate database class?

for example, a customer has firstName,lastName ( and a LOT more properties )

should my searchCustomer(), addCustomer(), updateCustomer(), removeCustomer() etc.. be in the customer class? or should i have a seperate database class which manages the data.

there are a lot more classes than just customer and product, so if i make a database class ( as i already have ) it is going to get HUGE, .. but on the other hand, if i put all the customer methods in the customer class, will it be less efficient when i'm creating hundreds or thousands of new customer objects? ( in a search results for example )

maybe there should be a customerData class which just manages the data for the customer?

or would that be going overboard?
__________________
Mike
sde is offline   Reply With Quote