Say I had a business object library which was using IoC to implement a data access library. Where should I define the Data Access Interface? Which library does it belong? Or should it be in a separate library just for interfaces?
相关问题
- How to map interface names to different method nam
- Union of two object bags in Java
- Should this property be part of my object's in
- How to get a pointer to a variable that's mask
- Autofac registers components multiple times
相关文章
- List可以存储接口类型的数据吗?
- When to use Interfaces in PHP
- Can Eclipse auto-generate an interface of a 3rd pa
- Implementing interfaces in partial classes
- What is the benefit of using '--strictFunction
- In Delphi, how can you check if an IInterface refe
- Dependency injection for extension classes?
- internal member in an interface
I would define the interfaces within the business domain. Then the implementations of the interfaces would be in a library that references the business domain (and is referenced by whatever the application context is, or by an IoC library which is referenced by the application context).
Then swapping out one implementation with another is just a matter of creating another library and swapping the reference in the application context.
In a .NET project structure it would look something like this: