public virtual CompositeBuilder CreateBuilder(StructureServiceProviderSPI structureServiceProvider, Type[] compositeTypes)
        {
            ThrowIfGenericParams(compositeTypes);
            CompositeModel       model = structureServiceProvider.Structure.ModelInfoContainer.GetCompositeModelInfo(this.ModelScopeSupport.AssemblyScopeSupport.ModelType, compositeTypes).Model;
            UsesContainerMutable uses  = UsesContainerMutableImpl.CreateWithParent(model.UsesContainer);

            return(new CompositeBuilderImpl(compositeTypes, uses, (CompositeInstanceImpl)this.CreateInstance(structureServiceProvider.Structure, model, compositeTypes, uses.Query)));
        }
        protected ApplicationArchitectureSkeleton(IEnumerable <CompositeModelTypeAssemblyScopeSupport> modelTypeSupport)
        {
            ArgumentValidator.ValidateNotNull("Composite model type supports", modelTypeSupport);

            this._collectionsFactory = CollectionsFactorySingleton.DEFAULT_COLLECTIONS_FACTORY;
            this._modelTypeSupport   = this._collectionsFactory.NewDictionaryProxy(modelTypeSupport.ToDictionary(support => support.ModelType, support => support)).CQ;
            this._metaInfoContainer  = UsesContainerMutableImpl.CreateEmpty();
            this._additionalInjectionFunctionalities = this._collectionsFactory.NewDictionaryProxy <Type, InjectionFunctionality>();
        }
Exemple #3
0
        public CompositeAssemblyInfoImpl(Int32 id, CompositeModelType modelType, UsesContainerQuery parentContainer)
        {
            ArgumentValidator.ValidateNotNull("Composite model type", modelType);

            this._id                = id;
            this._fragmentInfos     = new Dictionary <FragmentModelType, FragmentAssemblyInfo>();
            this._defaultProviders  = new Dictionary <PropertyInfo, Func <PropertyInfo, ApplicationSPI, Object> >();
            this._metaInfoContainer = UsesContainerMutableImpl.CreateWithParent(parentContainer);
            this._modelType         = modelType;
            this._types             = new HashSet <Type>();
        }
Exemple #4
0
        public AssemblerImpl(ApplicationArchitecture <ApplicationModel <ApplicationSPI> > applicationArchitecture, Func <Int32> newCompositeIDRequestor, DictionaryQuery <CompositeModelType, CompositeModelTypeAssemblyScopeSupport> modelTypeSupport, UsesContainerMutable parentContainer, CollectionsFactory collectionsFactory)
        {
            ArgumentValidator.ValidateNotNull("Application architecture", applicationArchitecture);
            ArgumentValidator.ValidateNotNull("ID requestor function", newCompositeIDRequestor);
            ArgumentValidator.ValidateNotNull("Model type support", modelTypeSupport);
            ArgumentValidator.ValidateNotNull("Parent uses container", parentContainer);
            ArgumentValidator.ValidateNotNull("Collections factory", collectionsFactory);

            this._applicationArchitecture = applicationArchitecture;
            this._newCompositeIDRequestor = newCompositeIDRequestor;
            this._collectionsFactory      = collectionsFactory;
            this._compositeInfos          = this._collectionsFactory.NewDictionaryProxy <CompositeModelType, DictionaryWithRoles <Type, ListProxy <CompositeAssemblyInfo>, ListProxyQuery <CompositeAssemblyInfo>, ListQuery <CompositeAssemblyInfo> > >();
            this._assemblyScopeSupport    = modelTypeSupport;
            this._parentContainer         = parentContainer;
        }
Exemple #5
0
        internal ModuleArchitectureImpl(
            String moduleName,
            LayerArchitecture layer,
            UsesContainerQuery parentContainer,
            Func <Int32> compositeIDGenerator,
            DictionaryQuery <CompositeModelType, CompositeModelTypeAssemblyScopeSupport> modelTypeSupport
            )
        {
            ArgumentValidator.ValidateNotNull("Layer", layer);
            ArgumentValidator.ValidateNotNull("Parent meta-info container", parentContainer);

            this._moduleName = moduleName;
            this._layer      = layer;
            this._metaInfo   = UsesContainerMutableImpl.CreateWithParent(parentContainer);
            this._assembler  = new LayeredCompositeAssemblerImpl(this, compositeIDGenerator, modelTypeSupport, this._metaInfo, layer.Architecture.CollectionsFactory);
            this._domainSpecificAssemblers = new DomainSpecificAssemblerAggregatorImpl <LayeredCompositeAssembler>(layer.Architecture.CollectionsFactory);
        }
Exemple #6
0
        internal LayerArchitectureImpl(
            LayeredArchitecture application,
            UsesContainerQuery parentContainer,
            Func <Int32> compositeIDGenerator,
            DictionaryQuery <CompositeModelType, CompositeModelTypeAssemblyScopeSupport> modelTypeSupport,
            String name,
            Action <LayerArchitecture[]> usageAction
            )
        {
            ArgumentValidator.ValidateNotNull("Application", application);
            ArgumentValidator.ValidateNotNull("Model type support", modelTypeSupport);
            ArgumentValidator.ValidateNotNull("Composite ID Generator", compositeIDGenerator);
            ArgumentValidator.ValidateNotNull("Action to tell usage", usageAction);
            ArgumentValidator.ValidateNotNull("Parent meta-info container", parentContainer);

            this._application          = application;
            this._compositeIDGenerator = compositeIDGenerator;
            this._usageAction          = usageAction;
            this._layerName            = name;
            this._modelTypeSupport     = modelTypeSupport;
            this._metaInfo             = UsesContainerMutableImpl.CreateWithParent(parentContainer);
            this._modules = application.CollectionsFactory.NewDictionaryProxy <String, ModuleArchitectureImpl>();
            this._domainSpecificAssemblers = new DomainSpecificAssemblerAggregatorImpl <LayerArchitecture>(application.CollectionsFactory);
        }
Exemple #7
0
 internal SingletonAssemblerImpl(SingletonArchitecture applicationArchitecture, Func <Int32> newCompositeIDRequestor, DictionaryQuery <CompositeModelType, CompositeModelTypeAssemblyScopeSupport> modelTypeSupport, UsesContainerMutable parentContainer, CollectionsFactory collectionsFactory)
     : base(applicationArchitecture, newCompositeIDRequestor, modelTypeSupport, parentContainer, collectionsFactory)
 {
 }
 public CompositeBuilderImpl(IEnumerable <Type> actualCompositeTypes, UsesContainerMutable usings, CompositeInstanceImpl compositeInstance)
 {
     //         this._compositeTypes = actualCompositeTypes;
     this._usesContainer = usings;
     this._instance      = compositeInstance;
 }
Exemple #9
0
 internal LayeredCompositeAssemblerImpl(ModuleArchitecture moduleArchitecture, Func <Int32> newCompositeIDRequestor, DictionaryQuery <CompositeModelType, CompositeModelTypeAssemblyScopeSupport> modelSupport, UsesContainerMutable parentContainer, CollectionsFactory collectionsFactory)
     : base(moduleArchitecture.Layer.Architecture, newCompositeIDRequestor, modelSupport, parentContainer, collectionsFactory)
 {
     this._module = moduleArchitecture;
 }