Monday, September 13, 2010

Gum Healing Extraction

communication between the services and controller ... Global

Hello today I would like to raise another problem which I encountered during the development of the project. The problem concerns the transmission of data between the controller and the services (service). Take a simple example. We have functions that the downloaded data from a user creates a topic and post on the forum then returns the id of both the subject and post. And here there is a problem when we need to ask a lot of data with the function of the service.

my thoughts when I decided to refer to the request and response mechanism, which is usually used in WCF services. We obviously do not use them but thanks to our project will be prepared for such an eventuality.

communication between the service and the controller
Communication between the service and the controller looks fairly straight. How might initially seem a mechanism that applies only needlessly obscures the code but as the project develops standardized communication will help to receive and develop the project. I distinguish two types of messages: Request (request) and Reply (response). Correspond to their appropriate types: BaseRequestMessage and BaseResponseMessage. Both types inherit from BaseMessage. Example request and response: public class
 LogOnRequest: BasicRequestMessage 
{public
LogOnDTO LogOnDTO {get; set;}}

And here we have the answer: Public class
 LogOnResponse: BasicResponseMessage 
{public bool
isValidated {get; set;}}


With this communication mechanism, and it looks pretty clearly and we are able to receive data from multiple services. Of course, the appropriate services and tests have modified to work with our new mechanism. But this I will not describe just invite you to browse the sources.

0 comments:

Post a Comment