balvi / cuba-component-declarative-controllers

CUBA component that allows to write generic features for a Controller and use them in a declarative way
5 stars 6 forks source link

CUBA 7 support #12

Closed mariodavid closed 5 years ago

mariodavid commented 5 years ago

Hi @bresche @jhbaumgarten @alferink,

this PR should enable CUBA 7 support for declarative-controllers. With support I mean that it is able to be used within a CUBA 7 application with the now old AbstractEditor and AbstractLookup controller classes.

However, the new Screens API, that is introduced in CUBA 7 with StandardLookup, StandardEditor but more importantly the shift away from inheritance to delegation is not supported. (see: https://github.com/cuba-labs/screen-api-demos)

More interestingly - it might be that the recently introduced possibility to use Mixin interfaces in the controller classes (also CUBA 7) will probably shift a lot of use cases from this plugin to the framework itself (which is good - because it means less dependencies in the apps using CUBA). Also the event based approach from CUBA 7 will help out here. For an example see: https://github.com/cuba-labs/screen-mixins-demo

I'm not sure if you have seen the new CUBA 7 screen APIs possibilities. I think mid-term it make sense to keep this plugin as is. But perhaps it might be an interesting discussion how this plugin should evolve now that we have much more options on the table provided by CUBA directly.

I created this PR for an easy & fast upgrade path for applications from CUBA 6.10 to 7.0. This means - the lease amount of changes, only support for the old way. This gives the users (like a lot of my plugins) the opportunity to upgrade to 7.0 without the need to update everything to the new Screens API in the plugin hierarchy.

I've successfully run the cuba-example-declarative-comments example with this version:

bildschirmfoto 2019-01-26 um 21 16 58 bildschirmfoto 2019-01-26 um 21 17 07
muxa92 commented 5 years ago

Thank you for the contribution!