Question

I am developing a GWT app using GWTP (Model-View-Presenter) that is deployed to GAE. Persistence will be done using Google Cloud SQL.

I am not sure what to use to send data to the database (persistence) and request data: GWT RequestFactory or GWTP Actions. Are they equivalent? What are benefits of each one for this scenario?

Thanks

Was it helpful?

Solution

For a data-oriented app (CRUD), you should definitely use RF because it has been designed for that purpose. Now if your app is more action-oriented and these actions does not involve much data, it’s better to use the Command pattern. But nothing prevents you from using both in your app.

OTHER TIPS

I wouldn't use Request factory as it stands right now. Even for CRUD it's much more complicated to us than GWTP Actions.

RF is a great and powerful tool, but it's a little bit over engineered and working with complex data can be really difficult with all the "frozen" states problems that you will end up having. The real problems comes while using the editors with nested structures. You'll have problems saving the second level of proxies and even more the third level. Using editors with nested structures is a lot more easier with the SimpleBeanEditorDriver since you don't have to deal with the nasty frozen state for each level of nested objects.

For a simple object graph with simple CRUD support, RF is perfect, but as soon as you go to more complicated structures, brace yourself, it won't be easy to handle. Once you become a RF expert, it become a really powerful tool, but it still require more work than GWTP Actions to accomplish the same thing.

For server side security using RF, I've used AoP. On the other side, you could use action handlers, but even by using action handlers, there's some case where AoP on a service call is more appropriate.

For client side batching and caching... that's something that is really hard to achieve with RF. The documentation is unclear and dealing with frozen state within the cache is a nightmare. With GWTP-Action, there's already a simple cache implementation that you can use.

RequestFactory only.

Everything you need is there. If you just want to send a basic message you just call a method with whatever parameters you want.

Problem with Actions is that they're a lot more verbose than RF semantics...

Only thing you don't get with RF is the ability to use ClientHandlers...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top