Exposing warnings\errors from data objects (that are also list returned)
- by Oren Schwartz
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.Moreover, some services return one objects, others retrieve a list of them (thus disables throwing exceptions).
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. Could you please direct me to a respectful design pattern ? what dp will do best here ?
Thank you very much!