Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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.