问题描述:

Say i have some entity classes like:

avatar

category

set

well all of them have name and description so i inherit it from abstract class.

what i really want is, these classes need to be retreived from a database.

Where to code the querys?

a)

In external class, like "dbmanager" where you do something like dbmanager->sync(object_to_be_updated), then this class detects the class instance of object_to_be_updated, switch and does datbase stuff returning the updated object.

OR

b)

Having just a method on each avatar, category, set doing the properly stuff.

相关阅读:
Top