SubpackageEnum (enum)
A default implementation of Subpackage that constrains how (the classes in) subpackages across and within modules can reference either.
API
enum SubpackageEnum {
dom (1)
api (2)
app (3)
menu (4)
contributions (5)
subscribers (6)
restapi (7)
spi (8)
spiimpl (9)
fixtures (10)
seed (11)
integtests
final List<String> local;
final List<String> referencing;
String getName()
List<String> mayBeAccessedBySubpackagesInSameModule()
List<String> mayBeAccessedBySubpackagesInReferencingModules()
}
1 | dom
The domain object model module, containing the main business logic of the module. |
2 | api
Optional, constitutes a formal API to the module. |
3 | app
Optional, but if used then will hold view model that implement some sort of assisted business process, for example dashboards, or filtering. |
4 | menu
Holds the menus that are visible in the UI. |
5 | contributions
Holds mixins that contribute functionality to OTHER modules. |
6 | subscribers
Holds domain services that subscribe to events fired from OTHER modules. |
7 | restapi
Holds the menus that are visible as the REST endpoints. |
8 | spi
Define an interface for OTHER modules to implement; this is therefore an alternative and more structured way to decoupled modules. |
9 | spiimpl
These are this module’s implementations of OTHER modules' SPI services. |
10 | fixtures
Fixture scripts used to setup the systen when prototyping and for integ tests. |
11 | seed
Seed scripts used to setup the systen, for example reference data). |
Members
dom
The domain object model module, containing the main business logic of the module.
Typically consists of entities and view models and associated repositories and stateless services used by those entities and view models.
api
Optional, constitutes a formal API to the module.
If used, then access to the dom module is likely to be restricted to only the subpackages of its own "local" module with no access granted to subpackages of other "external" referencing modules.
app
Optional, but if used then will hold view model that implement some sort of assisted business process, for example dashboards, or filtering.
menu
Holds the menus that are visible in the UI.
These should only be called by the framework, not programmatically (except for tests).
contributions
Holds mixins that contribute functionality to OTHER modules.
Mixins are one of the main techniques for decoupling dependencies between modules.
Note that mixins to THIS module normally would just live in the dom subpackage, eg dom.mixins .
subscribers
Holds domain services that subscribe to events fired from OTHER modules.
Subscriptions is the other main technique for decoupling dependencies between modules.
restapi
Holds the menus that are visible as the REST endpoints.
These should only be called by the framework, not programmatically (except for tests).
spi
Define an interface for OTHER modules to implement; this is therefore an alternative and more structured way to decoupled modules.
With events, the module that emits the event doesn’t know much about what the action to be performed in the other module might be. But if we use an SPI, then this module will call all implementations of the SPI at certain well-defined points; so it kind of is like a lifecycle sort of thing.
Also, the SPI’s interface could be more exotic, ie "fatter" than the simple event.