9

I have a multi tiered project made up of three sub projects, i.e. Data access project, Business Logic project and Presentation project, where should interfaces be defined? I'm guessing that there should be interfaces defined in both the DAL and BLL.. In the context of testing the Business Logic Layer by using "test" data based on the interface it seems that maybe there should be a separate project with just the interfaces?

Any best practices or idea on how this should be arranged?

asked Dec 19, 2016 at 15:35

1 Answer 1

9

One good approach to this is to use the stairway pattern:

enter image description here

So the DAL lives in one project, its interfaces in another, the BLL in a third, its interfaces in a fourth and so on.

The idea being that when testing eg the business layer, you then just reference the DAL interfaces project, rather than dragging all of the real DAL and eg NHibernate into scope just to get at those interfaces.

As far as I know, this pattern is the creation of Gary McLean Hall in his book, "Adaptive Code via C#: Agile coding with design patterns and SOLID principles"

answered Dec 19, 2016 at 15:44

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.