I'm not sure if this question would have an OO or XML-based solution, but I'm posting it here to start..
For our server application, we have business objects (using VB.NET) that include all information that its calling applications require. However, each calling program will need different "views" of the data. Similar to a database view, there is information that is allowed to be viewed by some apps, and not others. Even entire objects can be restricted from some views.
Is there a way to use the same object (or base object) that can "transform" itself into the different views? Speed of object retrieval is important, so I am hoping there is some way to transform these objects without manually setting objects and properties. Perhaps through an XSL transformation? Or perhaps via some of .NET's serialization capabilities
Thanks
There i a big classic book called "Design Patterns". I recall something about View desing pattern...
> I'm not sure if this question would have an OO or XML-based solution, but I'm posting it here to start...
>
> For our server application, we have business objects (using VB.NET) that include all information that its calling applications require. However,
each calling program will need different "views" of the data. Similar to a
database view, there is information that is allowed to be viewed by some
apps, and not others. Even entire objects can be restricted from some
views.
> Is there a way to use the same object (or base object) that can "transform" itself into the different views? Speed of object retrieval is
important, so I am hoping there is some way to transform these objects
without manually setting objects and properties. Perhaps through an XSL
transformation? Or perhaps via some of .NET's serialization capabilities?
In what form are you returning the business objects currently? Is the
calling application able to dynamically handle an object that is "thinner"
than the complete object or will it expect the same object but with null
objects/null values in place of the restricted data? Finally are you
creating the objects as they are requested (knowing who the recepient is) or
do they already exist as a "full" object and you need to transform them to a
"restricted" object?
SP
aARON - 24 May 2004 14:26 GMT
>In what form are you returning the business objects currently?
The previous version of this software is VB 6 and not very OO, and did not have to address these issues. This version we are working on is in early stages of development
>Is the calling application able to dynamically handle an object that is "thinner
>than the complete object or will it expect the same object but with nul
>objects/null values in place of the restricted data?
Ideally we want the calling applications to know exactly what is in their "view" and is not even aware of other data out there. However, during this investigation, we are considering the approach where there is a "master object" that contains all information, and can ""shrink" itself according the calling application (so inappropriate fields are zeroed out or set to nothing).
>Finally are you creating the objects as they are requested (knowing who the recipient is) o
>do they already exist as a "full" object and you need to transform them to
>"restricted" object
Regardless of the solution, we will likely create a "master" object that contains all the information. The question is what to return to the calling applications. As I stated above, ideally, the view the application receives only contains properties/methods relevant to their view of the data. Obviously, this can be done by creating separate object definitions, but was hoping not to have to make multiple forms of the same object for each calling application's view, or to somehow take advantage of interfaces or inheritance
Hope that all made sense. Thanks for the help
Aaron