Enthusiastic Thumbs up for Spring Framework

April 25th, 2004

The IOC, Dependency Injection wave is coming into shore for Java developers. The whole IOC idea certainly isn’t new, its just good design.

  • Prefer Delegation to Inheritance
  • Program to Interfaces
  • Decoupling

It seems that something as “simple” as a framework to support these principals would have been happened a long time ago. It’s not that you can’t have good design without a framework, but a good framework should help facilitate good design, and consistency across a system.

One quick disclaimer, I’m endorsing Spring because I have used it and I have gotten results that I’m very pleased with. I’m a little concerned that PicoContainer is falling into the background. From what little I’ve seen PicoContainer seem to be the technically superior IOC container implementation. Unfortunately superior IOC doesn’t seem to be the driving force. The real killer-app of the IOC arena is J2EE simplification, and that’s Spring.

It’s hard to integrate an architecture technology like Spring into a real project with it’s own established architecture. I aimed for the target of the greatest opportunity, our DAO layer. Our application uses generated DAO’s laden with customizations, which present a number of problems.

  • Customizations make them very hard to regenerate or tweak
  • Profuse boilerplate code makes them very verbose and hard to read.
  • Crosscutting concerns like error handling are hard to change
  • The verbose boilerplate code encourages cut and paste(and associated errors)

Enter Spring, with its IOC. All the boilerplate code is isolated to one place, with callbacks for the code that really does vary. No more worrying about resources not being handled correctly because a novice was in cutting and pasting. We can still use code generation for the easy PreparedStatementCreator’s, and ResultReader’s, and we can add our own custom PreparedStatementCreator’s and not have to worry about the generator accidentally clobbering them. Transactions are now declarative and we didn’t need to worry about managing them in the application code or using Session EJB’s.

Our DAO layer just got about 10 times more manageable, and it was easy. I will be looking for more opportunities to let Spring make my life easier, and I would encourage any one else to do the same.

What's up with all of this stupid reality TV

April 25th, 2004

This reality TV craze has been bothering me for a long time. Most of these programs are unethical, and anti-social.

I've had many discussions with friends about reality TV's ethical considerations. Most of the tune-in factor is the emotional nature of the interactions. The problem is that viewers are treating other people’s exploitations as entertainment. Sure the people on these shows are consenting but when is the consented exploitation of individuals for entertainment really any different than prostitution? The only difference that I see is that reality TV is more socially acceptable. The people on these shows have their different motivations; money, fame, or what-ever, but in the end they are attempting to achieve these goals through exploitation. I think that it is morally wrong to contribute to this exploitation by providing a viewership.

I think that these shows are also very anti-social. Conversations that I have are quickly turning from satisfying into in-depth analysis of Boston Rob's survivor strategy. I remember a quote and I can't find it's source but it goes, “Small people talk about people, medium people talk about events, and big people talk about ideas.” I'm seeing “Big” people all around me turning into small shallow people. People are starting to find the excitement in their own lives by watching fabricated events on TV. I would rather watch something educational or socially redeeming, but I can’t because of all of this reality TV drivel.

I can only hope that the sensational nature of reality TV is going to be its undoing. These shows are going to have to one up each other until they reach a level that the people are going to reject them. In the mean time I will remain a strong critic.