1

I am currently new to Dependency Injection pattern. I am influenced by link by Mark Seemann.

I have a confusion regarding whether an interface for an agent class of some agent module should be included in domain layer? by agent I mean a class / module that interacts with external wcf/ webservices.

I have a diagram that shows it. In short, is it Ok to have:

IProductAgent interface in Business layer where the actual implementation will be in an Agent Module.

The confusion arises by the fact that: Is calling a service even considered a business rule?

Today a service fulfills a facility, tomorrow there might be some another means of catering this same facility. Liskov's Substitution Principle.

Apologies if I am mixing things here.

asked Aug 29, 2013 at 17:28
2
  • I don't see anything in your "diagram" link. Commented Aug 29, 2013 at 17:29
  • @RobertHarvey fixed the link Commented Aug 29, 2013 at 17:36

1 Answer 1

1

Yes, the domain layer may have external dependencies where the dependencies are defined by interfaces. Taking this approach makes the domain layer ignorant of the actual implementation

Erik Evans who defined Domain Driven Design does in fact use this approach in his book to be able to load domain entities from a data source.

answered Aug 29, 2013 at 17:42

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.