Sunday, June 27, 2021

commons-fields: lightweight and GWT compatible alternative to GraphQL

Over the last year I've put up a simple lib^H^H^H design pattern for working
with partially initialized object graphs. It is intended to be used both
client side *and* server side, it's GWT compatible and provides some
additional functionalities over GraphQL (in addition to tons of
functionalities from GraphQL missing, of course).

https://github.com/gkresic/commons-fields

For motivation and examples, see the Github wiki page.

Note: it isn't published and that was conscious decision: it is meant to be
used as *pattern*, customizing it for every particular project.

Another note: checkers getters (one that throw if a particular field isn't
initialized) works poorly with serialization libs. If you are using Jackson,
see FieldPropertyFilter in 'jackson' subproject and its usage in demo
subproject, but on the GWT side it's a bit more complicated, since neither
gwt-jackson nor domino-jackson support @JsonFilter.

I've created issue on this for gwt-jackson a long time ago, but nothing came
out of it:

https://github.com/nmorel/gwt-jackson/issues/164

So, for my own projects I'm maintaining (ugly) patched gwt-jackson available
here ('fields' branch):

https://github.com/gkresic/gwt-jackson/tree/fields

For example on how to build own CRUDFieldsService implementations, see
additional project:

https://github.com/gkresic/commons-fields-sql

Which uses yet another private lib (turtles all the way down...):

https://github.com/gkresic/commons-sql

If you prefer Hibernate/jOOQ or any other JDBC-alternative, it shouldn't be
hard to translate CRUDFieldsSqlService.java from commons-fields-sql (without
even looking at commons-sql) into some Hibernate/jOOQ alternative.

Comments welcome.

-gkresic.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/b069add0-1648-86f4-05a0-f1b905a42e00%40steatoda.com.

No comments:

Post a Comment