I'm attempting to create a small demo web application that is loosely coupled, highly testable, has nice clean code, etc. In short, I'm experimenting with doing things the right way. ;)
I currently have three projects in my Wolfie solution:
- Wolfie.Core - contains business entities
- Wolfie.Data - contains data access code, references Core.
- Wolfie.Web - will be a nancy web site.
As it stands the Core knows nothing about any of the other projects. Data has to reference Core as Core has the types that Data will return. So at this point I find myself realising that Web will need to reference both Core and Data to be able to work as the entity type is in Core and the database calls are in Data.
All of the repository classes in Data have interfaces so that the repositories can be mocked out for testing.
I don't think I want to put any database specific code or references into Core, and I want to keep my entity business rules out of Data.
Is it correct to reference both projects from Web? or would another project between Web and the others be required so that Web only references the one place and isn't then responsible for calling Data methods etc.
What I'm aiming for is an architecture where my core application is independent of both the Data and Web layers.
I hope I've made some sense and I look forward to some helpful replies.