CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Grant Killian's Blog

No, this has nothing to do with beer -- but maybe it should?

April 2004 - Posts

  • Off to Devscovery

    I'm off to the DC Devscovery conference tonight along with Darrell and many other WeProgram.Netters.  It should be a good time (assuming we arrive alive since Brian “Andretti” Lamprecht is driving!) -- all .Net from 9 am - 4:30 PM Tues-Thurs, and they even include lunch for the attendees.  Hopefully, it's not just movie theatre hot pretzels and popcorn; this conference is following the trend of holding events at movie theatres instead of the much pricier convention centers.  I'm sure I'll like the high-backed seats better than the folding chairs I've seen at some events!

  • Finished Coding Slave

    It's a very thought provoking read and I'm curious to see what others think (I know Brendan picked up a copy).  Here is one of my favorite quotes from the book:

    Training is of limited benefit when it comes to solving the really big problems in software engineering.“ 

    Training, of course, plays an important role but only communicates syntax, lexical structure of a language, and how to solve specific problems; the “big problems“ aren't addressed through training but are more a matter of thinking.

    We're planning a Coding Slave BOF for Sunday night at TechEd; I think Rory is the point man on this (based on a tangle of emails and blog comments, this link is the main one).  If you want details, just let me know and I'll see about disseminating them once they're finalized!

    Happy .Netting!

  • ASMX=confident; Remoting=lessConfident;

    Don Box confirms that we should go forth with confidence and use Web Services and ASMX; Whidbey, Indigo, and the future frameworks build on this infrastructure -- they don't discard it

    I'm not so sure about Remoting, however.  Various sources indicate that Remoting, as we know it, will be different with Indigo and Longhorn and require “non-trivial“ programming changes.  Any talk like that is enough to scare new adopters from a technology . . . is there anything definitive yet?

    Happy .Netting!

  • Could you just drop what you're doing and go to Devscovery?

    [UPDATE: Julie from Keane (formerly Metro . . . those were the days!) has won the conference pass and we'll see her in DC next week!  To the various respondants, we wanted to keep the free pass within the WeProgram.Net membership.  If nobody claimed it “in-house,“ then we would have gladly passed it on to you.]

    Something developed last minute and we just sent an email offering a free Devscovery conference pass to the WeProgram.Net folks, courtesy of Wintellect, and I'm curious to see what sort of response it garners.  The catch is that the conference starts next Tuesday and is in Washington DC; it requires the pass winner to be able to drop any plans for next week and head 3 hours north to the conference for Tuesday - Thursday. 

    The agenda is packed with interesting .Net topics and I know many people who would love to go, but have time commitments to customers that prevent them from using the free pass.  That's a tough spot to be in . . . free conference passes don't come around all that often and it's hard to say “no thanks.“

    That being said, there's already been 2 respondents who want their names in the hat. If you've been to a WeProgram.Net meeting and want in on the action, just respond to this post asap.

    In reviewing the session agenda, I'm thinking it will be hard to pass up anything John Robbins presents after his dynamite talk a few weeks back.  I'm also interested in the performance and threading sessions, and security . . . speaking of which, Brian “Andretti“ Lamprecht has some security demos he's been meaning to get me.

    For those of you not in the mid-atlantic region, Devscovery is hitting Austin, Atlanta, and Redmond later this year.

    Happy .Netting!

  • Extending ASP:Calendar with Poor-Man's DataBinding

    It all started when the customer had a simple requirement for a calendar in their application; no problem: asp:calendar control gets called in for duty!  Then came the 3 words every developer hates to hear when meeting with a customer: “It's nice, but . . .”.  The “It's nice, but . . .“ statement can launch applications into the world of scope creep and project death march, so I am always cautious when I hear customers begin with the dreaded 3.

    This time, however, was harmless: the customer just wanted a title to display along with the day in the calendar control.  It's not as easy as it sounds and I began to wonder if I was <movieReference name=“Zoolander“>taking crazy pills</movieReference>!

    A few friends of mine had complained about trouble with “Databinding a web calendar control” and rolled their own variation on the DataList -- yuck!  I also did a search on databinding a .Net Calendar control and discovered this link: www.c-sharpcorner.com/Code/2003/July/ASPNetCalendarControl.asp; while helpful, it didn't get close to my specific needs, but I did adapt the UI for my solution from this article by Sushila D. Patel.  It began to look like creating my own control deriving from the WebControls.Calendar class was the way to go with this! 

    So here is the code from the “Control Library“, the key is the call to getLabel that returns a string to include beneath the number in each calendar day.  getLabel accesses a DataTable instance variable that we set in any client for the control:

     public class optCalendar : System.Web.UI.WebControls.Calendar
     {
      //Provide custom implementation of the OnDayRender method
      protected override void OnDayRender ( System.Web.UI.WebControls.TableCell cell ,
       System.Web.UI.WebControls.CalendarDay day )
      {
       string strLabel = getLabel( day.Date.ToShortDateString() );//key invocation
       if( !strLabel.Equals( "" ) )
       {
        Label lbl = new Label();
        lbl.Text = "<BR>" + strLabel;
        cell.Controls.Add( lbl );    
       }
       base.OnDayRender( cell, day ); //let the base class do the hard work!
      }

      private DataTable _dt; //just the setters and getters for the public DataTable property 
      public DataTable DayLabelTable
      {
       get{ return _dt; }
       set{ _dt = value; }
      }

      protected string getLabel( string strDate )
      {
       foreach( DataRow dr in _dt.Rows )
       {
        if( DateTime.Parse( dr[ "EventDate" ].ToString() ).ToShortDateString().Equals( strDate ) )
        {
         return dr[ "EventName" ].ToString();
        }
       }
       return "";
      }
     }

    The code from the UI that invokes the control library includes this in the HTML, if this is foreign to you, you may want to check out the Intro to Web Custom Controls on MSDN.

    <%@ Register TagPrefix="opt" Namespace="optControlLibrary" Assembly="optControlLibrary" %>

    <opt:optCalendar id="optCal" OnDayRender="CalendarRender" runat="server"></opt:optCalendar>

    And this in the page_load event, it wires up our DataTable to “bind“ our calendar to:

    optCal.DayLabelTable = ds.Tables[ 0 ]; //could be more ingenious here, but for the time being this will suffice

    Now, this CalendarRender method assumes a datatable containing a table with “EventDate” and “EventName” are columns in the table ds.Tables[ 0 ]; I will probably refactor this so my control has only 2 strongly typed columns avoid hard coded column names that must match. 

    Here is a screen shot of the calendar, with the titles rendering as Labels under the date:

     Demo Calendar

    There's no rocket science to this, but it does seem harder than it should be . . . and I'm suspicious that I've missed something obvious in the DataBinding of a calendar control.  In a sense, this is a custom databinding implementation.  Maybe I'll rework this into a more DataBinding conformant model.  This control will eventually be cleaned up and make it into our release-version control library at work, so I may post the improvements once I get around to them.

    Happy .Netting!

  • Attn: Coding Slaves

    I just finished listening to the latest Franklins.Net DotNetRocks episode with “Coding Slave” author Bob Reselman; Bob really impressed me (when he could get a word in between the two hosts -- Carl Franklin and Rory Blyth) and Bob's perspective on outsourcing, humans and software, and other topics is really refreshing to hear.  I'm going to get his book and check out his site www.CodingSlave.com.  From what I've heard, guys like Brendan Tompkins should definitely check out the book (Brendan had a blog frenzy on outsourcing a few weeks back) . . . for that matter, any developer with a little experience and a little introspection may get a lot out of the “Coding Slave“ book.

    For the record, I really like DotNetRocks and appreciate the void they fill on my longer drives to work . . . on the other hand, I'm surprised at times when host (and developer) Carl Franklin doesn't know things like what Model-View-Controller is.  I cringe since he often claims to represent the VB community at large. 

    I can't rag on the DotNetRocks guys much, though, because there's lots of stuff I don't know and, as Mark Bonafe has said: “No One Knows All“, but I figured an accomplished teacher and developer such as Carl Franklin would have learned something like MVC a long time ago!

    Happy .Netting

  • 70-340 Webcast Prep Material

    Although I usually avoid just linking to another person's posting, I'm making an exception here.  Anil John's weblog provides a link to the Microsoft security related webcasts.  These may be useful while preparing for the Microsoft Beta 70-340 .Net Security exam like Darrell signed up for; I'm taking the Beta exam too.

    Nice of INETA to allow us .Net user groupers to be guinea pigs on the test!

    Happy .Netting

     

     

  • FreeTextBox Control Kudos (Finally)

    I've never given my props to John Dyer for the FreeTextBox control he created and is giving away; if you want the source code for the 2.0 version, it's very cheap ($50).  I've not tried the latest 2.0 release; we're still very happy with the previous version -- we've used it in a few cases where we knew customers would be working with Internet Explorer and it's saved us a lot of time. 

    The online documentation has really improved since I started messing around with the control; check out this documentation page for a taste of how complete a package John has put together!  I may have to dive into the 2.0 version and see exactly what “External JavaScript“ and “Completely recoded as a development platform“ features look like.  Also, the latest version advertises wider browser compatibility.

    Happy .Netting!

  • The Dharma of Development

    Whew, my head is spinning from the WeProgram.Net presentation by Wintellect co-founder John Robbins.  He didn't dazzle us with secret code snippets or tools that reveal the keys to .Net.  Instead, John Robbins spoke passionately about what it takes to produce quality software that's on time and on schedule.  I've heard others speak on similar topics, beating various methodology drums, but none had the gusto that Robbins demonstrated.  His anecdotes (based on broad ranging experience ) and no-holds-barred approach were exceptional and Darrell and I both wished wish we would have taped the talk because there was that much good stuff in it.

    Just a few memorable quotes include:

    • “Customers don't buy ISO-9000 docs, they buy quality software completed on time“ 
    • “Everyone has to stand at my status meetings -- they're only going to last 15 minutes at the most!”
    • ”I put the CS Majors at the bottom of the stack when I'm looking over resumes”
    • "If you're not in the business of producing bug-tracking software, why are you rolling your own solution and wasting your time?  Use a quality product (Bugzilla is even free) and stay customer focused."

    It would take too long to explain all the above, so I'll let you wrestle with them.  He went on to share some of the guiding principles of Wintellect development and impressed the heck out of me with his vehemence.  I can see why he co-founded Wintellect!  Very impressive. 

    After reflecting on it a bit further, he was getting into processes and steps to support developers in their pursuit of building better software.  That's also what this whole .Net stuff is about -- increasing programmer productivity and producing higher quality software.  Not to get too academic on you, but I did study a lot of Eastern religion in undergrad and faiths like Hinduism and Buddhism have this notion of profound and divine truth known as dharma.  John Robbins was sharing the Dharma of Development -- whether it's winforms, web services, and no matter your language (even the non-.Net ones!), we all share in the development process at our organizations and owe it to ourselves and our customers to produce high quality product! 

    We'll be posting the powerpoint presentation from John's talk next week at www.WeProgram.Net -- but the powerpoint is only a fraction of the dharma.  I know John Robbins will be talking at the series of Devscovery conferences coming up, so check out what he has to share.  If he's always as thought provoking as he was at our user group, you'll not want to miss it!

    Happy .Netting!

  • When it all comes together

    Aren't those days great when everything works together and all your hard work pays off? 

    We got a rush customer requirement earlier this week and took it from analysis (a little visio and a lot of consideration), to SQL Server (where we created the tables, to CodeSmith (generated the objects from the data model), and then snapped the objects together with a little business logic and a few screens; now we're testing an alpha version of it all.  CodeSmith is particularly handy here because our framework at OptimizeIT performs the CRUD operations on our objects so long as certain interfaces are adhered to -- CodeSmith creates our implementation of the interfaces from the data model.  I've already sufficiently gushed about CodeSmith in an early post, so I'll drop the topic.

    It's great to see things come together like this.  We're doing initial testing on the enhancement and can probably deploy something next week.

    Microsoft ObjectSpaces (part of the .Net 2005 plan) addresses the same issues our framework does at OptimizeIT.  From what I've read, ObjectSpaces will take entity frameworks to another level.  I'm curious to see how Microsoft packages ObjectSpaces -- is it treated like the Application Blocks (supported, open-source code that supplements the .Net framework and makes life easier), or is it bundled into the .Net framework itself in a System.Data.ObjectSpaces namespace?  There's also lots of room betwen these two extremes, but let me point out that the .Net framework already contains 1,000s of classes and is intimidating to the new developer . . . framework complexity and bloat must certainly be a concern for Microsoft.  Can my GAC handle it all?

    Happy .Netting

  • Refactoring Resource and User Group Content

    Martin Fowler of Refactoring fame (and I follow his blog -- although he calls it a “bliki“ as a cross between a blog and a wiki) maintains a site devoted to Refactoring at www.Refactoring.com (clever name, huh?).  The catalog section describes the refactoring “recipes“ he details in his book -- I highly recommend his book on the topic, as it builds a shared vocabulary for describing these formulas for improving our code.  The catalog descriptions are terse but convey their points well . . . maybe WeProgram.Net could do a Refactoring-of-the-Week sort of segment on our site.  Any volunteers? 

    As an aside, one thing I'd like WeProgram.Net to do more of is provide site visitors with a reason to come back other than to check our event schedules.  We've got the latest blog posts from our members via RSS, which is a nice window to these blogs, and our presentation materials are good, but we could do much more.

    In March, Steve Metsker (no blog that I know of) and Darrell Norton presented to WeProgram.Net on the topic of Refactoring. It was an excellent session and I highly recommend groups use hands-on exercises to complement presentations . . . our user group strives to “stick to the code” and avoid the high level generalizations that can water down topics.  In a large group, the hands-on part might get disorganized but if there's any way to make it happen do it because there's no better way to learn something than to apply it!

    <plug shameless=“false“>Since I'm on the topic of User Groups, WeProgram.Net is hosting Wintellect's co-founder John Robbins tonight at 6:30 at ESI in Newport News.  His latest book, which I think we'll be giving away tonight, is very popular.</plug> 

    This a rambling sort of post.  Maybe I should refactor it into 2 seperate blog posts using the ExtractClass method?

  • SEO, .Net, and URL Rewriting

    Although preliminary findings by Scott Mitchell indicate blog posts on Fridays aren't paid much attention, I'm going forward with a Friday afternoon blog entry.  What the heck, the office is practically empty and I'm all caught up for once.

    Something that has been coming up more and more is SEO, or Search Engine Optimization.  It's a big deal for our ecommerce customers who want to be high in the Google and Yahoo search results.  While I don't get involved in the SEO details very often, there are ways that software development (which is my main job) overlaps with SEO.  One of these main overlaps is with URL Rewriting -- where you map a search engine unfriendly name like “http://www.Domain.Com/products/prodDetailView.aspx?pid=3432&catid=3434355” to something more meaningful to the search engine spiders like “http://www.Domain.Com/TabletPC-Computers.aspx”.

    I don't know the ins-and-outs of google's algorithm (although in a few conversations with these guys they claim to), but the full substance of an HTML page can be considered by the search engines. This means the first url with the nasty querystring is meaningless and can't contribute to a page's search ranking, while the 2nd url is more substantial and may add to the page's rank for TabletPCs and Computers.

    Before .Net this was a tricky ISAPI issue for Windows servers; now, via the HttpContext.Current.RewritePath() method, we can Rewrite URLs relatively easily.

    This CSharpFriends article has a quick snippet that illustrates the basics; 15Seconds has a much more in depth treatment.  We've got our own “engine“ and the boss man would frown on me posting it (although it's not rocket science!).  You intercept the request for the friendly URL in the Application_BeginRequest event handler and rewrite it as the one your system recognizes:

       HttpContext myContext =  HttpContext.Current;
       myContext.RewritePath("HttpContext_Next.aspx");

    To understand the SEO side a bit more, check out Page 1 or Page 2 of this article from the SEOConsultants. 

    In the future I may discuss some of the other ways software development supports a site's SEO efforts; after all, who cares if the site is well programmed if nobody can ever get to it?

    Happy .Netting!

  • HTML is not a programming language

    There's nothing that sours me on a job candidate more than finding something like “Advanced HTML Programming” listed under a “Programming Skills” heading.  It's right up there with the “MS FrontPage Expert” skillset.  I understand that having an AOL email address can flag you as potentially un-technical, but to me, the “Advanced HTML Programmer“ and the “MS FrontPage Expert“ are much more indicative of the candidate's quality.

    I don't want to sound arrogant, although I'm certainly coming across that way, but by including these sorts of things in a resume you're implicitly communicating that you don't have a good understanding of web software development. 

    If you're applying for a mid-level software developer position, don't set a reference to the Amateur Namespace!

    Happy .Netting!

More Posts