Guus Bloemsma wrote:
What I want to do is to just move GUI code plus one or more entities to the browser. This way simple businesslogic (that doesn't need backends like DB's) can be executed right there.

On GUI's, I'd like to share what's going on in the StreamFlow project. We started with a Swing WebStart client that executed the domain model on the client, using a REST EntityStore to get the data.

For various reasons we have now changed so the distributed part of the domain model runs on the server, and all interaction is done using the CommandQuerySeparation pattern, implemented using REST. What this means is that the UI first queries the server for data, which is returned as ValueComposites. The endpoint is served through REST, so the ValueComposite gets serialized to JSON and then deserialized on the client. The UI then views this, allows the user to make decisions, and then constructs ValueComposites representing commands which are POSTed or PUT back to the server, where they are consumed by an application service that executes the command in a local UnitOfWork.

This means that the client ONLY sees ValueComposites. No Entities of shared data is on the client. I have a client side part of the domain though, which is executed and stored on the client machine.

There are many advantages with doing this, including security, minimizing data transfer size, and concurrency management. One interesting sideeffect, since we are implementing the state transfer using JSON + HTTP, is that we can now easily create alternative clients for the application, including a simple feed reader for Atom variants of the data.

When the REST part for the client+server has stabilized in my code it will be contributed back to Qi4j. I also have LOTS of Swing UI helper code that will be shuffled back into Qi4j when it has stabilized.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to