private static ApplicationAssembly createAssembly(ApplicationAssemblyFactory factory) throws AssemblyException { String applicationName = "Example Application"; ApplicationAssembly app = factory.newApplicationAssembly(); app.setName(applicationName); LayerAssembly webLayer = createWebLayer(app); LayerAssembly domainLayer = createDomainLayer(app); LayerAssembly infraLayer = createInfrastructureLayer(app); webLayer.uses(domainLayer); webLayer.uses(infraLayer); // Accesses the WebService domainLayer.uses(infraLayer); // For persistence return app; }
public ApplicationAssembly assemble(ApplicationAssemblyFactory applicationFactory) throws AssemblyException { // Application assembly ApplicationAssembly assembly = applicationFactory.newApplicationAssembly(); assembly.setName("DCI Sample (version A) - TEST"); assembly.setVersion("B.1.0"); assembly.setMode(test); // Layers LayerAssembly infrastructureLayer = assembly.layer("INFRASTRUCTURE"); LayerAssembly dataLayer = assembly.layer("DATA"); LayerAssembly contextLayer = assembly.layer("CONTEXT"); LayerAssembly bootstrapLayer = assembly.layer("BOOTSTRAP"); // Layer dependencies bootstrapLayer.uses(contextLayer, dataLayer, infrastructureLayer); contextLayer.uses(dataLayer, infrastructureLayer); dataLayer.uses(infrastructureLayer); // Assemble assembleDomainLayer(dataLayer); assembleContextLayer(contextLayer); assembleBootstrapLayer(bootstrapLayer); assembleInfrastructureLayer(infrastructureLayer); return assembly; }
private static LayerAssembly createInfrastructureLayer(ApplicationAssembly application) throws AssemblyException { LayerAssembly layer = application.layer("Infrastructure Layer"); createWebServiceModule(layer); createPersistenceModule(layer); return layer; }
private static LayerAssembly createDomainLayer(ApplicationAssembly application) { LayerAssembly layer = application.layer("Domain Layer"); createCustomerDomainModule(layer); // : // : return layer; }
// START SNIPPET: domainLayer private static LayerAssembly createDomainLayer(ApplicationAssembly app) { LayerAssembly layer = app.layer("domain-layer"); createAccountModule(layer); createInventoryModule(layer); createReceivablesModule(layer); createPayablesModule(layer); return layer; }
private static LayerAssembly createWebLayer(ApplicationAssembly application) { LayerAssembly layer = application.layer("Web Layer"); createCustomerWebModule(layer); return layer; }
private static LayerAssembly createPersistenceLayer(ApplicationAssembly app) { LayerAssembly layer = app.layer("persistence-layer"); return layer; }
private static LayerAssembly createMessagingLayer(ApplicationAssembly app) { LayerAssembly layer = app.layer("messaging-layer"); return layer; }
private static LayerAssembly createDesignerLayer(ApplicationAssembly app) { LayerAssembly layer = app.layer("designer-layer"); return layer; }
// END SNIPPET: main private static LayerAssembly createRuntimeLayer(ApplicationAssembly app) { LayerAssembly layer = app.layer("runtime-layer"); return layer; }