0

I began to develop a fairly large GWT-project, which naturally have a data model. And I want to comfortably work with entity-classes on client side.

I really liked Gilead, but this thread is not good news for me.

I do not want to use RequestFactory, because it makes writing very much boilerplate code and duplicate code.

Maybe someone knows alternatives to Gilead and RequestFactory that can help me in my project and supported by developers nowadays?

Thanks in advance!

Sergey Vedernikov
  • 7,609
  • 2
  • 25
  • 27

1 Answers1

4

IMO, there is no escape from boiler plate when working with GWT. I think the best option for working with data intensive apps, with sophisticated data models is RequestFactory. You can try to reduce the boiler plate by writing some code generation framework. For an example, take a look at GWTP's annotation based code generation facilities , that can generate a lot of boiler plate required to work with MVP. Specifically, GWTP can generate Action and Result classes that encapsulate the command you want to sent to the server and the result returned from server.

A similar code generation facility for boiler-plate related to RequestFactory can ease your burden significantly.

For example, you can have an annotation for generating Entity Proxies from entity classes. You'll put this annotation on your entity class along with @Entity and configure an APT processor to generate related EntityProxy class. Similar approach can be taken for generating value proxies.

Your application specific RequestFactory and RequestContext interfaces are not boiler-plate, even if they appear to be such at first glance. Same goes for the server side implementation of entity classes.

Locator and ServiceLocator are entirely optional. You'll only need them if you you don't want to implement persistence code in an entity itself.

That leaves us with the client-side code. You can look at how GWT Editor framework works with RequestFactory to get ideas on how you can write generic client-side code to work with a lot of different RequestFactory interfaces.

Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69