Dev Log - Week 03 Day 02

Development time was short today due to a migraine.  Missing a few hours (say, six) really reduces the amount of work you can get done.  That being said, I sat in front of the TV with my laptop in the evening and tried to catch up.

After yesterdays near disaster, I decided to switch into XHTML mode and work on user controls.  I created a few user controls in my prototype, and I was planning on translating them into production code.  The particular component I’m working on is a modified DataGrid.  It contains one or two extra search boxes and some custom pagers.  Now, when I say custom pagers, I don’t mean the Custom Pagers that the DataGrid natively supports.  These are full-on DataGrid-unaware pagers that I’ve written ground up.  Some background is in order.

Most of the projects our company works on are business intelligence applications; we grab tons of data from the database, run some reports and calculations on it, and present it in an executive dashboard.  The DataGrid pagers don’t actually paginate the data itself; just the display of the data.  We page our data because NOT paging it would cause a few thousand extra rows of database traffic.  Our users tend to prefer short load times to long ones.

The pager I’m writing contains the standard data-pagination buttons: First, Previous, Next, Last, and a number-of-items drop down list.  We plan to place these buttons on the top and bottom of every DataGrid contained in our application.  This paging bar is going to be used multiple times in the application.  The object-oriented designer in me is currently screaming that I package this tiny piece of functionality up into a nice reusable component.  Since it’s graphical, a user component (or custom component, for that matter) would be ideal.

However, making it object oriented would add complexity.  The events for the links contained within the pager would have to be subscribed too externally. I’d also have to deal with all of the visibility and possible rendering problems caused by the AJAX controls I’m using.  And, frankly, I don’t care for the idea of nesting user controls.  My gut feeling is that Visual Studio would throw a fit during compilation; I’ve experienced this before, and have lost days of dev time to it.

It’s a sticky design situation.  So I decided to program around in for about an hour, tidying up other code, creating the helper classes, and so forth.  Right before I had to make the decision, I got up off the couch and walked to my friend’s room.  My friend is also a programmer, a recent computer science graduate.  He works for a different company on the third floor of the building I work in.  Without any context, I posed him a question: Quick! Proper design or getting it done?  He turned away from WoW, glanced around nervously, drank some Coke he had sitting on his desk, and, very slowly, replied getting it done.  You have to love making software design choices on exchanges like that.

Getting it done was what happened.  I started copying and pasting code (screw design error!) and finished up the first component pretty quickly.  I can’t estimate how long it would have taken to make it reusable, but c/p was a couple of minutes per occurrence.  For me, in this situation, reusable design would have cost more.  What’s even nicer is that Visual Studio changed the IDs of the ASP components for me when I copy and pasted, so there would be any ID conflicts.  It’s as if Microsoft anticipated my shoddy programming technique.

Now lets see what happens when I have this particular pager code copy and pasted into ten or twelve different places on the project and the customer requests an All button.

Print | posted on Thursday, May 24, 2007 12:58 AM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 5 and 1 and type the answer here: