Architecture + Prism

Topics: Prism v1, Prism v2 - Silverlight 2, Prism v2 - Silverlight 3, Prism v2 - WPF 3.5
Apr 1, 2010 at 9:59 AM

Hi,

I have got some concerns about Prism and architecture, specially about the Infrastructure and what should be written in it. This is not not crystal clear to me.

What exactly should be written in the Infrastructure?

  •  shared model (business model)
  • shared events
  • exceptions 
  • ...

Should the business code of the application be in the Infrastructure? or should it be in another assembly referenced by the Infrastructure?

What if I want (or need) to share the Infrastructure across applications in a solution? (Only one infrastructure shared by all the applications)

Should the business model be in the Infrastructure (this could dramatically increase the size of the infrastructure) or should each application have its own and be referenced by the infrastructure? (in order to keep this the tiniest possible).

Is it a good idea that the infrastructure depends on other assemblies that contain business model?

 

Any help would be appreciated!

Thx,

toto.

 

Apr 5, 2010 at 7:37 PM

Hi Toto,

There is no stone writing about what should be included in the Infrastructure project. As you said, business entities, event aggregator events, exceptions and interfaces to services are commonly placed in the Infrastructure project of each application if they are used by at least two different modules. Different applications usually have different Infrastructure projects as each of them requires other shared components.

A possible approach to increase code reuse is, as you suggested, have each of those parts separated in different assemblies, and depending on the application each Infrastructure project can vary the projects that it references. The problem about having many applications use the exact same Infrastructure project is that they might end with an assembly that is much larger than it would need to be.

Something to consider when adding components to the Infrastructure project is always keeping your modules decoupled.

Please let me know if this helps.

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