(I spent most of yesterday arvo and all of last night dragging out my old Fowler/Ambler/Hay books and links trying to get a clue on this one. Although they mention it no-one seems to have provided a solution. So here goes.)
I'm trying to decide on an ORM strategy for this project. That is to say, a plan for generally when to use which ORM pattern for a particular piece of the old "impedance mismatch" problem. In this particular case I cannot come up with a decision, in fact even to come up with a answer.
In one specific area of the
application, solution, we have a situation where the user is presented with a list of items (and key attributes) in the top of the UI and an editor panel in the bottom half of the form used to maintain the currently selected item. This situation is a "utility" use case, say "Manage CodeValues" where codevalues are a set of codevalue objects which are a key+attributes classifier that is used throughout the rest of the application to decorate, sort etc etc business objects. Clear as mud? Consider an (Australian) bushfire warning sign, like this
| http://theland.farmonline.com.au/multimedia/images/full/492714.jpg | - the object "day" has a fire risk rating that is presented to the user by the attributes of the pointer location and the sector color. In this project we have quite a few (dozens) of this type of attribute in the business objects. For example, one business object has an overall status, a scheduling status, a run status, two risk attributes and several "sizing" attributes (complexity, LOR, etc) |
Now, our fire ratings system in Aus has undergone a lot of scrutiny recently and the warning signs have been changed to
this --> i.e. new categories, labels and color schemes. This happens in my application quite a lot, in fact different jobs for different customers may use completely different schemes for the same attribute. That is fine, in fact that is what this utility is for, to allow easy maintenance of schemes on a per job basis. So, ... | http://www.abc.net.au/reslib/200909/r436236_2097106.jpg |
So much for background. Here's the core issue.
I am trying to develop a generalized way of accessing these data sets and their contents. (N.B.
not the data, this is already taken care of by postgresql very well via inherited tables.) Here's the prototype UI (ignore the errors please!)
Behind this facade is a collection, CodeValues, of the four listed codevalues for this type, viz "Normal", "Bad", "Other", "Indifferent" i.e. CodeValues is a collection of CodeValue's.
O.K. Does anyone know of a DAL pattern for accessing (read and write) for this dual view, list and entity? (Phew, that took a bit of writing. I was hoping I would have solved the thing by the time I'd written it. Nah.)
tia
bruce
p.s. The images are copyright "The Land" and the ABC, I hope I haven't broken any L..A.W. by posting their links here.