Why don you put the table structure in a separate Mapper class?
If you have a User class that performs some business logic that doesn’t interact with the database, wouldn’t you want a separate class that mapped a user to the database, either inserting or deleting or what-have-you? I disagree with this idea, for the following reasons: • By having properties and methods for an object contained within more than one class you are breaking the principle of encapsulation. • By having to access one class for database access and another for non-database access you are forcing the calling script to have knowledge of the internals of each class. This breaks the principle of information hiding. A better way to do it would be to have all properties and methods defined within a single class, and if a particular method requires to access the database then it should do so. If this involves communicating with a separate ‘mapper’ class (or in my case a data access object), then so be it. The important thing is that the calling script should not know or even care ab