Random Thoughts of a Scatterbrain.
 Thursday, February 08, 2007

Revisiting Spring.Net

2/8/2007 11:25:51 AM (Eastern Standard Time, UTC-05:00)

Spring.Net is an application framework which has its roots in the Spring Framework for Java.

Now first of all, I know many developers have an averse reaction to the use of the phrase "application framework" and immediately reject such things without second consideration.  I always hear tales that begin like so: "Well, on this one project, we used an application framework and it ended up not doing anything exactly the way we wanted and we had to modify it anyways..."

Four thoughts on this:

  1. No two applications are exactly alike.  If that were so, we'd all be out of jobs as software engineers because it'd probably have already been done before.  As well, no two application frameworks are alike (although on some level, Spring is interchangeable with Castle).
  2. Spring, I have found, does not restrict me in anyway in terms of my solution design.  If anything, it frees me to use more flexible designs and allows me to create much cleaner and better designs.  Inversion of Control is your friend.
  3. Spring includes the source.  Dude, if it doesn't do exactly what you want it to, you are 100% free to modify and reuse it (and maybe even resubmit it to the project if it's well written and useful).
  4. The documentation and development team on Spring (and Castle to a lesser degree) are great.  The documentation is very thorough and well organized and the developers are constantly monitoring the discussion forums and reaching out to users.  Many times, with any sort of large library, you may be under the impression that it doesn't do something (thus leading you to believe that you have to write it anyways and believing that it was pointless to use the framework), but it may actually be the case that you simply haven't found the facilities in the library to accomplish your task.

On top of this, the support forums and developers working on the framework are great resources for hashing out design ideas (outside of one's normal circle of peers).

Yes, it's true, Spring requires the use of what can become massive XML configuration file(s).  Yes, it can be difficult for first timers to grasp inversion of control, understand what exactly it is that Spring offers, and in general, find anything in Spring that would significantly make one's life easier as a developer without a learning curve.  Yes, Spring is huge; it encapsulates a lot of "stuff" that can be confusing and seem like bloat one's first time encountering it (I myself only ever use a small subset of the features of Spring).

However, in the end, I think Spring brings so much to the table (too much for me to list here), it's hard to discount it without at least giving it a real evaluation.  For any sort of non-trivial application, Spring allows the designer to add much more flexibility and decrease the complexity of the codebase by encapsulating a lot of the dirty work.  (I would agree that there is a complexity cutoff where if your application sits below this cutoff, it's simply not worth it to include Spring in the discussion, as the time it takes to understand and find its usages in your scenario would not be worth it).

I've been using Spring for almost a year now and I simply can't imagine writing an application without it.  With the latest release, the introduction of the data access library, Spring becomes even more compelling by removing a lot of the boilerplate code that one would write when performing data access.  Admittedly, in a sense, it is a replacement of one set of boilderplate code for another, but it is a much more elegant design than using raw ADO or even Enterprise Library for that matter.  Spring introduces the usage of a delegate/callback pattern for "rendering" the returned data rows and sets into domain objects and sets.

I use the term rendering because this is the same exact pattern that I've been using with regards to the JavaScript that I've been writing for my AJAX enabled applications.  It's an elegant pattern that, in JavaScript, allows for decoupling of the code to retrieve that data from a web service and the code that renders the data.  In a sense, Spring does the same, except, instead of rendering a UI, it renders a domain object (or set) using the delegate, which decouples the data access plumbing from the building of the domain object.

Having used NHibernate previously, I have to say that in many cases, I still prefer performing my own data access code and domain object rendering as it allows me much more flexibility and control.  There is less processing overhead and not to mention (when I last checked) NHibernate still does not natively support generic types.

I've mostly been sticking with Enterprise Library, which is basically just a step above raw ADO, but I'm gonna give this a shot since it's yet another step or two above Enterprise Library.

On another note, it seems like Microsoft's Patterns and Practices Group is finally releasing the next version of Enterprise Library.  In a sense, EL is a "necessary evil".  As far as 2.0 goes, I cannot say that it does anything particularly better than other libraries that fill the same purpose as any given block, but what it does do is it encapsulates multiple functional spaces (logging, data access, exception handling, configuration) into one.  In addition, having the Microsoft Seal of Approval also helps with acceptance.  As an example, the rolling flat file trace listener has had a counter part in log4net since I've been using it (over 1.5 years now).  The data access application block, while it does clean up data access code, is still pretty close to raw ADO.Net usage patterns; in other words, it brings almost nothing to the table (almost; I still endorse it over raw ADO.Net to be sure).

It'll be interesting to see what this Object Policy Application Block actually does.  It seems like it's conceptually similar to Spring's IApplicationContext or Castle's Windsor Container.  I'm not one to latch onto a product simply because it's from Microsoft's P&PG, so I'm hoping they can actually bring something new to the table to make their library more compelling than Spring or Castle (both of which are much more mature by now and encapsulate a far greater set of features).

As for the any concern over the longevity of Spring and Castle, I feel pretty confident that what happened to NDoc, will not be happening to Spring or Castle.

 Wednesday, February 07, 2007

The Allure of the WWW

2/7/2007 10:03:24 AM (Eastern Standard Time, UTC-05:00)

Not everyone can appreciate the simple elegance of the ethereal structure that we know as the Internet.  It is not the average person that will sit and contemplate the transmission of data from one node to another, thousands of miles away in mere milliseconds, and be impressed and appreciative of the amazing times we live in (I mean, just 20 years ago, you had to actually walk into a store to buy porn :-) (*aherm*...not that I know anything about that)).

Most people are just happy that they can log on in the morning and get their mail in Outlook or check the weather on their local news sites, never taking a moment to bask in the glory of the immense amount of data that flows through copper, fiberglass, and the very air that we breath (isn't it weird to think that right at this moment, several megabits of data are probably bouncing off of me (or worse, passing through me (and you!))), each picosecond.

But then again, not everyone is a software engineer. 

Via Gizmodo.

 Friday, February 02, 2007

Most Annoying Error Ever.

2/2/2007 10:06:12 AM (Eastern Standard Time, UTC-05:00)

So I've been working on this Windows Forms app for the past month and recently, it started developing this very odd error that occurs only after a successful build, just as I fire up the window.  Behold:

Super annoying error that makes no sense...

Argh!  What's worse is that it pops up not once, not twice, but three times each time I show the form with that super annoying Windows XP "Critical Stop" sound clip each time.  BUT it only happens if I launch the form from VS! These things...they infuriate me because it's virtually impossible to track down.  Throw me a bone, Microsoft, at least tell me what line it's on (which brings me to another point: NullReferenceException - at least when deployed in debug mode, can't you guys just tell me what reference was null?).

I mean, it would be easy if it said something like "Unable to cast object of type 'X' to type 'Y'" - that would make perfect sense, duh! - but this is just baffling.  It's not like I'm getting complier errors either.  I dunno...I just can't figure out why it would only throw up this modal dialog only when I launch the app (without debugging) from VS.

:: grumble :: grumble ::

 Wednesday, January 31, 2007

My Thoughts on WF

1/31/2007 8:03:25 PM (Eastern Standard Time, UTC-05:00)

As I commented in a post on Paul Andrew's blog regarding what WF is and what it is not:

As I've been working with WF these last few weeks, I've come to form another view of WF and what it means for developers: in a way, it *forces* developers away from some bad design practices since a WF itself has no GUI and no visual user interface. 

To expand on that, it forces developers who would otherwise readily hash their ASP.Net and WinForms GUI code in with the business logic to think in  a manner that separates the core business logic from the visual interface code.

The number of developers that still write monolithic projects that contain the UI and business logic is still all too high.  In studying from simplified working examples in text books, in MSDN documentation, and various articles one finds online, many developers do not gain a good understanding of how to separate the concerns of their code.

The downsides of this approach are immediately apparent after a little exposure to alternative design methods, yet for many developers, they simply don't see the light and continue to write their data access code right into the Click event of a Button.

I see WF as a way of moving developers away from this model by encouraging developers to encapsulate code in a WF program (a unit of business logic) or an activity

I would like to add to that, that in the end, WF is still "just code" (maybe my perspective is skewed after having written my own workflow engine). Don't be fooled by the drag and drop UI, the fancy terms (for example, tracking is nothing more than glorified logging that any learned developer could have easily implemented with log4net, a database appender, and a well defined logging policy), and the hype train in general.  When it comes down to it, for any significantly complex application or architecture, it still requires writing of much of the same code that you had to write before (and in some cases, you may end up writing more code to build a functionally equivalent solution) not to mention that whenever you adopt such a framework, you must learn the little nuiances and how the product architects intended for you to complete a certain task within the guidelines of the framework.

Just to share my take on it :-)

Certainly, it is no "silver bullet", as Brooks would say, but it's definitely a step in the right direction. I am quite curious as to the actual adoption rate that we will see with WF in the coming months as it offers no immediate benefit (until perhaps we see a market for custom activities much like we have today for custom controls for the UI).  To most, it simply won't offer anything compelling and to top it off, it will require additional training to implement a solution using WF.

For me, personally, it's been fun picking it apart and seeing how the minds at Microsoft implemented the same functionality I implemented in my own workflow engine that I wrote for our project at Zorch (while certainly less polished, I like to think I was heading in the same direction...and in some cases, I wish WF offered the same features as I had implemented myself (that was my ego speaking ;-))).

Sandra In The News!

1/31/2007 6:56:24 PM (Eastern Standard Time, UTC-05:00)

How could I have forgotten to post about this?

My wife was recently featured in the Home News and Tribune; not once, but twice!

To begin with, gosh, could they have used worse pictures of her?

But to be honest, it's an extremely proud moment for our entire family (my mom was really going off the walls over this).

My wife is kind of a dynamic person in this respect: you would never guess, just talking to her, that she has a fairly high level grasp of mathematics (not to mention that in person, she looks like she's 18 (especially when she goes with the curly hair)).  I was quite suprised to see some of her coursework in psychology and education which had her in classes similar to mid-high level computer science math courses (probability and statistics).

As a teacher, she's one of those increasingly rare ones that won't take any crap from the students or the parents...she's very straight up to the parents about her expectations of them and how their role in the development of their child (at least while they're in her class) is crucial to the child's success.  She has a whole crazy system in place to make parents and their kids accountable.

So if your school district is intereted in this Singapore math business, do take a look at her SDE profile ;-)

 Thursday, January 25, 2007

Utah - Day 3, 4, 5

1/25/2007 10:26:53 PM (Eastern Standard Time, UTC-05:00)

Programmathon was fairly successful. While I enjoy the freedom of working offsite, it's definitely good to get together once in a while and get face to face with everyone (although my gastrointestinal tract begs to differ).

But of course, no trip with Jim is complete without a trip to Hooters :-P

Zorch @ Hooters

Me @ Hooters

Check David's Spiffy Hat

In the Salt Lake City vicinity, the mountains are omnipresent. It's very beautiful out here (but dry as a desert (I started to bleed under my fingernails due to the dryness)).

Mountains Are Omnipresent.

Of course, we had to visit the Standard Supply company nearby the office where they had a giant toilet (for the obese I assume). Brady labeled this portrait: Stinking Man.

The Stinking Man

Being Monday, everyone had to go watch 24 (except me as I don't really watch TV) so we didn't go out to dinner, which saved my body from yet another caloric bombardment. I was too tired anyways, so I plopped down and went to bed early.

On day 4, we went up to "Snow Bird" to have lunch at a lodge there. It was absolutely beautiful. Some of those runs looked incredible...but yeah, I'm too much of a pansy to ski :-P Basketball for me, thanks.

Up On SnowBird For Lunch

SnowBird

Leaving SnowBird

As beautiful as the scenery is out there and as nice a place as Utah seems to be, I'm glad to be back home in New Jersey. My skin and fingers are doing better in just a day back home (be sure to bring some moisturizer with urea if you go out there) as the air out there is just so incredibly arid. It's also kind of weird being in a social setting where 98% of the population is so homogeneous.

One thing that I've learned on this trip is that mini-vans actually aren't that bad. The Sienna was quite peppy for such a large vehicle and rode very well. It even made it through 3-4 inches of snow without issue.

 Sunday, January 21, 2007

Utah - Day 1, 2

1/21/2007 10:34:56 AM (Eastern Standard Time, UTC-05:00)

It was rough getting out of Newark.  A freak snowstorm delayed the landing of the plane that I was supposed to board and the subsequent snow buildup necessitated de-icing.  I touched down about three and a half hours behind schedule.  To make matters worse, the Hertz counter where my car was reserved was manned by perhaps some of the most incompetent people.  Ever.  There were probably 6 groups in front of me and it took me at least an hour and fifteen minutes just to get my car >:-[ There's something weird about driving a mini-van when you're not expecting it.  While I was supposed to have a Corolla reserved, the only thing they had in the same price class was a Toyota Sienna.  This is actually the first time that I've driven a mini-van...it's kind of weird since I'm used to smaller cars.

We had lunch at Rubio's, a Mexi-Cali place that specialized in fish tacos.  I had a grilled salmon taco, which was delicious (out east, we only have the kinda shitty Baja Fresh).

Dinner was at Joe's Crab Shack, a great seafood place where Jim (our CTO) finally found a satisfactory martini in Utah.  Unfortunately, they also pulled the birthday-boy schtick on me and I had to dance around on a broomstick horse and cowboy hat (I have pictures, but it's just too embarassing)...

DSC00002.jpg

This morning, I woke up to find 3 inches of snow on the ground.  But by that time, I was already dressed and ready to go to the gym.  I wasn't too excited by the prospect of trying to drive in the dark to a gym which I only had rough directions to in 3 inches of snow in a mini-van with California plates...

DSC00012.jpg

But I'm glad I did.  I ended up at the new Lifetime Fitness gym here.  DAAAAAAAAAAYUM.  This is the nicest gym I've ever seen.  It's bigger than the Costco back home.  The indoor pool had two huge, twisty water slides like the ones you find at amusement parks.  The basketball court was full size, well lit, and they actually had good basketballs, too.  And the workout floor: at least 100 weight machines and wall to wall plasma TVs.  It was kind of weird being the only person in such a huge building...I think I would move out here just for this gym :-P

I ended up at the office earlier than anyone else (or so I thought) so I killed some time by writing my name in the snow...

DSC00019.jpg

DSC00018.jpg

So begins day two of Programmathon II...

DSC00013.jpg

It turns out that Jim had already arrived at the office. He saw my snow writing and walked downstairs and let me in :-P

We had lunch on day two at some Chinese place in the food court at a nearby mall. Damn that gave me gas (actually, I think eating out anywhere give's me gas).

DSC00020.jpg

After a long day of programming, we ended up having dinner at Johnny Carrino's. I checked the score on the Colts-Pats game and it looked like the Pats were gonna blow the Colts out.

DSC00021.jpg

As you can see, it was my birthday again. Forced against my will, I finished the free chocolate cake and ice-cream.

DSC00022.jpg

 Friday, January 19, 2007

Well I'll Be Damned...

1/19/2007 1:26:54 PM (Eastern Standard Time, UTC-05:00)

Just a few days ago, I was praising Microsoft hardware and support after calling to get my broken IntelliMouse replaced.

So today when I got back from lunch, to my surprise, I found a huge package sitting on my front steps.

new-keyboard.jpg

Awesome!  They sent a whole new set.  Now I have an extra wireless keyboard.

I'm heading out to Utah in 5 hours, so I'll leave this week on a random note:

quincy-log.jpg

For those of you who have been following along, this is my lizard Quincy, who just a few months ago, was the size of my pinky.

 Wednesday, January 17, 2007

Forgive And Forget

1/17/2007 5:33:04 PM (Eastern Standard Time, UTC-05:00)

I really think that one of the big keys to success and happiness in life is to be able to forgive and forget.  With some people, it just comes naturally and easily; they can move on and mend relationships without regards to whatever transpired.

Of course, for many people, this is an acquired life skill that comes with maturity.  Take my mother, for example.  In her younger days, she was probably too unwilling to compromise and too headstrong.  She held her grudges against my father for the longest time, but as the years have passed, she has come to understand how she erred in not being more flexible.  Nowadays, she's pretty much always happy-go-lucky when you bump into her.  Even when we have disagreements or we have a small fight, she never holds it against me.  It's not just me, she's the same way with everyone she meets.

I'm still working on it.  I am kind of egotisctical and unerring in my presumption that I'm always right :-P (just ask my sister).  On top of that, it takes me a long time to forgive and a longer time still to forget.  I hope that I can correct this over time...life's truly too short to hold grudges.  It's just that for some, like me, it takes a really long time for that to set in.

I started thinking about this after reading an article on Jeff McInnis, who was basically banished from the Nets team for a whole year and whose career was put in limbo - especially so considering his age.  But of course, one of the things that comes with age is maturity:

McInnis has refused to criticize New Jersey coach Lawrence Frank, who was apparently upset with McInnis' work ethic following knee surgery last January.

"If that was the case, I'd hold a grudge against every team I've played for," said McInnis, who has played for eight teams. "I can't think of it like that. They gave me $7 million to better my family. I can't be mad at Jersey. They made a decision last summer not to bring me back, but I'm here now. I want to focus on the Bobcats."

"When I was younger I probably wouldn't understand it, but I'm older, I know what's going on. I don't have anything personal against Jersey."

To be honest, with all the trash and rumors I had heard about McInnis and how the Nets treated him (not the classiest ways of doing business), this is a surprisingly mature response.  I hope that I can develop that same outlook on life and learn to be more optimistic and forgiving.

 Tuesday, January 16, 2007

I <3 Microsoft Hardware

1/16/2007 3:19:40 PM (Eastern Standard Time, UTC-05:00)

I know I'll probably come across like a "fanboi", but I really, really like Microsoft's keyboards and mice.  I'm currently using the Natural Ergo 4000 keyboard and it's awesome (you can read my review of it at Amazon).  It's the most comfortable "mainstream" (as in anyone can pick it up in Staples or Office Max) keyboard out there for extended typing usage.  I haven't had cramps or pain in my pinkies for months (CamelCase will do that to you...)!  Months!  And I'm in front of the computer for a good 8-10 hours a day!

Prior to this, I was rocking a Wireless Desktop Pro keyboard/mouse set (which I also reviewed at Amazon).  While quite comfortable in its own right, cannot compare to my current setup of the aforementioned 4000 and Logitech MX Revolution (along with UberOptions).

But anyways, I replaced the mouse included with the WDP set a few months back as the scroll wheel started to gum up and would not scroll or click anymore (damn cats >.<).  So I finally decided to call Microsoft today and see if I could get a replacement since the receiver and keyboard are both still fine.  Fully ready to pay for the replacement and the shipping cost, to my surprise,

  1. The service rep. that answered my phone call was American and spoke "normal" English,
  2. The service rep. was polite and friendly,
  3. The service rep. hooked it up with a replacement mouse, no questions asked (well, except for the standard ones) with no charge at all to me...no shipping, no replacement fee,
  4. The confirmation was sent to me in under an hour...

Yes indeed.  I <3 Microsoft hardware :-D (and great support to boot).

RSS 2.0 Atom 1.0 CDF