Sunday, August 20, 2006 1:30 PM
After just reading Wes Nerman's post on closers I read "This was one of my reasons for advocating lightweight exceptions in the past." Now this is blatently out of context, however the thing that grabbed me was his desire for lighterweight exceptions. What is it with this lightweight movement? Not that I am against it, but it strikes me as odd that there is this big push for lightweight options.
Back in the days of J2EE they had these heavyweight EntityBeans which developer hated, and so they developed Hibernate which is to my knowledge the same thing as EntityBeans but lightweight in the sense that their is no inheritance mandated or interfaces to implement. (How ever the .Net'ers seem to be rebuilding EntityBeans with the CSLA framework.)
Also in J2EE is the Application container which I guess was quite heavy and would kill the Red/Green/Refactor process with its slow startup. So a group of guys got together and developed the Spring framework.
Proceeses and threads. The OS gives us heavy threads (I don't really know what that means), Windows gives us smaller ones, and .Net gives us even smaller ones. This makes some sense, I don't think its possible for Windows to give us a bigger process than what the OS gives us. But if we are just carving them up smaller and smaller why not just provide them from the beginnig? Seperation of Concern is the biggest reason I can think of at the moment. However Singularity, MSFTs new research OS, uses lightweight SIPS, so maybe SoC is not the issue.
Lastly, we have the .Net exceptions. These heavy weight exceptions give us loads of valuable details, and I assume that this is what makes them heavy. So what would be the advantage of a lightweight exception? This post talks about lightweight exceptions, but I am not really digging his code. Seems like it is a bit of a cop out, but I can't explain why. I have also read(in the comments) that functional programming uses exceptions as flow control.
Ok, so that was a lot of rambling, but I think i am on the lightweight bandwagon. I love Castle's MicroKernel, i moved away from CSLA to NHibernate and I am loving it everyday. I am now in the process of wishing for a lighterweight web framework that is actually more of a lightweigt MVP/MVC framework for the Web and Win32 apps. Until then though i will toil in my own misery building my version of that framework.
Cheers