Presentation Data Model
One of the most common presentation layer design patterns is Model – View – Controller
(MVC), which separates layout, behavior and the data model aspects of the presentation
layer. This generator helps building a rich data model for the presentation layer
based on Xomega Framework
- a powerful open-source framework for building multitier WPF or Silverlight applications.
One of the most important features of this generator is that it uses the structure
of the service layer to generate the presentation data model rather than
the actual structure of the business layer, which could be significantly different.
This allows generating a presentation data model that is much more appropriate for
the user interface. Indeed, if you think of it, the presentation layer is communicating
with the service layer to read the data or make changes to the data and therefore
should be based on the structure of the service layer.
However, a single form can be using multiple service operations for reads and updates,
so its structure will have to combine the structures of the operations it is using.
Xomega object model allows declaring a presentation data object and indicate the
parts of operation structures that it should consist of.
For example, let’s assume that we have an Order Details form that has a OrderObject
as a data model. To read the data and to make changes the form will be calling Read
and Update service operations on a Order Business Object. The structures of these
two operations may be similar but not identical and also potentially different from
the structure of the underlying Order Business Object. For the OrderObject to be
able to hold the data that has been read or will be sent for updates, it needs to
combine the sets of parameters for both operations. If two parameters have the same
name, they will result in generation of a single property as long as they have the
same type.
The generator takes all presentation objects defined in the model and generates
partial classes that subclass base Xomega data objects and have a set of Xomega
data properties as specified in the model. The types of data properties will be
based on the logical types of the corresponding parameters and the mappings between
the logical types to the Xomega data properties as specified in their configurations.
The generated data objects can be regenerated at any time whenever the object model
is changed. Therefore, the generated files should never be edited manually and all
additional functionality needs to be implemented in the partial classes that are
located in separate files.
|