posted 21 years ago
This is a puzzling requirement. What if an organization had a hundred people, so you have 101 objects in your Vector. Which one should you retrieve when you get("Person")?
Maybe we should be exploring richer data structures. Like a Vector for each classname and a Map to hold the Vectors. If you haven't run into Map yet, look at the API. It's a collection like Vector but you can get things out by a key like classname. So you could get the Vector of people using the key "Person"
All this talk of using classname is very dynamic. It will hold anything in the world, Oranizations, People, Toasters, Mini Coopers, etc. I wouldn't encourage this kind of generic storage thingy unless you really need to handle any kind of unforseen data.
If you have a model of a business with Organization and Person, maybe we should make a less dynamic object model of that particular structure.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi