private void assembleContextLayer(LayerAssembly contextLayer) throws AssemblyException { ModuleAssembly roleMapModule = contextLayer.module("CONTEXT-RoleMap"); // Role-playing entities roleMapModule .entities(CargoRoleMap.class, CargosRoleMap.class, HandlingEventsRoleMap.class) .visibleIn(application); // Non-role-playing entities roleMapModule .entities(HandlingEventEntity.class, LocationEntity.class, VoyageEntity.class) .visibleIn(application); ModuleAssembly interactionModule = contextLayer.module("CONTEXT-Interaction"); interactionModule.transients(ProcessHandlingEvent.class).visibleIn(application); ModuleAssembly contextServiceModule = contextLayer.module("CONTEXT-Service"); contextServiceModule .addServices( ParseHandlingEventData.class, RoutingService.class, RouteSpecificationFactoryService.class) .visibleIn(application); contextServiceModule.values(ParsedHandlingEventData.class).visibleIn(application); }
// END SNIPPET: domainLayer // START SNIPPET: accountModule private static void createAccountModule(LayerAssembly layer) { ModuleAssembly module = layer.module("account-module"); module.entities(AccountEntity.class, EntryEntity.class); module .addServices( AccountRepositoryService.class, AccountFactoryService.class, EntryFactoryService.class, EntryRepositoryService.class) .visibleIn(Visibility.layer); }