Genome messaging extensions (GMX)

The Genome messaging extensions (GMX) provide a package of framework features and tools to help you author distributed service-oriented applications using Genome on the server side.

GMX supports any communication architectures where data transfer objects (messages) of a service interface are (partially) composed of server-side Genome mapped business entities.

Because of their nature, Genome mapped business entities are not suitable for direct exposure on service boundaries: lazy loading, transaction management and update tracking bind them to the server they were instantiated on. Furthermore, it might be problematic to share implementation details of a business layer for one service with other components which communicate with that service. An explicitly designed and managed message contract on the service boundary helps reduce tight coupling and improves the system’s encapsulation.

However, in many cases, messages sent and received on service boundaries share many similarities with the business entities they are mapped to behind the service boundary. Although business entities and their implementation details are private to a service component, it can be helpful to establish a declarative mapping and transformation infrastructure between the business entities and messages.

GMX provides such an infrastructure that allows you to define different views on the business model of Genome mapped persistent classes. Instances of a view are represented as data transfer objects that can be exposed on the service interface. The service implementation can invoke transformations on the business model to build data transfer objects that are used to compose the messages required in the service contract. Additionally, transformations can be used to apply changes to the business model based on a view.

You as the developer declaratively maintain the view definitions from which GMX generates a data transfer (DTO) class for each view, and a transformation class that populates Genome business entities into the data transfer objects accordingly. GMX code generation is integrated with Visual Studio and MSBuild and performed using Microsoft’s Text Templating Transformation Toolkit (T4).

GMX provides different T4 templates to support various styles of communication architectures such as ASMX Web services, WCF and JSON. The templates are available in source code and can be customised to meet your requirements. Transformations and data transfer classes can be easily extended with partial classes and manually written event handlers.

This guide is composed of the following chapters:

·    Overview gives an introduction to the concept and purpose of GMX and explains the development workflow.

·    GenomeShop sample walkthrough gives an in-depth explanation of GMX based on the GenomeShop sample implementation.

·    Advanced topics covers scenarios beyond the scope of the GenomeShop sample implementation.

·    The end of this guide contains some additional Reference information on GMX.

There are a number of samples included with Genome to demonstrate how to use GMX:

·    {Genome installation folder}\Samples\CSharp\GenomeShop

·    {Genome installation folder}\Samples\CSharp\Extensions.Messaging

Please note that GMX is only provided in Genome Evaluation Edition and Genome Professional Edition (i.e. it is not included in Genome Express Edition).



Overview