One featrue that is clearly missing in OpenRiaServices Services is support for many-2-many(M2M) relations. If your data model contains M2M relations they will not be exposed to your client by RIA Services. You will have to modify your data model and replace each M2M relation by two 1-M relations and introduce a link table entity that connects both sides of the M2M relation.

M2M4RIA (as its name indicates) adds support for M2M relations on top of RIA Services. At the server side, it creates a "link table" view for your M2M relations, while in your Silverlight client, it creates an "M2M" view on top of 1-M relations (see Figure 1). A link table view for one side of an M2M relation, represents this relation as a 1-M relation with corresponding link table entities. An M2M view in your Silverlight client, does the opposite, it hides the link table entities and provides a pure M2M relation. For RIA Services, a link table view is nothing special. It is just a 1-M association between one entity and another (the link table entity). Consequently, it doesn't need to know anything about M2M and can just manage and transfer the link table entities back-and-forth between your domain service and your Silverlight client. The operations for your M2M relations that are exposed by your domain service are therefore just CRUD operations for link table entities.

Figure 3: M2M Views

Last edited May 10, 2014 at 7:28 PM by MdeJ, version 3


No comments yet.