Quite right, there is no written rule as such - it's completely subjective. But when a class reaches the size of the one 'Brenden Vickery' posted, I begin to think something is going horribly wrong. I'm only learning, myself, so I won't pretend to be any sort of authority on OOP, but perhaps this link will be of some use: http://c2.com/cgi/wiki?CodeSmell :tup:
Originally Posted by Tony Marston
Having read one of your earlier posts, I also feel you've misundersood what the purpose of a single User class is. A User object should represent one user, no more, no less, and should encapsulate the properties and responsibilities of the real-life object. That is to say, I (in real-life) don't have the responsibility of storing information about myself in a database - as such, a User object should be completely unaware of any database interaction. This is the One Responsibility Rule. Any code which stores or retrieves information about the user should ideally be held in another class (described as a Mapper in this thread) becuase that is a completely seperate responsibility.
User <-> UserMapper ( <-> DAO ) <-> Database
As I said, I am myself only learning, so correct me if I've misunderstood what I've read elsewhere.
On an off-topic note: Tony, if your framework works for you then that's all that should matter. But (and it's a big "but") if you are going to post up all the intricate details of it on the web, surely you have to be prepared to take some criticism and advice from others?
Lastcraft most certainly does not need me to defend him, but over the past year he has constantly and consistantly proven himself to the members of this community and you'd do well to take his advice without being offended. Whether or not you choose to follow his advice is up to you, I know I certainly will...