Create object in runtime

  • Thread starter Thread starter Allen
  • Start date Start date
A

Allen

I want to make a program which can allow the user to hire employees at
regular bases. In other words, every time an employee is hired the program
should be able to create an object by itself for that employee.
What I want is that; every time the user enters a new employee the program
will create a new object for such employee.

The user can enter, for example, the name and number of a new employee and
the program will create an object for such employee. The reason I want to
do that is I do not want to create 50 objects and latter know that the user
needs only 30 object or may be the user needs more than 50 object. At the
end, as the program will be used by different users, every user can have
exactly the number of objects needed.
 
A bit unclear...

It looks like you are looking for a data structure, such as
http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx that allows to store a
list of objects. Also depending on what the application does, you won't
necessarily have an object for each user. Sometimes you just have in memory
those objects the user currently deals with and they are retrieved/stored as
needed from a database...
 
Back
Top