Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reasons to botherWhat changesOutcome
  • CC seems to be incomplete, over-promising interface
    • while claiming to be "the connection" to the data source it merely provides the conversion between different forms of the item (id → Vaadin Item → url fragment and back);
    • CC doesn't provide any child/parent relations API;
  • part of CC's functionality becomes obsolete with Vaadin 8
    • Vaadin Items are no longer there, the corresponding CC methods can/should go too;
  • It is hard to extend the CC interface. E.g. if we want to add API that provides support for item version look-up or support for item creation - we have to create the extending interface and then cast the CC to the extension;
  • CC is not generic (partially cause it is not possible to inject generics with Guice);

(lightbulb) Instead of single CC interface we can introduce a concept of a DataSourceSupport:

  • it would be based on an arbitrary DS definition attached to app/sub-app/view
  • it would manage so-called 'bundles' of utilities that provide various functionality realted to the data source.
    • once an app with JCR DS configured needs e.g. a Vaadin HierarchicalDataProvider, we can ask the DS support to give one. It looks up the bundle corresponding to JCR DS definition and sees if the bundle provides an HDataProvider.
    • Bundles are completely arbitrary, they may contain domain specific utlitites and components

Benefits

  • (plus) Flexible and versatile provisioning of DS components (properysets, data providers, hierarchy look-ups, to-string converters etc)

Concerns

  • (question) Such solution adds a bit of magic - DSSupport and DS Bundles are yet two more layers of indirection, though still they typically should be concealed behind IoC - maybe that is not a big deal?
  • (warning) It wouldn't be easy to provision generic DS components via Guice, the #newInstance(...) variant will work just fine.


Data binding in grids and tree grids

Reasons to botherWhat changes

Vaadin 8 brings in new concepts to the data binding

  • no more Item abstraction → no more JcrNodeAdapter
  • no more Container → no more JcrContainer

DataProvider

  • Container concept replacement: interface for querying the data from a datasource
  • Works with domain objects (e.g. JCR Nodes) instead of Items
  • Stateless by design (one can implement caching manually though)

PropertySet

  • Item concept replacement
  • Unlike Item is more or less stateless component itself - only describes how to interact with the domain object to access [and modify] its properties via funtional primitives (lambdas), e.g. via bean getter/setter method references.

Benefits

  • Simpler and slimmer way to connect to the datasources
  • Less memory consumption (no additional abstractions over the domain objects)
  • Easier to implement various providers (REST, ORM...)
  • Supposedly better implementation hierarchical data providers

Concerns

  • (warning) DataProvider still requires item indexing API
  • (warning) Size query API still needs to be implemented (bummer for JCR list views)
  • (question) Observation of the DataProvider changes is still to be drafted!

Complex fields

Reasons to botherWhat changesBenefits




...

Reasons to botherWhat changesBenefits




Content changed events

Reasons to botherWhat changesOutcome

Quirky way of communicating the data source changes

  • Requires manual actions of both sending the events and handling them. I.e. if I change smth in JCR and forget to send CCE, no one will ever know.
  • Apps that are not related to the changed data source still have to handle its CCE and see if they should react (hence ContentConnector#canHandleItem).

We should try to expose the data source observation utilities and subscribe to them where needed.

  • e.g. we have already the JCR observation mechanism that Vaadin's DataProvider can subscribe to in this or that way and just push the change notification to the UI automatically.
  • Whenever we change smth in the data source the UI is notified eventually.
  • For the data sources that do not have real time observation, we could easily provide a timer-based implementation that merely refreshes the UI periodically.

Benefits

  • Clear and re-usable data source observation mechanism.
  • Less boilerplate for the app developers

Questions

  • (question) Need to provide un-registration strategy. For some cases a mere weak-hashmap solution might work (question). We though should also make sure that once the view is dead, no observation left-overs are still hanging around



...

THE FOLLOWING STILL REQUIRES GROOMING

...