Tuesday, July 19, 2011

Creating domain services

Now that we have the Silverlight application, the database, and the Entity Data Model, we will now create the Domain Service class for the Entitites. I am not totally sure what the Domain Service will do, but I think it provides classes and API's which the application can call from the client side Silverlight control.

I right clicked on the 'Services' tree node, and selected, 'Add new'. Then I selected the 'Domain Service' class template, gave it a name, and selected the Entities we want to expose in the Domain Service.

Some noteworthy points and questions:
  1. What exactly is a domain service class?
  2. The domain service class extends the class 'LinqToEntitiesDomainService'
  3. The domain service class has the [EnableClientAccess()] annotation. Is this really an annotation, or is it something else. The () seem to suggest that it is invoking some method, so this might be a special syntax to specify that some internal method needs to be invoked at some time. Is this at build time, runtime ? Not quite sure.
  4. The entire namespace is enclosed in {}
  5. A file called EventManagerDomainService.metadata.cs was also created. This file has a bunch of partial classes. Need to find out what partial classes are.

1 comment:

  1. Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up.
    domain service

    ReplyDelete