コード例 #1
0
ファイル: TestAssembler.java プロジェクト: niclash/dci-sample
  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;
  }
コード例 #2
0
ファイル: ApplicationDocs.java プロジェクト: ramtej/zest-java
 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;
 }