Friday, November 7, 2003

RIAs and Patterns

RIA's are still in there infancy, a stage of development where it seems all you need to do to become an "expert" is write an article about RIA's.

As a Java developer Pattern's have become a way of life. If you are not using Pattern's you must by definition be a) Stupid, b) a very poor programmer, c) not professional or d) all of the above, Patterns are PC for Java developers.

As people talk more about RIA's and Flash I am seeing the mention of Patterns in association with these applications. Whilst there are some good points to pick up in these articles I feel that often the patterns are being misapplied in this context and that some people seem to think that you can make Flash "Professional" by making it "buzzword" compliant.

For example terms like "MVC" or "ServiceLocator" popup frequently. In Java we are really using these terms in the context of Web Application development. So people are using it in the same context with Flash RIA's, what's my problem?

Well its this, in Java a Web App is run from a Java App Server and it (mostly) responds to http requests. We are really talking about a Request driven model here. My controller is invoked by a request and it in turn invokes methods in my business tier. This is all done synchronously, my controller(and my request
) always wait on the return of any method call The business method invoked returns back the result directly to the caller. Caller and callee are explicitly bound together. Within a users context at any one time only one method or line of code is executing. Only one response can ever be made back to a requester.

However in an RIA we have an Event driven model not a Request model. At any time, multiple business methods maybe invoked and the responses occur some time later in a random order. There is no explicit bond between caller and callee, a callee has to figure out (or be told) how to get a response back to the right caller.

What I am getting at here is the two environments are fundamentally different and as such just blindly applying patterns because they sound cool is not helping.

Also we should take into account that much of what is done server side is because of the restrictions of the HttpRequest model and limitations in the client side capabilities. Flash and Remoting remove much of those restrictions, but that's a discussion for another day.


No comments:

Post a Comment