As I originally commented to John, I do think he leaves out a few desirable traits of package-by-layer. For instance, it can be desirable to define one common backend. This allows for sharing, validation, testing, optimization etc. in one place.
There's a price to pay for this of course, most of which revolving around lack of modularity, vague separation-by-concerns and little information hiding. This can make it demanding and slow for RAD/lean teams to use package-by-layer. Current Java is very rigid/strict at this point, a publisher and a subscriber needs to be bound by an interface for instance - and where to place this contract? I see dependency injection and AOP as a way to remedy these cross-cutting concerns. At the same time I miss some of the stuff found in C# where a name space is not a physical thing, where there are partial classes, extension methods and method pointers. Interestingly IDE's sometimes take a punch at this too, as in the case of Eclipse MyLyn. Our associative minds are wired to favor package-by-feature yet we almost always see package-by-layer. I for one would love to hear this "horizontal vs. vertical" aspect discussed further on the podcast. It feels like we can do better here. /Casper On 13 Jun., 13:15, Christian Beil <[email protected]> wrote: > Hi all, > > John O'Hanley (http://www.javapractices.com) has an interesting > article about harmful Java > practices:http://www.javaworld.com/javaworld/jw-07-2008/jw-07-harmful-idioms.html > > What is your opinion on that? I'm especially interested in what you > think about structuring packages? Do you package by layer (ie > dao,service,controller,...) or do you package by feature? > > Cheers, > Christian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" 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/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
