Layer Supertype In Infrastructure Layer?

Jun 30, 2008 at 5:33 PM
Hi Tim-- I really like your use of a Layer Supertype (EntityBase) to formally provide identity to entity objects in the domain model. But I'm struggling with the idea of locating EntityBase in the Infrastructure layer. It seems like it should go in the Domain Model layer. And that tells me that I am probably missing something.

On page 20, you explain that EntityBase lives in the Infrastructure layer because it is not really part of the domain logic. I think that's what I am scratching my head over. Could you expand on that a bit? A layer supertype looks to me like it would live in the layer that it supertypes.

Thanks!

Coordinator
Jul 3, 2008 at 4:54 PM
Dave,

Thanks!  You may have noticed that later on I refactored everything to depend on IEntity instead of EntityBase, and EntityBase implements IEntity.

The way I was looking at it was that it was just a helper for the Domain Model, it did not contain any business logic...but now you have me thinking, maybe I will revisit that to see if it will work out in the Domain Model.  I do the same thing for some of the UI infrastructure classes too.

dcveeneman wrote:
Hi Tim-- I really like your use of a Layer Supertype (EntityBase) to formally provide identity to entity objects in the domain model. But I'm struggling with the idea of locating EntityBase in the Infrastructure layer. It seems like it should go in the Domain Model layer. And that tells me that I am probably missing something.

On page 20, you explain that EntityBase lives in the Infrastructure layer because it is not really part of the domain logic. I think that's what I am scratching my head over. Could you expand on that a bit? A layer supertype looks to me like it would live in the layer that it supertypes.

Thanks!