M2M4RIA

A mechanism which adds support for many-2-many relations to WCF RIA services
Download

M2M4RIA Ranking & Summary

Advertisement

  • Rating:
  • Publisher Name:
  • MdeJ
  • Operating Systems:
  • Windows 2K / XP / Vista / 7
  • File Size:
  • 117 KB

M2M4RIA Tags


M2M4RIA Description

M2M4RIA was developed to be a mechanism which adds support for many-2-many (M2M) relations to WCF RIA services. Entity Framework is able to "hide" the join table (i.e., the table connected to Patient and Doctor). This gives the ability to directly access a Doctor's patient collection and a Patient's doctor collection. Underneath, entity framework also uses the join table. Entity framework only hides a join table if the table exactly has two columns: one of type A and one of type B. If more columns are present, the join table becomes visible in the entity model. M2M and RIA Unfortunately, RIA services doesn't support M2M relations with hidden join tables. If EF hides the join table, then RIA will not expose the M2M relation in the domain service. A common way to let RIA expose the M2M relation is by having the join table visible in the entity model, by introducing an additional column in the join table. The drawback of this approach is that one has to deal with these join table objects whenever accessing the M2M relation. So, instead of writing A.BSet.Add(new B()); one has to write something like: A.ABSet.add(new AB{B = new B()}); Querying and deleting also is a little more cumbersome. Another disadvantage is that, in order to enable M2M in RIA, the database needs to be modified, as well as the entity model. So, even when working directly on the entity model, one also has to deal with join table objects. Supporting M2M in RIA The M2M4Ria project aims at providing an implementation of M2M in RIA that does not require join tables in the entity model or in RIA. It provides full CRUD operations on M2M relations. The idea is to let RIA operate on our own provided join types, rather than on join types generated by EF. These join tables only serve communication between client and server, such that M2M relations can be sent and received to a remote client. At the client side a "view" on the M2M relations shows only B's to A, and A's to B (see picture below). You therefore no longer need join table objects to access M2M relations. Your entity model doesn't need any change for this.


M2M4RIA Related Software