Hmmmmm, quoting from Fowler to back up one's arguments. Sounds like fun - let me try:
Quote:
Furthermore, each layer usually hides its lower layers from the layers above, so layer 4 uses the services of layer 3, which uses the services of layer 2, but layer 4 is unaware of layer 2. (Not all layering architectures are opaque like this, but most are - or rather most are mostly opaque.
Chapter 1 - "Layering", 2nd paragraph, page 17.
Patterns of Enterprise Application Architecture (written & published much more recently than the refactoring book)
Now seriously, in the words of another wise man, I don't want this to degenerate into a pissing contest.
In part at least, I do agree with you. We do actually achieve some real separation, but it's really hard it's imperfect at best and it does suffer from all the problems you've mentioned. To be honest, I've been asking myself some hard questions about the real value of strictly enforcing separation of the application layers this way, and I actually am pretty sure it's not worth the level of effort it takes.
But on the other hand, I don't know what else to do.
Layering
sounds like a good idea, it's just that enforcing the separation of layers (which is the whole point) just turns out to be too hard. But is the answer really to just throw away the concept and say "it's too hard, so we'll just let the domain model propogate back up to the presentation layer, stop thinking about it and tell anyone who asks that they don't know squat about real object orientation"?
Quote:
Is it really the case that your presentation layer does not change when you change your domain model??
Actually, yes, for small changes. We've created a concept we call Declarative DTOs, where the DTO is not only a packaging for the data, it is also a declaration of where in the domain model (given an arbitrary graph root) each attribute comes from. So when attributes move around, the DTO can actually track those movements. Of course, it only works for simple changes; but then if the domain model really drastically changes, the presentation layer will change too (uh-oh, sounds like a shotgun change, better refactor that domain model away from the GUI, eh?).
That said, our Declarative DTOs suck, thw whole concept sucks and I wouldn't recommend anyone even bother with the idea. But what else to do?
You said in your blog that Christian got very excited about CarrierWave a while ago - which kind of implies that he's not excited about it anymore? I looked at it and it seems like it might be a way forward, especially with a quote like this from their front page:
Quote:
It means that... Client and server side developers will have an architecturally enforced layer of isolation.
I'd really like to hear from Christian on this if he did any serious research int it?
Also, from your blog entry and on the dev mailing list, you've been talking about SDOs lately. Do you see them being useful for this kind of stuff, or are you looking at them from some other kind of perspective? (maybe looking at making Hibernate intergate as one of the datasources or something)