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 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;
 }