Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Adding Module Dependency

$
0
0

Adding Module Dependency and addressing

The Project contains some Modules and a Domain
Here I'm using Unity DirectoryModuleCatalog.


We Need ModuleX (Entity Data) to be a dependency of Domain Module.
The first strategy I've used is Registering Modules via Directory.
Don't know whether should I change it or not:

Code :

        protected override IModuleCatalog CreateModuleCatalog()
        {
            var moduleCatalog = new DirectoryModuleCatalog();

            string stPathStartup = Environment.CurrentDirectory; // Shell Project Dir
            string stPathModules = Directory.GetParent(stPathStartup).Parent.Parent.Parent.FullName + "\\Build\\Modules";

            moduleCatalog.ModulePath = stPathModules;
            return moduleCatalog;
        }


       



Not sure but as an alternative to solve this via App.Config :

<configuration>
  <modules>
    <module assemblyFile="../Modules/Xz.Domain.dll" moduleType="Xz.Domain,Xz.Domain"
            moduleName="Xz.Domain">
      <dependencies>
        <dependency moduleName="Xz.Dictionary" />
      </dependencies>     
    </module>
  </modules> 
</configuration>    


Is it the only solution ?
Did I do it right ?
Yet I didn't remove the "CreateModuleCatalog".
Assembly Name and Namespace : Xz.Domain   
Project Name shown in the Solution List : Domain



Questions :
       
        How can I Set the Domain Module's Dependency to ModuleX ?
        And be sure the ModuleX were loaded before the Domain Module.

------------
The Folder and Project structure is as below:

Modules > ModuleX
Domain --> The App.Xaml shown is here
Shell
--
The Build Folder is one Level up from these
The solution file (sln) is 3 Levels up from these

Thanks for any help.


Viewing all articles
Browse latest Browse all 1878


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>