polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [08/12] zest-java git commit: ZEST-136 - Massive changes to the Runtime, refactoring the Model and Instance relationship.
Date Thu, 17 Dec 2015 13:16:24 GMT
http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java b/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
index 6836d34..236b105 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
@@ -66,7 +66,7 @@ public class ValueTypeFactory
                                    Serialization.Variant variant
     )
     {
-        ValueType valueType = null;
+        ValueType valueType;
         if( CollectionType.isCollection( type ) )
         {
             if( type instanceof ParameterizedType )
@@ -132,7 +132,7 @@ public class ValueTypeFactory
                                                                            new AssociationsModel(),
                                                                            new ManyAssociationsModel(),
                                                                            new NamedAssociationsModel() );
-                    model = new ValueModel( valueComposite, Visibility.application, new MetaInfo(),
+                    model = new ValueModel( module, valueComposite, Visibility.application, new MetaInfo(),
                                             mixinsModel, valueStateModel, new CompositeMethodsModel( mixinsModel ) );
                 }
                 else

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/EntityBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/EntityBuilderInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/EntityBuilderInstance.java
index ed8d137..3e6df36 100755
--- a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/EntityBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/EntityBuilderInstance.java
@@ -25,7 +25,6 @@ import org.apache.zest.api.entity.LifecycleException;
 import org.apache.zest.runtime.composite.FunctionStateResolver;
 import org.apache.zest.runtime.entity.EntityInstance;
 import org.apache.zest.runtime.entity.EntityModel;
-import org.apache.zest.spi.structure.ModelModule;
 import org.apache.zest.spi.entity.EntityState;
 import org.apache.zest.spi.entitystore.EntityStoreUnitOfWork;
 import org.apache.zest.spi.module.ModuleSpi;
@@ -42,7 +41,6 @@ public final class EntityBuilderInstance<T>
     private final EntityModel model;
     private final ModuleUnitOfWork uow;
     private final EntityStoreUnitOfWork store;
-    private final ModuleSpi module;
     private String identity;
 
     private final BuilderEntityState entityState;
@@ -61,7 +59,7 @@ public final class EntityBuilderInstance<T>
     }
 
     public EntityBuilderInstance(
-        ModelModule<EntityDescriptor> model,
+        EntityDescriptor model,
         ModuleUnitOfWork uow,
         EntityStoreUnitOfWork store,
         String identity
@@ -71,27 +69,26 @@ public final class EntityBuilderInstance<T>
     }
 
     public EntityBuilderInstance(
-        ModelModule<EntityDescriptor> model,
+        EntityDescriptor model,
         ModuleUnitOfWork uow,
         EntityStoreUnitOfWork store,
         String identity,
         FunctionStateResolver stateResolver
     )
     {
-        this.model = (EntityModel) model.model();
-        this.module = model.module();
+        this.model = (EntityModel) model;
         this.uow = uow;
         this.store = store;
         this.identity = identity;
         EntityReference reference = new EntityReference( identity );
-        entityState = new BuilderEntityState( model.model(), reference );
+        entityState = new BuilderEntityState( model, reference );
         this.model.initState( model.module(), entityState );
         if( stateResolver != null )
         {
             stateResolver.populateState( this.model, entityState );
         }
         entityState.setPropertyValue( IDENTITY_STATE_NAME, identity );
-        prototypeInstance = this.model.newInstance( uow, model.module(), entityState );
+        prototypeInstance = this.model.newInstance( uow, (ModuleSpi) model.module().instance(), entityState );
     }
 
     @SuppressWarnings( "unchecked" )
@@ -128,7 +125,7 @@ public final class EntityBuilderInstance<T>
 
         entityState.copyTo( newEntityState );
 
-        EntityInstance instance = model.newInstance( uow, module, newEntityState );
+        EntityInstance instance = model.newInstance( uow, (ModuleSpi) model.module().instance(), newEntityState );
 
         Object proxy = instance.proxy();
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/ModuleUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/ModuleUnitOfWork.java b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/ModuleUnitOfWork.java
index 118510f..8d5f011 100755
--- a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/ModuleUnitOfWork.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/ModuleUnitOfWork.java
@@ -48,7 +48,7 @@ import org.apache.zest.api.query.QueryBuilder;
 import org.apache.zest.api.query.QueryExecutionException;
 import org.apache.zest.api.query.grammar.OrderBy;
 import org.apache.zest.api.service.NoSuchServiceException;
-import org.apache.zest.api.structure.Module;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.unitofwork.ConcurrentEntityModificationException;
 import org.apache.zest.api.unitofwork.EntityTypeNotFoundException;
 import org.apache.zest.api.unitofwork.NoSuchEntityException;
@@ -73,7 +73,6 @@ import org.apache.zest.spi.entity.EntityState;
 import org.apache.zest.spi.entity.EntityStatus;
 import org.apache.zest.spi.entity.NamedAssociationState;
 import org.apache.zest.spi.entitystore.EntityStore;
-import org.apache.zest.spi.structure.ModelModule;
 import org.apache.zest.spi.module.ModuleSpi;
 import org.apache.zest.spi.query.EntityFinder;
 import org.apache.zest.spi.query.EntityFinderException;
@@ -106,12 +105,12 @@ public class ModuleUnitOfWork
     private UnitOfWorkInstance uow;
 
     @Structure
-    private ModuleSpi module;
+    private ModuleDescriptor module;
 
     @Service
     private UnitOfWorkFactory unitOfWorkFactory;
 
-    public Module module()
+    public ModuleDescriptor module()
     {
         return module;
     }
@@ -185,27 +184,24 @@ public class ModuleUnitOfWork
     public <T> EntityBuilder<T> newEntityBuilder( Class<T> type, String identity )
         throws EntityTypeNotFoundException
     {
-        ModelModule<EntityDescriptor> model = module.typeLookup().lookupEntityModel( type );
+        EntityDescriptor model = module.typeLookup().lookupEntityModel( type );
 
         if( model == null )
         {
-            throw new EntityTypeNotFoundException( type.getName(),
-                                                   module.name(),
-                                                   module.findVisibleEntityTypes().map( ModelModule.toStringFunction )
-            );
+            throw EntityTypeNotFoundException.create( type.getName(), module );
         }
 
-        EntityStore entityStore = ((ModuleSpi) model.module()).entityStore();
+        EntityStore entityStore = ( (ModuleSpi) model.module().instance() ).entityStore();
 
         // Generate id if necessary
         if( identity == null )
         {
-            IdentityGenerator idGen = ((ModuleSpi) model.module()).identityGenerator();
+            IdentityGenerator idGen = ( (ModuleSpi) model.module().instance() ).identityGenerator();
             if( idGen == null )
             {
                 throw new NoSuchServiceException( IdentityGenerator.class.getName(), model.module().name() );
             }
-            identity = idGen.generate( model.model().types().findFirst().orElse( null ) );
+            identity = idGen.generate( model.types().findFirst().orElse( null ) );
         }
         EntityBuilder<T> builder;
 
@@ -248,17 +244,15 @@ public class ModuleUnitOfWork
         NullArgumentException.validateNotNull( "manyAssociationFunction", manyAssociationFunction );
         NullArgumentException.validateNotNull( "namedAssociationFunction", namedAssociationFunction );
 
-        ModelModule<EntityDescriptor> model = module.typeLookup().lookupEntityModel( type );
+        EntityDescriptor model = module.typeLookup().lookupEntityModel( type );
 
         if( model == null )
         {
-            throw new EntityTypeNotFoundException( type.getName(),
-                                                   module.name(),
-                                                   module.findVisibleEntityTypes().map( ModelModule.toStringFunction )
-            );
+            throw EntityTypeNotFoundException.create( type.getName(), module );
         }
 
-        EntityStore entityStore = model.module().entityStore();
+        ModuleSpi moduleSpi = (ModuleSpi) model.module().instance();
+        EntityStore entityStore = moduleSpi.entityStore();
 
         FunctionStateResolver stateResolver = new FunctionStateResolver(
             propertyFunction, associationFunction, manyAssociationFunction, namedAssociationFunction
@@ -267,17 +261,19 @@ public class ModuleUnitOfWork
         if( identity == null )
         {
             // Use identity from StateResolver if available
-            PropertyModel identityModel = (PropertyModel) model.model().state().findPropertyModelByQualifiedName( IDENTITY_STATE_NAME );
+            PropertyModel identityModel = (PropertyModel) model
+                .state()
+                .findPropertyModelByQualifiedName( IDENTITY_STATE_NAME );
             identity = (String) stateResolver.getPropertyState( identityModel );
             if( identity == null )
             {
                 // Generate identity
-                IdentityGenerator idGen = model.module().identityGenerator();
+                IdentityGenerator idGen = moduleSpi.identityGenerator();
                 if( idGen == null )
                 {
                     throw new NoSuchServiceException( IdentityGenerator.class.getName(), model.module().name() );
                 }
-                identity = idGen.generate( model.model().types().findFirst().orElse( null ));
+                identity = idGen.generate( model.types().findFirst().orElse( null ) );
             }
         }
 
@@ -292,14 +288,11 @@ public class ModuleUnitOfWork
     public <T> T get( Class<T> type, String identity )
         throws EntityTypeNotFoundException, NoSuchEntityException
     {
-        Iterable<ModelModule<EntityDescriptor>> models = module.typeLookup().lookupEntityModels( type );
+        Iterable<? extends EntityDescriptor> models = module.typeLookup().lookupEntityModels( type );
 
         if( !models.iterator().hasNext() )
         {
-            throw new EntityTypeNotFoundException( type.getName(),
-                                                   module.name(),
-                                                   ((ModuleSpi) module).findVisibleEntityTypes().map( ModelModule.toStringFunction )
-            );
+            throw EntityTypeNotFoundException.create( type.getName(), module );
         }
 
         return uow.get( parseEntityReference( identity ), this, models, type );
@@ -312,7 +305,7 @@ public class ModuleUnitOfWork
     {
         EntityComposite entityComposite = (EntityComposite) entity;
         EntityInstance compositeInstance = EntityInstance.entityInstanceOf( entityComposite );
-        ModelModule<EntityDescriptor> model = new ModelModule<>( compositeInstance.module(), compositeInstance.entityModel() );
+        EntityDescriptor model = compositeInstance.entityModel();
         Class<T> type = (Class<T>) compositeInstance.types().findFirst().orElse( null );
         return uow.get( compositeInstance.identity(), this, Collections.singletonList( model ), type );
     }
@@ -441,7 +434,7 @@ public class ModuleUnitOfWork
         Function<AssociationDescriptor, Map<String, EntityReference>> namedAssocFunction = new ToValueNameAssociationMappingFunction<>( entityComposite );
 
         @SuppressWarnings( "unchecked" )
-        ValueBuilder<T> builder = module().newValueBuilderWithState(
+        ValueBuilder<T> builder = module().instance().newValueBuilderWithState(
             primaryType, propertyFunction, assocationFunction, manyAssocFunction, namedAssocFunction );
         return builder.newInstance();
     }
@@ -499,7 +492,10 @@ public class ModuleUnitOfWork
                            Map<String, Object> variables
         )
         {
-            final EntityFinder entityFinder = moduleUnitOfWork.module().findService( EntityFinder.class ).get();
+            final EntityFinder entityFinder = moduleUnitOfWork.module()
+                .instance()
+                .findService( EntityFinder.class )
+                .get();
 
             try
             {
@@ -534,7 +530,7 @@ public class ModuleUnitOfWork
                                Map<String, Object> variables
         )
         {
-            final EntityFinder entityFinder = moduleUnitOfWork.module().findService( EntityFinder.class ).get();
+            EntityFinder entityFinder = moduleUnitOfWork.module().instance().findService( EntityFinder.class ).get();
 
             try
             {
@@ -556,18 +552,19 @@ public class ModuleUnitOfWork
                                          Map<String, Object> variables
         )
         {
-            final EntityFinder entityFinder = moduleUnitOfWork.module().findService( EntityFinder.class ).get();
+            EntityFinder entityFinder = moduleUnitOfWork.module().instance().findService( EntityFinder.class ).get();
 
             try
             {
-                final Iterator<EntityReference> foundEntities = entityFinder.findEntities( resultType,
-                                                                                           whereClause,
-                                                                                           Iterables.toArray( OrderBy.class, orderBySegments ),
-                                                                                           firstResult,
-                                                                                           maxResults,
-                                                                                           variables == null ? Collections
-                                                                                               .<String, Object>emptyMap() : variables )
-                    .iterator();
+                final Iterator<EntityReference> foundEntities =
+                    entityFinder.findEntities(
+                        resultType,
+                        whereClause,
+                        Iterables.toArray( OrderBy.class, orderBySegments ),
+                        firstResult,
+                        maxResults,
+                        variables == null ? Collections.<String, Object>emptyMap() : variables
+                    ).iterator();
 
                 return new Iterator<T>()
                 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkFactoryMixin.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkFactoryMixin.java b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkFactoryMixin.java
index 3a69e29..df7b682 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkFactoryMixin.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkFactoryMixin.java
@@ -21,11 +21,9 @@
 package org.apache.zest.runtime.unitofwork;
 
 import java.util.Stack;
-import org.apache.zest.api.common.Optional;
 import org.apache.zest.api.composite.TransientBuilderFactory;
 import org.apache.zest.api.entity.EntityComposite;
 import org.apache.zest.api.injection.scope.Structure;
-import org.apache.zest.api.injection.scope.Uses;
 import org.apache.zest.api.metrics.MetricsProvider;
 import org.apache.zest.api.unitofwork.UnitOfWork;
 import org.apache.zest.api.unitofwork.UnitOfWorkFactory;
@@ -64,7 +62,7 @@ public class UnitOfWorkFactoryMixin
     @Override
     public UnitOfWork newUnitOfWork( Usecase usecase, long currentTime )
     {
-        UnitOfWorkInstance unitOfWorkInstance = new UnitOfWorkInstance( usecase, currentTime, metricsProvider() );
+        UnitOfWorkInstance unitOfWorkInstance = new UnitOfWorkInstance( module, usecase, currentTime, metricsProvider() );
         return tbf.newTransient( UnitOfWork.class, unitOfWorkInstance );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkInstance.java
index 3a65c9f..4ba3c55 100755
--- a/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/unitofwork/UnitOfWorkInstance.java
@@ -36,6 +36,7 @@ import org.apache.zest.api.metrics.MetricsCounterFactory;
 import org.apache.zest.api.metrics.MetricsProvider;
 import org.apache.zest.api.metrics.MetricsTimer;
 import org.apache.zest.api.metrics.MetricsTimerFactory;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.type.HasTypes;
 import org.apache.zest.api.unitofwork.ConcurrentEntityModificationException;
 import org.apache.zest.api.unitofwork.EntityTypeNotFoundException;
@@ -57,7 +58,6 @@ import org.apache.zest.spi.entitystore.EntityStoreUnitOfWork;
 import org.apache.zest.spi.entitystore.StateCommitter;
 import org.apache.zest.spi.metrics.DefaultMetric;
 import org.apache.zest.spi.module.ModuleSpi;
-import org.apache.zest.spi.structure.ModelModule;
 
 import static org.apache.zest.api.unitofwork.UnitOfWorkCallback.UnitOfWorkStatus.COMPLETED;
 import static org.apache.zest.api.unitofwork.UnitOfWorkCallback.UnitOfWorkStatus.DISCARDED;
@@ -79,6 +79,7 @@ public final class UnitOfWorkInstance
         return current.get();
     }
 
+    private final ModuleSpi module;
     private long currentTime;
     private MetricsProvider metrics;
     final HashMap<EntityReference, EntityInstance> instanceCache;
@@ -97,8 +98,9 @@ public final class UnitOfWorkInstance
 
     private List<UnitOfWorkCallback> callbacks;
 
-    public UnitOfWorkInstance( Usecase usecase, long currentTime, MetricsProvider metrics )
+    public UnitOfWorkInstance( ModuleSpi module, Usecase usecase, long currentTime, MetricsProvider metrics )
     {
+        this.module = module;
         this.currentTime = currentTime;
         this.open = true;
         instanceCache = new HashMap<>();
@@ -119,7 +121,7 @@ public final class UnitOfWorkInstance
         EntityStoreUnitOfWork uow = storeUnitOfWork.get( store );
         if( uow == null )
         {
-            uow = store.newUnitOfWork( usecase, currentTime );
+            uow = store.newUnitOfWork( module.descriptor(), usecase, currentTime );
             storeUnitOfWork.put( store, uow );
         }
         return uow;
@@ -127,7 +129,7 @@ public final class UnitOfWorkInstance
 
     public <T> T get( EntityReference identity,
                       UnitOfWork uow,
-                      Iterable<ModelModule<EntityDescriptor>> potentialModels,
+                      Iterable<? extends EntityDescriptor> potentialModels,
                       Class<T> mixinType
     )
         throws EntityTypeNotFoundException, NoSuchEntityException
@@ -141,11 +143,11 @@ public final class UnitOfWorkInstance
             // Check if this is a root UoW, or if no parent UoW knows about this entity
             EntityState entityState = null;
             EntityModel model = null;
-            ModuleSpi module = null;
+            ModuleDescriptor module = null;
             // Figure out what EntityStore to use
-            for( ModelModule<EntityDescriptor> potentialModel : potentialModels )
+            for( EntityDescriptor potentialModel : potentialModels )
             {
-                EntityStore store = potentialModel.module().entityStore();
+                EntityStore store = ((ModuleSpi) potentialModel.module().instance()).entityStore();
                 EntityStoreUnitOfWork storeUow = getEntityStoreUnitOfWork( store );
                 try
                 {
@@ -171,15 +173,11 @@ public final class UnitOfWorkInstance
                 }
                 else
                 {
-                    throw new EntityTypeNotFoundException( mixinType.getName(),
-                                                           module.name(),
-                                                           module.findVisibleEntityTypes()
-                                                               .map( ModelModule.toStringFunction )
-                    );
+                    throw EntityTypeNotFoundException.create( mixinType.getName(), module );
                 }
             }
             // Create instance
-            entityInstance = new EntityInstance( uow, module, model, entityState );
+            entityInstance = new EntityInstance( uow, model, entityState );
             instanceCache.put( identity, entityInstance );
         }
         else

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderInstance.java
index 45e9282..ae438c5 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderInstance.java
@@ -21,7 +21,6 @@ import org.apache.zest.api.value.ValueBuilder;
 import org.apache.zest.api.value.ValueDescriptor;
 import org.apache.zest.runtime.composite.StateResolver;
 import org.apache.zest.runtime.structure.ModuleInstance;
-import org.apache.zest.spi.structure.ModelModule;
 
 /**
  * Implementation of ValueBuilder
@@ -33,14 +32,14 @@ public final class ValueBuilderInstance<T>
     private final ModuleInstance currentModule;
     private final ValueInstance prototypeInstance;
 
-    public ValueBuilderInstance( ModelModule<ValueDescriptor> compositeModelModule,
+    public ValueBuilderInstance( ValueDescriptor compositeModel,
                                  ModuleInstance currentModule,
                                  StateResolver stateResolver
     )
     {
-        ValueStateInstance state = new ValueStateInstance( compositeModelModule, currentModule, stateResolver );
-        ValueModel model = (ValueModel) compositeModelModule.model();
-        prototypeInstance = model.newValueInstance( compositeModelModule.module(), state );
+        ValueStateInstance state = new ValueStateInstance( compositeModel, currentModule, stateResolver );
+        ValueModel model = (ValueModel) compositeModel;
+        prototypeInstance = model.newValueInstance( state );
         prototypeInstance.prepareToBuild();
         this.currentModule = currentModule;
     }
@@ -70,7 +69,7 @@ public final class ValueBuilderInstance<T>
     {
         Class<Composite> valueType = (Class<Composite>) prototypeInstance.types().findFirst().orElse( null );
 
-        ModelModule<ValueDescriptor> valueModel = currentModule.typeLookup().lookupValueModel( valueType );
+        ValueDescriptor valueModel = currentModule.typeLookup().lookupValueModel( valueType );
 
         if( valueModel == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
index eafd07a..f3f236a 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
@@ -38,7 +38,6 @@ import org.apache.zest.runtime.composite.MixinsModel;
 import org.apache.zest.runtime.composite.StateResolver;
 import org.apache.zest.runtime.composite.UsesInstance;
 import org.apache.zest.runtime.injection.InjectionContext;
-import org.apache.zest.spi.structure.ModelModule;
 import org.apache.zest.runtime.structure.ModuleInstance;
 
 /**
@@ -50,12 +49,12 @@ public class ValueBuilderWithPrototype<T>
     private ValueInstance prototypeInstance;
     private final ValueModel valueModel;
 
-    public ValueBuilderWithPrototype( ModelModule<ValueDescriptor> compositeModelModule,
+    public ValueBuilderWithPrototype( ValueDescriptor compositeModelModule,
                                       ModuleInstance currentModule,
                                       T prototype
     )
     {
-        valueModel = (ValueModel) compositeModelModule.model();
+        valueModel = (ValueModel) compositeModelModule;
         // Only shallow clone, as all generic types of the ValueComposites are expected to be Immutable.
 
         MixinsModel mixinsModel = valueModel.mixinsModel();
@@ -70,7 +69,6 @@ public class ValueBuilderWithPrototype<T>
         ValueStateInstance state = new ValueStateInstance( compositeModelModule, currentModule, resolver );
         ValueInstance valueInstance = new ValueInstance(
             valueModel,
-            currentModule,
             mixins,
             state
         );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithState.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithState.java
index 69c06c4..4beafd5 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithState.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithState.java
@@ -18,21 +18,19 @@ import org.apache.zest.api.common.ConstructionException;
 import org.apache.zest.api.value.ValueBuilder;
 import org.apache.zest.api.value.ValueDescriptor;
 import org.apache.zest.runtime.composite.StateResolver;
-import org.apache.zest.spi.structure.ModelModule;
 import org.apache.zest.runtime.structure.ModuleInstance;
 
 public class ValueBuilderWithState<T> implements ValueBuilder<T>
 {
-    private final ModelModule<ValueDescriptor> model;
+    private final ValueDescriptor model;
     private ValueInstance prototypeInstance;
 
-    public ValueBuilderWithState( ModelModule<ValueDescriptor> compositeModelModule,
+    public ValueBuilderWithState( ValueDescriptor compositeModelModule,
                                   ModuleInstance currentModule,
                                   StateResolver stateResolver )
     {
         ValueStateInstance state = new ValueStateInstance( compositeModelModule, currentModule, stateResolver );
-        ValueModel model = (ValueModel) compositeModelModule.model();
-        ValueInstance instance = model.newValueInstance( compositeModelModule.module(), state );
+        ValueInstance instance = ((ValueModel) compositeModelModule).newValueInstance( state );
         instance.prepareToBuild();
         this.model = compositeModelModule;
         this.prototypeInstance = instance;
@@ -70,7 +68,7 @@ public class ValueBuilderWithState<T> implements ValueBuilder<T>
         prototypeInstance.prepareBuilderState();
 
         // Check that it is valid
-        ((ValueModel) model.model()).checkConstraints( prototypeInstance.state() );
+        ((ValueModel) model).checkConstraints( prototypeInstance.state() );
 
         try
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
index c22890e..beb232c 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueInstance.java
@@ -41,12 +41,11 @@ public final class ValueInstance
     }
 
     public ValueInstance( ValueModel compositeModel,
-                          ModuleSpi moduleInstance,
                           Object[] mixins,
                           ValueStateInstance state
     )
     {
-        super( compositeModel, moduleInstance, mixins, state );
+        super( compositeModel, mixins, state );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueModel.java
index 5b23765..f28a16e 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueModel.java
@@ -18,6 +18,7 @@ import java.util.List;
 import org.apache.zest.api.common.MetaInfo;
 import org.apache.zest.api.common.Visibility;
 import org.apache.zest.api.constraint.ConstraintViolationException;
+import org.apache.zest.api.structure.ModuleDescriptor;
 import org.apache.zest.api.type.ValueCompositeType;
 import org.apache.zest.api.value.ValueDescriptor;
 import org.apache.zest.runtime.composite.CompositeMethodsModel;
@@ -27,7 +28,6 @@ import org.apache.zest.runtime.composite.MixinsModel;
 import org.apache.zest.runtime.composite.UsesInstance;
 import org.apache.zest.runtime.injection.InjectionContext;
 import org.apache.zest.runtime.unitofwork.UnitOfWorkInstance;
-import org.apache.zest.spi.module.ModuleSpi;
 
 /**
  * Model for ValueComposites
@@ -37,7 +37,8 @@ public final class ValueModel extends CompositeModel
 {
     private ValueCompositeType valueType;
 
-    public ValueModel( final List<Class<?>> types,
+    public ValueModel( final ModuleDescriptor module,
+                       final List<Class<?>> types,
                        final Visibility visibility,
                        final MetaInfo metaInfo,
                        final MixinsModel mixinsModel,
@@ -45,7 +46,7 @@ public final class ValueModel extends CompositeModel
                        final CompositeMethodsModel compositeMethodsModel
     )
     {
-        super( types, visibility, metaInfo, mixinsModel, stateModel, compositeMethodsModel );
+        super( module, types, visibility, metaInfo, mixinsModel, stateModel, compositeMethodsModel );
 
         valueType = new ValueCompositeType( this );
     }
@@ -88,13 +89,11 @@ public final class ValueModel extends CompositeModel
         );
     }
 
-    public ValueInstance newValueInstance( ModuleSpi moduleInstance,
-                                           ValueStateInstance state
-    )
+    public ValueInstance newValueInstance( ValueStateInstance state )
     {
         Object[] mixins = mixinsModel.newMixinHolder();
 
-        ValueInstance instance = new ValueInstance( this, moduleInstance, mixins, state );
+        ValueInstance instance = new ValueInstance( this, mixins, state );
 
         // Instantiate all mixins
         int i = 0;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueStateInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueStateInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueStateInstance.java
index 313567e..d5f32cc 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueStateInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueStateInstance.java
@@ -36,7 +36,6 @@ import org.apache.zest.runtime.property.PropertyInfo;
 import org.apache.zest.runtime.property.PropertyInstance;
 import org.apache.zest.runtime.structure.ModuleInstance;
 import org.apache.zest.runtime.unitofwork.EntityFunction;
-import org.apache.zest.spi.structure.ModelModule;
 
 /**
  * TODO
@@ -61,14 +60,14 @@ public final class ValueStateInstance
         this.namedAssociations = namedAssociations;
     }
 
-    public ValueStateInstance( ModelModule<ValueDescriptor> compositeModelModule,
+    public ValueStateInstance( ValueDescriptor compositeModelModule,
                                ModuleInstance currentModule,
                                StateResolver stateResolver
     )
     {
         EntityFunction entityFunction = new EntityFunction( currentModule.unitOfWorkFactory() );
 
-        ValueModel valueModel = (ValueModel) compositeModelModule.model();
+        ValueModel valueModel = (ValueModel) compositeModelModule;
         this.properties = new LinkedHashMap<>();
         valueModel.state().properties().forEach( propertyDescriptor -> {
             PropertyInfo builderInfo = propertyDescriptor.getBuilderInfo();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/api/common/OptionalTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/api/common/OptionalTest.java b/core/runtime/src/test/java/org/apache/zest/api/common/OptionalTest.java
index ed1b8c3..f603e5c 100644
--- a/core/runtime/src/test/java/org/apache/zest/api/common/OptionalTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/api/common/OptionalTest.java
@@ -50,28 +50,28 @@ public class OptionalTest
     @Test
     public void givenOptionalMethodWhenCorrectInvokeThenNoException()
     {
-        TestComposite instance = module.newTransient( TestComposite.class );
+        TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class );
         instance.doStuff( "Hello WOrld", "Hello World" );
     }
 
     @Test( expected = ConstraintViolationException.class )
     public void givenOptionalMethodWhenMandatoryMissingThenException()
     {
-        TestComposite instance = module.newTransient( TestComposite.class );
+        TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class );
         instance.doStuff( "Hello World", null );
     }
 
     @Test
     public void givenOptionalMethodWhenOptionalMissingThenNoException()
     {
-        TestComposite instance = module.newTransient( TestComposite.class );
+        TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class );
         instance.doStuff( null, "Hello World" );
     }
 
     @Test
     public void givenOptionalPropertyWhenOptionalMissingThenNoException()
     {
-        TransientBuilder<TestComposite2> builder = module.newTransientBuilder( TestComposite2.class );
+        TransientBuilder<TestComposite2> builder = transientBuilderFactory.newTransientBuilder( TestComposite2.class );
         builder.prototype().mandatoryProperty().set( "Hello World" );
         TestComposite2 testComposite2 = builder.newInstance();
     }
@@ -79,7 +79,7 @@ public class OptionalTest
     @Test
     public void givenOptionalPropertyWhenOptionalSetThenNoException()
     {
-        TransientBuilder<TestComposite2> builder = module.newTransientBuilder( TestComposite2.class );
+        TransientBuilder<TestComposite2> builder = transientBuilderFactory.newTransientBuilder( TestComposite2.class );
         builder.prototype().mandatoryProperty().set( "Hello World" );
         builder.prototype().optionalProperty().set( "Hello World" );
         TestComposite2 testComposite2 = builder.newInstance();
@@ -88,7 +88,7 @@ public class OptionalTest
     @Test( expected = ConstraintViolationException.class )
     public void givenMandatoryPropertyWhenMandatoryMissingThenException()
     {
-        TestComposite2 testComposite2 = module.newTransient( TestComposite2.class );
+        TestComposite2 testComposite2 = transientBuilderFactory.newTransient( TestComposite2.class );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/api/common/PropertyTypeTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/api/common/PropertyTypeTest.java b/core/runtime/src/test/java/org/apache/zest/api/common/PropertyTypeTest.java
index e3f5a7e..83c2030 100644
--- a/core/runtime/src/test/java/org/apache/zest/api/common/PropertyTypeTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/api/common/PropertyTypeTest.java
@@ -73,7 +73,7 @@ public class PropertyTypeTest
     public void givenCompositeWithPropertyConstraintsWhenInstantiatedThenPropertiesWork()
         throws Exception
     {
-        TransientBuilder<PersonComposite> builder = module.newTransientBuilder( PersonComposite.class );
+        TransientBuilder<PersonComposite> builder = transientBuilderFactory.newTransientBuilder( PersonComposite.class );
         PersonComposite personComposite = builder.prototype();
         personComposite.givenName().set( "Rickard" );
         personComposite.familyName().set( "Öberg" );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/api/common/ValueCompositeTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/api/common/ValueCompositeTest.java b/core/runtime/src/test/java/org/apache/zest/api/common/ValueCompositeTest.java
index 42360ad..75410f8 100644
--- a/core/runtime/src/test/java/org/apache/zest/api/common/ValueCompositeTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/api/common/ValueCompositeTest.java
@@ -51,7 +51,7 @@ public class ValueCompositeTest
     @Test( expected = IllegalStateException.class )
     public void testImmutabilityOfValueComposite()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue some = builder.prototype();
         some.other().set( "test" );
         some = builder.newInstance();
@@ -61,7 +61,7 @@ public class ValueCompositeTest
     @Test
     public void testCreationOfValueComposite()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue some = builder.prototype();
         some.other().set( "test" );
         builder.newInstance();
@@ -70,12 +70,12 @@ public class ValueCompositeTest
     @Test
     public void testEqualityOfValueComposite()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue prototype = builder.prototype();
         prototype.other().set( "test" );
         SomeValue instance = builder.newInstance();
 
-        builder = module.newValueBuilder( SomeValue.class );
+        builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         prototype = builder.prototype();
         prototype.other().set( "test" );
         SomeValue other = builder.newInstance();
@@ -86,12 +86,12 @@ public class ValueCompositeTest
     @Test
     public void testHashcodeOfValueComposite()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue prototype = builder.prototype();
         prototype.other().set( "test" );
         SomeValue instance = builder.newInstance();
 
-        builder = module.newValueBuilder( SomeValue.class );
+        builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         prototype = builder.prototype();
         prototype.other().set( "test" );
         SomeValue other = builder.newInstance();
@@ -102,11 +102,11 @@ public class ValueCompositeTest
     @Test
     public void testModifyValue()
     {
-        ValueBuilder<AnotherValue> anotherBuilder = module.newValueBuilder( AnotherValue.class );
+        ValueBuilder<AnotherValue> anotherBuilder = valueBuilderFactory.newValueBuilder( AnotherValue.class );
         anotherBuilder.prototype().val1().set( "Val1" );
         AnotherValue anotherValue = anotherBuilder.newInstance();
 
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue prototype = builder.prototype();
         prototype.some().set( "foo" );
         prototype.other().set( "test" );
@@ -117,7 +117,7 @@ public class ValueCompositeTest
         assertThat( "List has value blah", instance.xyzzyList().get().get( 0 ), equalTo( "blah" ) );
 
         // Modify value
-        builder = module.newValueBuilderWithPrototype( instance );
+        builder = valueBuilderFactory.newValueBuilderWithPrototype( instance );
         builder.prototype().some().set( "bar" );
         instance = builder.newInstance();
 
@@ -126,7 +126,7 @@ public class ValueCompositeTest
         assertThat( "AnotherValue.val1 has value Val1", instance.another().get().val1().get(), equalTo( "Val1" ) );
 
         // Modify value again using method 2
-        builder = module.newValueBuilderWithPrototype( instance );
+        builder = valueBuilderFactory.newValueBuilderWithPrototype( instance );
         builder.prototype().other().set( "test2" );
         instance = builder.newInstance();
 
@@ -137,25 +137,25 @@ public class ValueCompositeTest
     @Test( expected = ConstraintViolationException.class )
     public void givenValueWhenModifyToIncorrectValueThenThrowConstraintException()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
         SomeValue prototype = builder.prototype();
         prototype.some().set( "foo" );
         SomeValue instance = builder.newInstance();
 
-        builder = module.newValueBuilderWithPrototype( instance );
+        builder = valueBuilderFactory.newValueBuilderWithPrototype( instance );
         builder.prototype().some().set( null );
     }
 
     @Test
     public void givenValueWithListOfValueWhenPrototypeThenListedValuesAreEditable()
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
-        builder.prototype().anotherList().get().add( module.newValue( AnotherValue.class ) );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
+        builder.prototype().anotherList().get().add( valueBuilderFactory.newValue( AnotherValue.class ) );
         SomeValue some = builder.newInstance();
 
-        builder = module.newValueBuilderWithPrototype( some );
+        builder = valueBuilderFactory.newValueBuilderWithPrototype( some );
         builder.prototype().anotherList().get().get( 0 ).val1().set( "Foo" );
-        builder.prototype().anotherList().get().add( module.newValue( AnotherValue.class ) );
+        builder.prototype().anotherList().get().add( valueBuilderFactory.newValue( AnotherValue.class ) );
         some = builder.newInstance();
 
         assertThat( "Val1 has been set", some.anotherList().get().get( 0 ).val1().get(), equalTo( "Foo" ) );
@@ -175,9 +175,9 @@ public class ValueCompositeTest
     public void givenEntityWhenUpdateValueThenValueIsSet()
         throws UnitOfWorkCompletionException
     {
-        ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class );
-        builder.prototype().anotherList().get().add( module.newValue( AnotherValue.class ) );
-        ValueBuilder<AnotherValue> valueBuilder = module.newValueBuilder( AnotherValue.class );
+        ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class );
+        builder.prototype().anotherList().get().add( valueBuilderFactory.newValue( AnotherValue.class ) );
+        ValueBuilder<AnotherValue> valueBuilder = valueBuilderFactory.newValueBuilder( AnotherValue.class );
         valueBuilder.prototype().val1().set( "Foo" );
         builder.prototype().another().set( valueBuilder.newInstance() );
         builder.prototype().number().set( 42L );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/bootstrap/ServiceAssemblyTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/bootstrap/ServiceAssemblyTest.java b/core/runtime/src/test/java/org/apache/zest/bootstrap/ServiceAssemblyTest.java
index cead646..d9e78f8 100644
--- a/core/runtime/src/test/java/org/apache/zest/bootstrap/ServiceAssemblyTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/bootstrap/ServiceAssemblyTest.java
@@ -35,7 +35,7 @@ public class ServiceAssemblyTest extends AbstractZestTest
     public void givenMyServiceWithTwoDeclarationsWhenActivatingServiceExpectServiceActivatedOnce()
         throws Exception
     {
-        ServiceReference<MyService> ref = module.findService( MyService.class );
+        ServiceReference<MyService> ref = serviceFinder.findService( MyService.class );
         MyService underTest = ref.get();
         assertThat(underTest.activated(), equalTo(1));
         underTest.passivateService();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/constraints/PropertyConstraintTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/constraints/PropertyConstraintTest.java b/core/runtime/src/test/java/org/apache/zest/constraints/PropertyConstraintTest.java
index 1a85577..dc19bb4 100644
--- a/core/runtime/src/test/java/org/apache/zest/constraints/PropertyConstraintTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/constraints/PropertyConstraintTest.java
@@ -41,7 +41,7 @@ public class PropertyConstraintTest
     public void givenConstraintOnPropertyWhenInvalidValueThenThrowException()
         throws Throwable
     {
-        TransientBuilder<Test> builder = module.newTransientBuilder( Test.class );
+        TransientBuilder<Test> builder = transientBuilderFactory.newTransientBuilder( Test.class );
         builder.prototype().test().set( "XXXXXX" );
         Test test = builder.newInstance();
         try

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi230/Qi230IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi230/Qi230IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi230/Qi230IssueTest.java
index 9f9fea2..4165d8a 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi230/Qi230IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi230/Qi230IssueTest.java
@@ -49,8 +49,8 @@ public class Qi230IssueTest
     public void whenDerefencingInsideConcernThisExpectItToWork()
         throws Exception
     {
-        Result result = module.findService( Result.class ).get();
-        Some some = module.findService( Some.class ).get();
+        Result result = serviceFinder.findService( Result.class ).get();
+        Some some = serviceFinder.findService( Some.class ).get();
         assertEquals( "method()", some.method() );
         assertEquals( some.identity(), result.some().identity() );
         assertEquals( some.identity().get(), result.some().identity().get() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi377/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi377/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi377/IssueTest.java
index 8ce8c77..cc4cfe8 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi377/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi377/IssueTest.java
@@ -41,7 +41,7 @@ public class IssueTest
     @Test
     public void propertyNameCollisionsShouldWork()
     {
-        TeamMember m = module.newTransient( TeamMember.class );
+        TeamMember m = transientBuilderFactory.newTransient( TeamMember.class );
         m.name().set( "Niclas" );
         Person p = m;
         p.name().set( "Chris" );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
index d51309c..4b069e4 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
@@ -42,7 +42,7 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToSetNameToTheCompany()
     {
-        ValueBuilder<Company> builder = module.newValueBuilder( Company.class );
+        ValueBuilder<Company> builder = valueBuilderFactory.newValueBuilder( Company.class );
         builder.prototype().name().set( "Acme" );
         Company startUp = builder.newInstance();
     }
@@ -50,8 +50,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToSetLeadToTheCompany()
     {
-        Company startUp = module.newValue( Company.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        Company startUp = valueBuilderFactory.newValue( Company.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.lead().set( niclas );
@@ -60,8 +60,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToSetLeadToTheSalesTeam()
     {
-        SalesTeam startUp = module.newValue( SalesTeam.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        SalesTeam startUp = valueBuilderFactory.newValue( SalesTeam.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.lead().set( niclas );
@@ -70,8 +70,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToSetLeadToTheResearchTeam()
     {
-        ResearchTeam startUp = module.newValue( ResearchTeam.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        ResearchTeam startUp = valueBuilderFactory.newValue( ResearchTeam.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.lead().set( niclas );
@@ -80,8 +80,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToAddEmployeesToTheCompany()
     {
-        Company startUp = module.newValue( Company.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        Company startUp = valueBuilderFactory.newValue( Company.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.employees().add( niclas );
@@ -90,8 +90,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToAddEmployeesToTheSalesTeam()
     {
-        SalesTeam startUp = module.newValue( SalesTeam.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        SalesTeam startUp = valueBuilderFactory.newValue( SalesTeam.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.employees().add( niclas );
@@ -100,8 +100,8 @@ public class ValueCollisionWithRelatedReturnTypesTest
     @Test
     public void shouldBeAbleToAddEmployeesToTheResearchTeam()
     {
-        ResearchTeam startUp = module.newValue( ResearchTeam.class );
-        ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
+        ResearchTeam startUp = valueBuilderFactory.newValue( ResearchTeam.class );
+        ValueBuilder<Employee> builder = valueBuilderFactory.newValueBuilder( Employee.class );
         builder.prototype().identity().set( "niclas" );
         Employee niclas = builder.newInstance();
         startUp.employees().add( niclas );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi53/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi53/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi53/IssueTest.java
index 58b33c3..71daed8 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi53/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi53/IssueTest.java
@@ -46,7 +46,7 @@ public class IssueTest
     public void genericPropertiesAndParameters()
         throws SecurityException, NoSuchMethodException
     {
-        TransientBuilder<CostPerUnitComposite> builder = module.newTransientBuilder( CostPerUnitComposite.class );
+        TransientBuilder<CostPerUnitComposite> builder = transientBuilderFactory.newTransientBuilder( CostPerUnitComposite.class );
         builder.prototype().unit().set( new Unit<Integer>( 10 ) );
         CostPerUnitComposite test = builder.newInstance();
         assertEquals( 10, test.unit().get().value );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
index f170407..847fa7c 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
@@ -38,9 +38,7 @@ public class IssueTest
     @Test
     public void objectWithGenericUsage()
     {
-        assertEquals( "Using - Test string", module.
-            newObject( AClass.class, "Test string" ).
-            uses() );
+        assertEquals( "Using - Test string", objectFactory.newObject( AClass.class, "Test string" ).uses() );
     }
 
     public static class AClass<T>

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
index 676183d..40a7d58 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
@@ -42,7 +42,7 @@ public class IssueTest
     public void constraintOnMethodParameter()
         throws SecurityException, NoSuchMethodException
     {
-        TestComposite test = module.newTransient( TestComposite.class );
+        TestComposite test = transientBuilderFactory.newTransient( TestComposite.class );
 
         test.someMethod( null );
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
index 1a0a1ff..e6a6169 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
@@ -41,7 +41,7 @@ public class IssueTest
     {
         try
         {
-            TransientBuilder<ValueHolder> builder = module.newTransientBuilder( ValueHolder.class );
+            TransientBuilder<ValueHolder> builder = transientBuilderFactory.newTransientBuilder( ValueHolder.class );
             builder.newInstance();
             Assert.fail( "NotNull constraint violated but no exception is raised" );
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
index 2fd8a7a..ccdfdc2 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
@@ -17,8 +17,6 @@
  */
 package org.apache.zest.regression.qi78;
 
-import org.junit.Assert;
-import org.junit.Test;
 import org.apache.zest.api.structure.Application;
 import org.apache.zest.api.structure.ApplicationDescriptor;
 import org.apache.zest.api.structure.LayerDescriptor;
@@ -29,6 +27,8 @@ import org.apache.zest.bootstrap.AssemblyException;
 import org.apache.zest.bootstrap.Energy4Java;
 import org.apache.zest.bootstrap.LayerAssembly;
 import org.apache.zest.functional.HierarchicalVisitorAdapter;
+import org.junit.Assert;
+import org.junit.Test;
 
 public class IssueTest
 {
@@ -79,12 +79,9 @@ public class IssueTest
             {
                 if( visited instanceof LayerDescriptor )
                 {
-                    Iterable<? extends LayerDescriptor> usedLayers = ( (LayerDescriptor) visited ).usedLayers()
-                        .layers();
-                    for( LayerDescriptor usedLayerModel : usedLayers )
-                    {
+                    ( (LayerDescriptor) visited ).usedLayers().layers().forEach( usedLayerModel -> {
                         Assert.assertNotNull( "Used layer model is null", usedLayerModel );
-                    }
+                    } );
                 }
 
                 return false;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/ZestAPITest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/ZestAPITest.java b/core/runtime/src/test/java/org/apache/zest/runtime/ZestAPITest.java
index a9f7dfa..25dff76 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/ZestAPITest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/ZestAPITest.java
@@ -52,11 +52,11 @@ public class ZestAPITest
 
         unitOfWork.discard();
 
-        api.moduleOf( module.newValue( TestValue.class ) );
+        api.moduleOf( valueBuilderFactory.newValue( TestValue.class ) );
 
-        api.moduleOf( module.newTransient( TestTransient.class ) );
+        api.moduleOf( transientBuilderFactory.newTransient( TestTransient.class ) );
 
-        api.moduleOf( module.findService( TestService.class ).get() );
+        api.moduleOf( serviceFinder.findService( TestService.class ).get() );
     }
 
     public interface TestTransient

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToFilterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToFilterTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToFilterTest.java
index 48a7682..39dd736 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToFilterTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToFilterTest.java
@@ -46,7 +46,7 @@ public class AppliesToFilterTest
     public void givenAnAppliesToFilterWhenAppliedThenFilterMethods()
         throws Exception
     {
-        Some some = module.newTransient( Some.class );
+        Some some = transientBuilderFactory.newTransient( Some.class );
         Assert.assertEquals( ",", some.doStuff1() );
         Assert.assertEquals( ",,..", some.doStuff2() );
         Assert.assertEquals( ",,,", some.doStuff3() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToOrConditionQI241Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToOrConditionQI241Test.java b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToOrConditionQI241Test.java
index f2ec635..58d9b66 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToOrConditionQI241Test.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToOrConditionQI241Test.java
@@ -61,7 +61,7 @@ public class AppliesToOrConditionQI241Test
 
         try
         {
-            ServiceReference<SomeServiceCompositeWithFirstAnnotation> refWithFirst = module.findService(
+            ServiceReference<SomeServiceCompositeWithFirstAnnotation> refWithFirst = serviceFinder.findService(
                 SomeServiceCompositeWithFirstAnnotation.class );
             SomeServiceCompositeWithFirstAnnotation someWithFirst = refWithFirst.get();
             someWithFirst.doStuff();
@@ -80,7 +80,7 @@ public class AppliesToOrConditionQI241Test
 
         try
         {
-            ServiceReference<SomeServiceCompositeWithSecondAnnotation> refWithSecond = module.findService(
+            ServiceReference<SomeServiceCompositeWithSecondAnnotation> refWithSecond = serviceFinder.findService(
                 SomeServiceCompositeWithSecondAnnotation.class );
             SomeServiceCompositeWithSecondAnnotation someWithSecond = refWithSecond.get();
             someWithSecond.doStuff();
@@ -99,7 +99,7 @@ public class AppliesToOrConditionQI241Test
 
         try
         {
-            ServiceReference<SomeServiceCompositeWithTwoAnnotations> refWithTwo = module.findService(
+            ServiceReference<SomeServiceCompositeWithTwoAnnotations> refWithTwo = serviceFinder.findService(
                 SomeServiceCompositeWithTwoAnnotations.class );
             SomeServiceCompositeWithTwoAnnotations someWithTwo = refWithTwo.get();
             someWithTwo.doStuff();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToTest.java
index 1993d39..b45a5b3 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/AppliesToTest.java
@@ -46,7 +46,7 @@ public class AppliesToTest
     public void givenAnAppliesToWhenNoAnnotationExpectNoConcernInInvocationStack()
         throws Exception
     {
-        Some some = module.newTransient( Some.class );
+        Some some = transientBuilderFactory.newTransient( Some.class );
         Assert.assertEquals( ",", some.doStuff1() );
     }
 
@@ -54,7 +54,7 @@ public class AppliesToTest
     public void givenAnAppliesToWhenAnnotationIsOnMixinTypeExpectConcernInInvocationStack()
         throws Exception
     {
-        Some some = module.newTransient( Some.class );
+        Some some = transientBuilderFactory.newTransient( Some.class );
         Assert.assertEquals( ",,..", some.doStuff2() );
     }
 
@@ -62,7 +62,7 @@ public class AppliesToTest
     public void givenAnAppliesToWhenAnnotationIsOnMixinImplementationExpectConcernInInvocationStack()
         throws Exception
     {
-        Some some = module.newTransient( Some.class );
+        Some some = transientBuilderFactory.newTransient( Some.class );
         Assert.assertEquals( ",", some.doStuff1() );
         Assert.assertEquals( ",,..", some.doStuff2() );
         Assert.assertEquals( ",,,", some.doStuff3() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/FragmentAppliesToTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/FragmentAppliesToTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/FragmentAppliesToTest.java
index f29b850..c1847ad 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/FragmentAppliesToTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/appliesto/FragmentAppliesToTest.java
@@ -53,7 +53,7 @@ public class FragmentAppliesToTest
     public void testMixin()
         throws Exception
     {
-        TransientBuilder<Composite1> builder = module.newTransientBuilder( Composite1.class );
+        TransientBuilder<Composite1> builder = transientBuilderFactory.newTransientBuilder( Composite1.class );
 
         Composite1 instance = builder.newInstance();
         assertNotNull( "DependencyOld not injected.", instance.getBuilderFactory() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/association/AssociationEqualityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/association/AssociationEqualityTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/association/AssociationEqualityTest.java
index 4ffc14b..0bc855d 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/association/AssociationEqualityTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/association/AssociationEqualityTest.java
@@ -431,7 +431,7 @@ public class AssociationEqualityTest
     {
         SomeWithAssociations some;
         {
-            ValueBuilder<SomeWithAssociations> builder = module.newValueBuilder( SomeWithAssociations.class );
+            ValueBuilder<SomeWithAssociations> builder = valueBuilderFactory.newValueBuilder( SomeWithAssociations.class );
             builder.prototype().anEntity().set( associated );
             builder.prototype().manyEntities().add( associated );
             builder.prototype().namedEntities().put( "someKey", associated );
@@ -444,7 +444,7 @@ public class AssociationEqualityTest
     {
         OtherWithAssociations some;
         {
-            ValueBuilder<OtherWithAssociations> builder = module.newValueBuilder( OtherWithAssociations.class );
+            ValueBuilder<OtherWithAssociations> builder = valueBuilderFactory.newValueBuilder( OtherWithAssociations.class );
             builder.prototype().anEntity().set( associated );
             builder.prototype().manyEntities().add( associated );
             builder.prototype().namedEntities().put( "someKey", associated );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DereferenceForBootstrappedConcernsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DereferenceForBootstrappedConcernsTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DereferenceForBootstrappedConcernsTest.java
index b7d7a68..1827f85 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DereferenceForBootstrappedConcernsTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/bootstrap/DereferenceForBootstrappedConcernsTest.java
@@ -51,8 +51,8 @@ public class DereferenceForBootstrappedConcernsTest
     public void whenDerefencingInsideConcernThisExpectItToWork()
         throws Exception
     {
-        Result result = module.findService( Result.class ).get();
-        Some some = module.findService( Some.class ).get();
+        Result result = serviceFinder.findService( Result.class ).get();
+        Some some = serviceFinder.findService( Some.class ).get();
         assertEquals( "method()", some.method() );
         assertEquals( some.identity(), result.some().identity() );
         assertEquals( some.identity().get(), result.some().identity().get() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/AbstractMixinTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/AbstractMixinTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/AbstractMixinTest.java
index 9720920..e5000fc 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/AbstractMixinTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/AbstractMixinTest.java
@@ -46,7 +46,7 @@ public class AbstractMixinTest
     @Test
     public void testAbstractMixin()
     {
-        TestComposite instance = module.newTransient( TestComposite.class );
+        TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class );
 
         Assert.assertEquals( "Hello WorldHello World", instance.test( "Hello World" ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/CompositeFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/CompositeFactoryImplTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/CompositeFactoryImplTest.java
index cca8c1a..290e987 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/CompositeFactoryImplTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/CompositeFactoryImplTest.java
@@ -44,7 +44,7 @@ public class CompositeFactoryImplTest
         throws Exception
     {
         Class aClass = FirstComposite.class;
-        TransientBuilder builder = module.newTransientBuilder( aClass );
+        TransientBuilder builder = transientBuilderFactory.newTransientBuilder( aClass );
         builder.newInstance();
     }
 
@@ -54,7 +54,7 @@ public class CompositeFactoryImplTest
     {
         try
         {
-            TransientBuilder<SecondComposite> builder = module.newTransientBuilder(
+            TransientBuilder<SecondComposite> builder = transientBuilderFactory.newTransientBuilder(
                 SecondComposite.class );
             SecondComposite composition9 = builder.newInstance();
             composition9.setValue( "satisfiedBy value" );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
index 28acf98..47ef00c 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
@@ -46,7 +46,7 @@ public class FunctionalListTest extends AbstractZestTest
     @Test
     public void givenArrayListWithMapOpCapabilityWhenMappingIntegerToStringExpectCorrectResult()
     {
-        List<Integer> integers = module.newTransient( List.class );
+        List<Integer> integers = transientBuilderFactory.newTransient( List.class );
         integers.add( 5 );
         integers.add( 15 );
         integers.add( 45 );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/MapOverrideTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/MapOverrideTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/MapOverrideTest.java
index e75a057..53ff78d 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/MapOverrideTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/MapOverrideTest.java
@@ -56,7 +56,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingSizeExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -66,7 +66,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingIsEmptyExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -76,7 +76,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingContainsKeyExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -86,7 +86,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingContainsValueExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -96,7 +96,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingGetExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -106,7 +106,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingKeySetExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();
@@ -122,7 +122,7 @@ public class MapOverrideTest
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingValuesExpectSuccess()
     {
-        ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
+        ValueBuilder<Map> builder = valueBuilderFactory.newValueBuilder( Map.class );
         Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
         Map<String, String> underTest = builder.newInstance();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test1.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test1.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test1.java
index f02c8a4..4234151 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test1.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test1.java
@@ -65,43 +65,43 @@ public class QI247Test1
     @Test
     public void testWithMixinToString()
     {
-        ObjectMethods withMixin = module.newTransient( ObjectMethods.class );
+        ObjectMethods withMixin = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkToString( withMixin );
     }
 
     @Test
     public void testWithMixinHashCode()
     {
-        ObjectMethods withMixin = module.newTransient( ObjectMethods.class );
+        ObjectMethods withMixin = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkHashCode( withMixin );
     }
 
     @Test
     public void testWithMixinSelfEquals()
     {
-        ObjectMethods withMixin = module.newTransient( ObjectMethods.class );
+        ObjectMethods withMixin = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkSelfEquals( withMixin );
     }
 
     @Test
     public void testWithMixinSelfEquals2()
     {
-        ObjectMethods withMixin = module.newTransient( ObjectMethods.class );
+        ObjectMethods withMixin = transientBuilderFactory.newTransient( ObjectMethods.class );
         assertTrue( withMixin.equals( withMixin ) );
     }
 
     @Test
     public void testWithMixinSelfSame()
     {
-        ObjectMethods withMixin = module.newTransient( ObjectMethods.class );
+        ObjectMethods withMixin = transientBuilderFactory.newTransient( ObjectMethods.class );
         assertSame( withMixin, withMixin );
     }
 
     @Test
     public void testWithMixinTwoNotEqual()
     {
-        ObjectMethods first = module.newTransient( ObjectMethods.class );
-        ObjectMethods second = module.newTransient( ObjectMethods.class );
+        ObjectMethods first = transientBuilderFactory.newTransient( ObjectMethods.class );
+        ObjectMethods second = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkTwoNotEqual( first, second );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test2.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test2.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test2.java
index e0783bb..ebe8ef3 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test2.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI247Test2.java
@@ -67,43 +67,43 @@ public class QI247Test2
     @Test
     public void testWithHandlerToString()
     {
-        ObjectMethods withHandler = module.newTransient( ObjectMethods.class );
+        ObjectMethods withHandler = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkToString( withHandler );
     }
 
     @Test
     public void testWithHandlerHashCode()
     {
-        ObjectMethods withHandler = module.newTransient( ObjectMethods.class );
+        ObjectMethods withHandler = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkHashCode( withHandler );
     }
 
     @Test
     public void testWithHandlerSelfEquals()
     {
-        ObjectMethods withHandler = module.newTransient( ObjectMethods.class );
+        ObjectMethods withHandler = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkSelfEquals( withHandler );
     }
 
     @Test
     public void testWithHandlerSelfEquals2()
     {
-        ObjectMethods withHandler = module.newTransient( ObjectMethods.class );
+        ObjectMethods withHandler = transientBuilderFactory.newTransient( ObjectMethods.class );
         assertTrue( withHandler.equals( withHandler ) );
     }
 
     @Test
     public void testWithHandlerSelfSame()
     {
-        ObjectMethods withHandler = module.newTransient( ObjectMethods.class );
+        ObjectMethods withHandler = transientBuilderFactory.newTransient( ObjectMethods.class );
         assertSame( withHandler, withHandler );
     }
 
     @Test
     public void testWithHandlerTwoNotEqual()
     {
-        ObjectMethods first = module.newTransient( ObjectMethods.class );
-        ObjectMethods second = module.newTransient( ObjectMethods.class );
+        ObjectMethods first = transientBuilderFactory.newTransient( ObjectMethods.class );
+        ObjectMethods second = transientBuilderFactory.newTransient( ObjectMethods.class );
         checkTwoNotEqual( first, second );
     }
 


Mime
View raw message