btw: opinions are opinions when we are talking about the same thing. So you have a mutable entity or is it a DTO?
I talk about DTOs and you talk about the putting-entities-on-the-wire anti-pattern. Even if you claim it is not an anti-pattern in your scenario it is certainly not a DTO. Thanks, Greg On Fri, May 1, 2009 at 10:45 AM, Fabio Maulo <[email protected]> wrote: > IMO interface on DTOs should be the norm since DTOs are contracts with > something outside the application or with other tier of the same > application. > Now... > IDisplayableEntity { int Id{get;} string Description{get;}} > Today I can send you an implementation of a mutable entity, tomorrow I have > time to implements a not-mutable entity instance, after tomorrow I can send > you something that come of some kind of projection (using LINQ or a specific > transformer of a DB result). > btw opinions are opinions > > 2009/5/1 Greg Young <[email protected]> >> >> key concept is that there is no behavior ... what is the interface >> really? What is it that you would be varying from one implementor to >> another? >> >> It's like trying to come up with valid circumstances to put interfaces on >> DTOs >> >> Greg >> >> On Fri, May 1, 2009 at 10:24 AM, Fabio Maulo <[email protected]> wrote: >> > I think that there is something to gain even when the entity does not >> > have >> > behavior (and the EntityMode.Map is only one example). >> > >> > 2009/5/1 Greg Young <[email protected]> >> >> >> >> > Could you unpack that a bit further? Are you suggesting that >> >> > applicability >> >> > of interfaces is primarily around behavior rather than as a means to >> >> > describe the entities and value-types? I started the project working >> >> > on >> >> > the >> >> > behavioral aspects and it was convenient for testing to rough in the >> >> > domain >> >> > objects being acted on by those behaviors as interfaces. So, I >> >> > suspect >> >> > that >> >> > may fall into the category of anti-pattern if I'm understanding you >> >> > right. >> >> >> >> shouldn't the behaviors be in the domain objects themselves? >> >> >> >> Beyond that there is almost nothing to gain by putting the interfaces >> >> around them. It may seem easier when writing tests but when dealing >> >> with those kinds of tests you are probably better off dfealing with >> >> the real objects anyways (fakes). >> >> >> >> Cheers, >> >> >> >> Greg >> >> >> >> On Fri, May 1, 2009 at 10:03 AM, Everett Muniz <[email protected]> >> >> wrote: >> >> > Could you unpack that a bit further? Are you suggesting that >> >> > applicability >> >> > of interfaces is primarily around behavior rather than as a means to >> >> > describe the entities and value-types? I started the project working >> >> > on >> >> > the >> >> > behavioral aspects and it was convenient for testing to rough in the >> >> > domain >> >> > objects being acted on by those behaviors as interfaces. So, I >> >> > suspect >> >> > that >> >> > may fall into the category of anti-pattern if I'm understanding you >> >> > right. >> >> > On Fri, May 1, 2009 at 9:42 AM, Greg Young <[email protected]> >> >> > wrote: >> >> >> >> >> >> Are you interfaces like ICustomer IOrder etc or are they behavioral >> >> >> / >> >> >> use case based? >> >> >> >> >> >> the former is most likely an anti-pattern. >> >> >> >> >> >> Greg >> >> >> >> >> >> On Thu, Apr 30, 2009 at 6:51 PM, everettmuniz >> >> >> <[email protected]> >> >> >> wrote: >> >> >> > >> >> >> > For those of you using NHibernate in DDD projects do you structure >> >> >> > your factory and repository methods to return/accept interfaces or >> >> >> > their implementations? I've written the domain model and service >> >> >> > layer in my current project to rely heavily on interfaces rather >> >> >> > than >> >> >> > implementations but given that NHibernate maps to classes and not >> >> >> > interfaces it seems like it may make more sense to structure the >> >> >> > factories / repositories to at least work with classes rather than >> >> >> > the >> >> >> > interfaces they're based on. >> >> >> > >> >> >> > > >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> It is the mark of an educated mind to be able to entertain a thought >> >> >> without accepting it. >> >> >> >> >> >> >> >> > >> >> > >> >> > > >> >> > >> >> >> >> >> >> >> >> -- >> >> It is the mark of an educated mind to be able to entertain a thought >> >> without accepting it. >> >> >> >> >> > >> > >> > >> > -- >> > Fabio Maulo >> > >> > > >> > >> >> >> >> -- >> It is the mark of an educated mind to be able to entertain a thought >> without accepting it. >> >> > > > > -- > Fabio Maulo > > > > -- It is the mark of an educated mind to be able to entertain a thought without accepting it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
