471,321 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Collecting Groups of [3 Objects]

What are some reasonable options for storing collections of [3 related
object variables]. I see that there are plenty of options for storing
collections of individual items (e.g., string or int array) or for
name/value pairs (e.g., hash table). But I have a need to create some sort
of a collection that lets me collect groups of 3 object variables, like
this:

object_1a object_1b object_1c
object_2a object_2b object_2c
object_3a object_3b object_3c
object_4a object_4b object_4c
etc...

Each of these will be for instances of the MVP pattern - so for example
object_1a would be a Model instance, object_1b would be the associated
Presenter and object_1c would be the associated View object (custom Form).

Code then encapsulates this collection would need to be able to search this
collection for a specific Model instance and then be able to return its
associated Presenter or View.

Thanks for your time and consideration.

-Jeff
Feb 17 '06 #1
1 1026
If it were me, I would probably create a struct with an Array in it to
store object_1a, object_1b etc...

then add the structs to another arraylist, so then when you access one
struct, you get the object refs from the arraylist within the struct

Feb 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.