Results 1 to 7 of 7
  1. #1
    santeron is offline Member
    Join Date
    Apr 2011
    Location
    Athens, Greece
    Posts
    52
    Rep Power
    0

    Default Where should I store objects in my design

    Hello guys,

    I have a system that needs to store various kinds of information such as users, publications, meetings etc. I have various objects describing that sort of information but I am having a hard time choosing where to store the objects inside the design.

    Quick overview of the system: I have a SystemAdmin who registers users. I have a RegisteredUser who makes publications and meetings. I have Publications and Meetings.

    Where should I store the objects created by all these classes? Where should I store the "RegisteredUser" or the "Publication"? Should I use a "super" class with a bunch of collection objects or is it a bad design?

    I would like to avoid using a DBMS, but if you think it would get messy otherwise, I can give it a go. Thanks

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    santeron is offline Member
    Join Date
    Apr 2011
    Location
    Athens, Greece
    Posts
    52
    Rep Power
    0

    Default Re: Where should I store objects in my design

    I know how to store them, I don't know where. Having a control class that instantiates everything and stores everything makes any sense or is it a wrong design decision?

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default Re: Where should I store objects in my design

    What I am doing to keep the separation in different classes itself and retrieve when required.

  5. #5
    santeron is offline Member
    Join Date
    Apr 2011
    Location
    Athens, Greece
    Posts
    52
    Rep Power
    0

    Default Re: Where should I store objects in my design

    So having a "main" class with 2-3 collection objects in it to keep all the data in one place and accessor methods for those collections seems a good idea for you?

  6. #6
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default Re: Where should I store objects in my design

    I would say: Open your mind about what is the structure of your application. E.g. you can have the application for planning inside a company - you could have Company as superclass - each company has Employees and Projects, Projects may organize Meetings and have Publications... just a hint. You need a big picture, and even then sometimes there is more than one place where items/objects may have their home.
    So go and think of a tree like structure and maybe how objects relate to each other, just my 2 cents.

  7. #7
    santeron is offline Member
    Join Date
    Apr 2011
    Location
    Athens, Greece
    Posts
    52
    Rep Power
    0

    Default Re: Where should I store objects in my design

    Quote Originally Posted by Sierra View Post
    I would say: Open your mind about what is the structure of your application. E.g. you can have the application for planning inside a company - you could have Company as superclass - each company has Employees and Projects, Projects may organize Meetings and have Publications... just a hint. You need a big picture, and even then sometimes there is more than one place where items/objects may have their home.
    So go and think of a tree like structure and maybe how objects relate to each other, just my 2 cents.
    Thanks for the reply Sierra. I have done the UML class diagrams and I have done what you said. So I basically made the department class more or less a controller which holds collections of the other classes and provide functionality to use them :)

Similar Threads

  1. Replies: 8
    Last Post: 11-22-2010, 11:09 AM
  2. How can i store ArrayList objects in Access database
    By frankycool in forum Advanced Java
    Replies: 3
    Last Post: 11-04-2009, 07:55 AM
  3. Replies: 1
    Last Post: 01-22-2009, 05:25 PM
  4. Can I store multiple objects in an array
    By lareauk in forum New To Java
    Replies: 9
    Last Post: 05-29-2008, 04:57 AM
  5. Can I use vectors to store multiple types of objects
    By Nathand in forum Advanced Java
    Replies: 6
    Last Post: 04-28-2008, 08:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •