Hi Guys.
I am trying to find an elegant framework to arrange all of my server components.
The server:
1. Receives a request, as a XML string, from the client.
2. Validates the messages ( !null && !empty mainly).
3. Unmarshalls the message into a Request object.
4. Validates the internals of the Request object (ensures all the required fields are there, ie. id, requestName etc).
5. If valid, create a specific request (I receive a lot of extra information in the original request and I need a very small subset of it to process the request).
6. Process the request and retrieve the output.
7. Send the output to the client.
Currently, my design look something like this:
Controller{
processMessage(String requestMsg){
boolean isValid = validator.validate(requestMsg);
Request request = creator.createRequest(requestMsg);
isValid = validator.validate(request);
processor.processRequest();
}
The controller class is composed of the validators, creators and processors. Once a request is received, the template of validate - create - process is followed.
Now all of this works but I can't help to wonder whether I can arrange these components in a better way. Better being more loosely coupled.
Is there a framework which I could perhaps use? Any ideas, tips, links would be greatly helpful.
Cheers