gargoyle60
2011-04-13 12:57:41 UTC
I would appreciate views on suitable options on collections for handling lookup associations.
In my application I need to retain database/authorisation (username/password) associations.
My application registers each database with a broker and may also request the broker to release an
individual database, which is identified uniquely by application/database/authorisation.
The way I have designed my application is to have the association between database/authorisation,
currently held via the Association class.
However, because my application may have multiple databases (each with its own authorisation) and
also utilize embedded sub-applications (each with further databases/authorisations) this means that
the Association instances themselves need to be stored in a master collection. I initially chose
Set.
The obvious alternative would be Dictionary, but it seems wasteful to have Dictionary with #key: as
database and #value: as authorisation (i.e. #value: has just a single object rather than multiple
associations). I realise that using Dictionary for a simple one-key to one-value lookup is quite
acceptable.
I was just wondering if other people had particular views on which collection to chose for my
association?
In my application I need to retain database/authorisation (username/password) associations.
My application registers each database with a broker and may also request the broker to release an
individual database, which is identified uniquely by application/database/authorisation.
The way I have designed my application is to have the association between database/authorisation,
currently held via the Association class.
However, because my application may have multiple databases (each with its own authorisation) and
also utilize embedded sub-applications (each with further databases/authorisations) this means that
the Association instances themselves need to be stored in a master collection. I initially chose
Set.
The obvious alternative would be Dictionary, but it seems wasteful to have Dictionary with #key: as
database and #value: as authorisation (i.e. #value: has just a single object rather than multiple
associations). I realise that using Dictionary for a simple one-key to one-value lookup is quite
acceptable.
I was just wondering if other people had particular views on which collection to chose for my
association?