First, should a DTO be generic or specific? I don't have a strong opinion on this. Probably because I don't use DTOs very often.
Well basically there is a web layer which invokes service hosted in another server [ejb]. Hence the requirement for a DTO. However I have seen too much code going into populating the specifc DTO at the web layer and getting out the from the response DTO. Hence idea of having a generic DTO which is a universal container.
Service accepts the DTO, gives it domain [ in my case, thinking of having a constructor accepting the universal DTO]. Service use the Domain for any behavior related functionality.
And I find that my domain objects, even if they might start as simple data holders, attract behaviour quite quickly. And they do that quicker if they are not designed as generic data holders, which I prefer for that reason.
I completely agree. I think the intention should always be towards a proper domain.
Does *that* make sense?
Absolutely. :-)