Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

If my solution has both a "dataservice" project and a "business logic" project, where do the entity models, which represent database tables, belong?

At first i thought putting them in the dataservice layer, but then i would need duplicate models in the business logic layer, if i wanted to provide reusable logic dealing with or being dependant of database data.

Putting models in the business logic project, would force the dataservice layer to be dependant on the core project.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Create a separate "Domain" project that contains your Domain Entities.

Important note: Your Entities may not be the same thing as your datatables.

Your "DataService" project should know how to map from Domain Entities to datatables.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.