Design Question
Michael Deninger <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
I have a design question that I would like to bounce off some of you more experienced WO developers.. I have some static data that I need to access from within an EOGenericRecord. The data, unfortunately, is not in the DB (and even if it were, creating a relationship to the entity would likely not work for various reasons). The data is essentially a dictionary of keys / values that describe the meaning of the coded values in one of the database tables. E.G. Entity: PatientAllergy Attribute: AllergyCode where AllergyCode is some number (say 83). The meaning of that number is in this dictionary (e.g. value = 83, description = "penicillins") What is the best way to accomplish this? I have considered the following: 1) read this dictionary into my Application object at startup. Sounds great, but I cannot figure out how to access EOApplication from an EOGenericRecord 2) read this dictionary form disk into each EOGenericRecord at the time it is created. I think that this would work, but it creates a lot of unnecessary repetition of data. 3) hard-code the dictionary into an abstract class extending EOGenericRecord and have the Entity inherit from it. Obviously, I would love to use 1) but I am stuck as I describe above... Is there any way to accomplish number one or are there other alternatives that I have not thought of or considered? Thanks! Mike