God object problem
-
Hi, I think I've got a god object antipattern problem, or not, please tell me: I have a class Admin that contains several lists of things that might interact each other, for example: It contains a list of Messages, Accounts, Contacts, Filters etc. The problem is that some of them interact with each other.. for example, the AddMessage method applies all the filters in the filters list. The Admin class is pretty big.. because it haves Adds methods, Deletes methods, ..so it has like 2*(fields that are objects or lists of objects) methods Do i have a god class or is it well justified? In case I do have a god class, should I split the Admin class in several Administrators? like AccountsAdmin, ContactsAdmin, FiltersAdmin, ..? or what? Thanks
-
Hi, I think I've got a god object antipattern problem, or not, please tell me: I have a class Admin that contains several lists of things that might interact each other, for example: It contains a list of Messages, Accounts, Contacts, Filters etc. The problem is that some of them interact with each other.. for example, the AddMessage method applies all the filters in the filters list. The Admin class is pretty big.. because it haves Adds methods, Deletes methods, ..so it has like 2*(fields that are objects or lists of objects) methods Do i have a god class or is it well justified? In case I do have a god class, should I split the Admin class in several Administrators? like AccountsAdmin, ContactsAdmin, FiltersAdmin, ..? or what? Thanks
I would have an Admin PROJECT and a class for each of your entities (accounts, contacts etc)
Never underestimate the power of human stupidity RAH
-
I would have an Admin PROJECT and a class for each of your entities (accounts, contacts etc)
Never underestimate the power of human stupidity RAH
You didn't get the problem. I DO have a class Account, Message, Filter, etc.
-
You didn't get the problem. I DO have a class Account, Message, Filter, etc.
Quake2Player wrote:
In case I do have a god class, should I split the Admin class in several Administrators? like AccountsAdmin, ContactsAdmin, FiltersAdmin, ..? or what?
I assumed the admin for the classes is done in the one Admin class. I try to keep any lists etc in thier respective classes eg the Contacts list is always found in the Contacts class and admin uses the ContactClass.List, it never has a copy of its own list of contacts. If Filters need a contact or list of contacts it goes to the contact class, admin does the same. The only time I vary this is if Filters needs a special list of contacts and Thingy needs a different list of contacts for some reason. Then I allow the other classes to have their own lists internally.
Never underestimate the power of human stupidity RAH
-
Hi, I think I've got a god object antipattern problem, or not, please tell me: I have a class Admin that contains several lists of things that might interact each other, for example: It contains a list of Messages, Accounts, Contacts, Filters etc. The problem is that some of them interact with each other.. for example, the AddMessage method applies all the filters in the filters list. The Admin class is pretty big.. because it haves Adds methods, Deletes methods, ..so it has like 2*(fields that are objects or lists of objects) methods Do i have a god class or is it well justified? In case I do have a god class, should I split the Admin class in several Administrators? like AccountsAdmin, ContactsAdmin, FiltersAdmin, ..? or what? Thanks
Quake2Player, Read my reply to MyCroft Holmes question above and it should/might help you.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07