I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate .Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Interfaces?
Put your domain objects and interfaces in a seperate "domain" assembly.
This assembly should never reference anything but the core .net assemblies.
This way you get a clean seperation from your domain/service model and your implementation.
Edit:
http://jeffreypalermo.com/blog/the-onion-architecture-part-1/
I wouldn't put the interfaces into a separate assembly just for the sake of it. However, if the interfaces take part in any form of IPC or extensibility architecture then it often makes sense to give them their own assembly.
If you have projects that need to reference each other, then yes, you will need a separate assembly for the interfaces, but you should also carefully examine architecture to see if there is another way of resolving the circular dependency.
I prefer keeping the most common or simple implementations of the interface in a sub-folder (and namespace) following the name of the interface.
\project\ \project\IAppender.cs \project\Appender\ \project\Appender\FileAppender.cs \project\Appender\ConsoleAppender.cs
If I extend this class outside the project. In a special project, repeat the folders/namespace similarly.
\specialproject\ \specialproject\Appender\ \specialproject\Appender\MemoryAppender.cs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With