Rich Internet Application - Part II



In my previous article, we were discussing the Rich Internet Application architecture. Now we will go a little in-depth about what a Rich Internet Application is.

Rich Internet Application Architecture

RInternet1.gif

From the above diagram a quick question will arise in all of our minds.

By placing the presentation logic in the client side, how does the presentation and business layer communicate?

For that is the WCF RIA Services.

WCF RIA Services

The main role of a WCF RIA Service is to provide a complete view of an application by having presentation view on one side and the database side on the other end. It generally simplifies the overall development tasks.

Domain Service and the Domain Context are the two key things that play a vital role in WCF RIA Services.

RInternet2.gif

Domain Service

It generally exposes a set of methods required by the presentation layer for querying and returning the set of data. We can simply say it encapsulates the business logic of an application. To define a domain service, you should specify set of operations that are permitted through the domain service. Following methods can be added to a domain service

  • Insert
  • Update
  • Delete
  • Query

Domain Context

You cannot directly interact with the Domain Service; for that a special context is required, the Domain Context. Generally a Domain Context communicates with the Domain Service to create a Channel and passing it to a service contract that was generated from the Domain Service. It's mainly responsible for providing access to the data through a series of operations.

How to Display Data on the client?

From the above diagram, it's clearly understood that Domain Service is in server side whereas the Domain Context is client side. Visual studio automatically generates the code for domain context based on your domain service class. To display the data you can select any controls like ComboBox, ListBox, or Gridview which supports the data binding directly to the entity collections on the data context.

From the above explanation it's clearly understood that creation of a Rich Internet Application is simple in Visual Studio. It will be very interesting to develop this kind of application. Mainly Rich Internet Applications are widely used for Business Applications.