Creating objects with automatic names
Wondering if anyone can shed a little bit of a light on something that has been puzzling me for a little while now.
I think it's best explained with a verbal example...
Let's say that I'm designing a program for a client at a GP Surgery. This program needs to have, within its UI, an area to register a new patient, taking various details (name, DOB, sex, etc), and creating two-way links with various other objects (doctors, nurses, etc).
Now, when this new patient is generated through the various inputs in the UI, how can I name the resulting new objects in a coherent manner. For example, the first patient object generated is called 'patient1', the second, 'patient2', etc.
Or is this not possible? If that's the case, is it best to add them to a map? With some form of uniquely generated ID instance variable that can then be searched for within the map?
Any advice, thoughts, comments, assistance, would be greatly appreciated. :)