Advices on partitioning code in assemblies?

Aug 19, 2009 at 8:57 AM

Hi I really like CompositeWPF libraries it is really nice and helps to loosen up dependencies, but I have one question is it really necessary to split up the code in several assemblies just cause you don't wanna have any dependencies between modules or between shell and modules?

Right now I have the following assembly structure

for example:

Client.Desktop

Client.Desktop.Modules

    Namespaces

     Client.Desktop.Modules.Login

     Client.Desktop.Modules.Order

Client.Desktop.Infrastructure

I'm am thinking of to just merge this three into one assembly and let the namespaces partitioning the code.

But I have a stomach feeling that I maybe missing something here? What should I do? :)

Aug 19, 2009 at 12:28 PM

You can merge the Modules to one assembly, this will work.

But you won't be able to developed, test and deploy modules separately or by different teams.

Aug 19, 2009 at 1:30 PM

Well I could but that depends on how I make my module registration, but that isn't the big question :)... I guess the answer is it depends as usual :)

 

Aug 19, 2009 at 5:00 PM

Hi Niclas

It is not necessary “per se” to split the code in several assemblies to avoid having dependencies between modules. Prism is a library, so you can take the features you feel best suit your application requirements.

Take into account that if you do not have a modular application, it might be harder to maintain/extend because of the high coupling between all its components. This might not be a requirement for your application, so there would be no problem in leaving it out. If you merge modules in the same assembly, you will have a modular application, so the aforementioned would not be the case.

In my personal opinion, evaluating the pros and cons of not having a modular application/having modules in the same assembly would be the starting point. Once weighed all the pros and cons have been evaluated, then the decision can be taken. It might be an overkill to have a modular application/multiple assemblies if you are just creating tools for your own use. But if you are creating a LOB application, or something that might grow, going modular would be the better choice.

The Modularity Quickstarts show how to load modules in the same assembly in case you do use this approach.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Aug 19, 2009 at 5:43 PM

dschenkelman, your answer is exactly what I'm thinking, I just wanted it to be confirmed by someone else :)