Optimal number of modules

Topics: Prism v2 - Silverlight 4
Oct 27, 2010 at 5:18 PM

Hello,
In my firm we create application using Prism and on the begining someone decided that we will create for every View, new module.
Right now we have 70-80 of views and I think over 80 modules :/ 


Compilation is very very long :/ so I suggested a change of strategy and try to create modules not for View but for part of Business Logic.
Can you tell me what is the optimal number of modules and optimal size of XAP file ?
I want to find the best solution for that issue.

Best regards,
Lukas Szumylo

 

Oct 27, 2010 at 5:33 PM

The optimal number of modules varies by application, so there is no magic ratio.  However, if you look in the docs from Prism v4 Drop 10, we offer some guidance on partitioning your application in Chapter 4: Modular Application Development.  It is definitely worth reading.

My personal approach (not an official view) is to try to find some logical grouping (by use case for example), and place the views and application services necessary for each grouping into one module.  With this approach, one module may have a single view, while another may have 10 or more views, depending on the complexity of the overall feature you are adding to the app.

After reading Chapter 4, let me know if you have more questions.