I’m exposing Data objects via service oriented assembly (which on future usages might become a WCF service).
The data object is tree designed, as well as formed from allot of properties.
I now want to expose data flow warnings and wondering what’s the best way to do it having to things to consider: (1) seperation (2) ease of access. On the one hand, i want the UI team to be able to access a fields warnings (or errors) without having them mapping the field names to an external source but on the other hand, i don’t want the warnings “hanged” on the object itself (as i don’t see it a correct design).
I tought of creating a new type of wrapper for each field, that’ll expose events and they’ll have to register the one’s they care about (but totally not sure)
I’ll be happy to hear your thoughts.
Thank you very much!
IDataErrorInfo(re: comments on the question) is an interface. You can do whatever the heck you want. Said another way, it’s a concept that does sound like it’s a good place to start.IDataErrorInfo‘s properties could simply be accessors to a dictionary-like structure/object that contains field:errorMessage pairs. The dictionary has the field name as a string – no references to real Data objects at all.I can see
DataErrorobjects, if you will, mirroring the Data object hierarchical structure withIDataErrorInfoimplemented at each level. Given this common interface you can recursively drill down getting error message sets for any arbitrary level of the Data.