Hi, This seems a good idea to me (I already had this requirement but finally I could do without after a big redesign). However, I don't think that the choice of the key should be based on the "one attribute that is unique", what if more than one attribute is unique? Probably this should be a new property in the schema definition to indicate this fact.
Generally speaking, one common problem with HiveMind configuration currently is that whatever the configuration you always get a List injected (same problem with parameters to factories) This sounds awkward in particular for cases where the configuration (or parameters) define exactly one, or (0 or one) occurrences. In this case, having to call get(0) and cast it to the right Contribution code seems boring when you have done it a few times... Maybe having a better injection of Contributions in that case, that would directly pass the specific Contribution object (or null if no contribution was provided) would be "nice to have". Just my 2c. -----Original Message----- From: Liebig, Stefan [mailto:[EMAIL PROTECTED] Sent: Thursday, October 28, 2004 3:36 PM To: [email protected] Subject: Injecting of Configurations/Contributions I have very often the case that I have to convert the List of contributions into a Map for faster access. In such cases I have always marked a single attribute with unique="true". This attribute will get the key of my Map. The values will the corresponding contribution elements or their mapping class. I would like to have constructors of services such as: a) MyServiceOne( Map allContributions ) b) MyServiceTwo( List allContributions ) for both services their would be a constructor injection such as: <configuration>AllContributions</configuration> In case a) HiveMind should create a Map from �AllContributions� and in b) a List. Creating a Map requieres exactly one attribute/property marked as unique. Do other have similar needs? Stefan Liebig compeople AG Untermainanlage 8 60329 Frankfurt fon: +49 (69) 272218 - 0 fax: +49 (69) 272218 - 22 email: [EMAIL PROTECTED] home: www.compeople.de --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
