Hi there,
I’m getting my head around modules, and wonder what would be the “CUBA way” to this:
- Suppose a “crm” module which holds the Party Entity and a PartyService,
- Now suppose a “collections” module which holds Receivable and ReceivableService.
“collections” does not really much case about “crm”, the only thing it cares about is that a Receivable belongs to a Party. But such a Party might today be provided by “crm” and tomorrow by “crmplus”. “collections” cares about some methods of PartyService and some details of Party (via getters).
On Java land I guess that would be an ideal case for interfaces (for Party and PartyService) to be held outside of “crm” like “crmapi” and that would be the “collections” dependency, thus “crm” can be changed at any time, even “collections” could be reused in another project that has no “crm” but provides a Party / PartyService.
But I’m not sure how that would work with CUBA. On the PartyService it seams clear to me that I can put the service interface in a module, and the implementation on another module and Spring will do its magic and things will work. But, how to do so on the Entity class? Maybe an abstract Entity on the crmapi?
What sideeffects should I be aware of?
Thanks,
marc
PS. I’m on BETA 7 but I think this question is not beta specific so I don’t add the “beta” tag to the post.