Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. God object problem

God object problem

Scheduled Pinned Locked Moved Design and Architecture
helptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Quake2Player
    wrote on last edited by
    #1

    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

    M C 2 Replies Last reply
    0
    • Q Quake2Player

      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

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      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

      Q 1 Reply Last reply
      0
      • M Mycroft Holmes

        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

        Q Offline
        Q Offline
        Quake2Player
        wrote on last edited by
        #3

        You didn't get the problem. I DO have a class Account, Message, Filter, etc.

        M 1 Reply Last reply
        0
        • Q Quake2Player

          You didn't get the problem. I DO have a class Account, Message, Filter, etc.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • Q Quake2Player

            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

            C Offline
            C Offline
            CodingYoshi
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups