commons-fields: lightweight and GWT compatible alternative to GraphQL

34 views
Skip to first unread message

Gordan Krešić

unread,
Jun 27, 2021, 11:04:30 AMJun 27
to google-we...@googlegroups.com
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.

Reply all
Reply to author
Forward
0 new messages