2

I'm developing an client-server application. In this application, Model classes are supposed to be in Server side whereas Controller and Views will be in Client side. I'm trying out Griffon to build User Interfaces. As Griffon implements MVC patterns and there is a convention of having Models, Views and Controllers in directory structure like app/models, app/views and app/controllers respectively. Also I'm using Spring to provide remoting service.

Now, my problem/confusion here about Griffon and Spring integration is that, Can I have Model classes in remote Server and still be in convention of Griffon?

What is the pattern to develop Client-Server application using Griffon and Spring?

TheKojuEffect
  • 20,103
  • 19
  • 89
  • 125

1 Answers1

0

Yes, you can have Model classes on the server however the UI still requires an object on its side in order to bind properties to UI components. This usually means you must have a "shallow" Model on the client side that reflects as many properties as needed. There are several remoting http://artifacts.griffon-framework.org/tags/plugin/remoting plugins that can be used. You can also try http://open-dolphin.org/dolphin_website/Home.html as it hides away the remoting layer and you only work with observable Models.

Andres Almiray
  • 3,236
  • 18
  • 28
  • 1
    How can I create a `Shallow Model`? I can't find the word `Shallow` in `Griffon in Action MEAP`. Is the concept explained in that book? – TheKojuEffect May 11 '13 at 06:10
  • A shallow Model is just like any other model class. What I meant by that is that it only contains properties that matter to the UI. Properties values are either filled from the UI or come from the server-side version of the Models. Server-side Models are the "real deal", because they interact with the application logic. – Andres Almiray May 11 '13 at 23:49
  • 1
    Is there any possibility that I can annotate server side class with `@Bindable` and have those classes automatically injected to controller. – TheKojuEffect May 12 '13 at 07:48
  • No. How would you make sure that data is serialized and transferred across client-server boundaries if the Model is simply annotated with `@Bindable`? I think opendolphin will be best suited for your use case, as it enables observable Model classes that transfer data transparently – Andres Almiray May 12 '13 at 13:34