Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This also makes unit testing extremely diffcult since you have the joy of creating mock objects for your Context, ConnectionFactory and Connection. I have all but given up writing test code at work. The various j2ee frameworks I have to use make it almost impossible.


Drop Classic J2EE and learn Spring. It will make things sooo much easier and manageable.


No kidding. J2EE is an abomination, and is almost single-handedly responsible for destroying Java's reputation with a lot of programmers. Spring is a giant leap forward.

Grails is basically Spring MVC, wrapped in dynamic language goodness. I'm using it for a project right now, and it's shockingly terse and clean. It's also a lot of fun, which is something I never thought I'd say about a Java "Enterprise Framework".


It definitely does make the above more manageable, but it doesn't solve the core problem which is that the whole design pattern is built for complete configurability, but without sensible defaults. In some sense, Spring only exists to manage the massive configurability of Java design patterns, but by adding it's own configurations to the mix. It's definitely a cool idea, but the better solution is to just avoid factory/context patterns. It's solving a problem most of us don't have.


"""It's solving a problem most of us don't have."""

I think that is because a lot of people simply don't know what good design is. I've seen many projects where people think they don't need Spring but where it made 100% sense. And made the project simpler and easier to manage and test.

Even in small projects it makes a lot of sense to have a good seperation in layers or services and to use a mostly invisible helper to glue things together.

Modern Spring can configure your app with a very minimal amount of XML. If you don't like XML then use annotation based configuration.

I totally disagree with your statement that Spring only exists to manage the 'massive configurability of Java design patterns'. The only patterns that the foundation of Spring introduces are IoC and 'configuration by convention'. Those have been proven to be extremely powerful patterns that simply allow you to burn half of the 'J2EE Design Patterns' books.


Spring is definitely an improvement, however we had a serious problem getting it up and running in our environment (it was a while ago so I can't remember what it was exactly) and had to give up on it.

It really does not help that all of our web projects are struts 1 and we have still have a fair amount of torque projects hanging around.


Spring's dependence on XML files always bugged the hell out of me. I like to be able to see what a piece of code does by looking at the code. Every time I tried to get excited about Spring I instead felt like at I was more and more at the mercy of my IDE.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: