Thursday, May 03, 2007

Technique Digestion

Try the following policies on for size:
  • GAC - Only interfaces and the DI container engine ever get put in the GAC
  • Interfaces - All application- or layer-boundary interfaces should go into the GAC. Application interfaces may share the application's namespace, but the application's interfaces must reside in a separate assembly. The interface assembly(ies) must go in the GAC; the implementation assembly(ies) must NOT go in the GAC.
  • DI Container - Goes into the GAC, and has machine-level config info telling it which class versions implement which interface versions. Should support interface version redirection, preferably by reading policy files stored in the GAC.
  • Domain interfaces and implementations should follow the same rules as an application's interfaces and implementations.
  • Domain classes and interfaces should NOT share either assemblies or namespaces with application-specific logic. This will allow them to evolve independently, and makes domain object reuse across applications much easier.
  • Both domain objects and application- and infrastructure-specific services must always be instantiated via the DI container, or returned from factories that reside in the domain class's assembly.

No comments: