Geeks With Blogs

News

Len Smith's Facebook profile


nIgnuSharp.NET //len smith is a software developer in ann arbor, mi

 

At Lansing GiveCamp I was chosen to lead a team tasked with creating a guest registration system for Ronald McDonald House of Mid-Michigan.  Ronald McDonald House wanted to get off their current system, paper, to streamline their processes and report on their data.  The event started around 7:00PM on Friday and ended with 3:00PM on Sunday.  That’s 44 hours.

At first it seemed too simple and I wondered if Microsoft Access wouldn’t have been sufficient for their needs.  That is until Jay Harris met with the client/charity and hammered out the Business Requirements.  Whew, there were a lot.

photo by Dave GiardFriday night came and we start the project.   First, we defined the domain entities.    We had no time to lose so with the domain defined Jay started creating business entity classes while I talked with Dave Giard and Eric Vogel more about the system architecture.

With the business entities ready and three developers wanting to get started at once, how do we get everyone productive?  There’s no database, no DAL…  This is where Inversion of Control paid out nicely.  I whipped up some fakes to return some hard-coded objects so the team could consume those until the actual database was ready. 

    public class FakeStaffMemberService : IStaffMemberService {

        private List<StaffMember> staffMembers = new List<StaffMember>() {
            new StaffMember() {Id=1, UserName="JSmith", FirstName="John", LastName="Smith",  
                Type=StaffType.Admin},     
        // ...
     
        public IList<StaffMember> GetAll() {return _staffMembers; }
        
        // ...
 

Then I told our IoC Container, StructureMap, to return a FakeStaffMemberService whenever an IStaffMemberService was requested. And yes, with proper Inversion of Control and TDD, it doesn’t matter that the database doesn’t exist in your controllers and middle-tier classes, but we had a lot of views and JavaScript to get written so it was important to hit F5 and see our website.

For the Data Access Layer, I grabbed Fluent NHibernate and fumbled getting automapping to do what I wanted.  It was one of those situations where I couldn’t tell if I was five minutes or five hours away from getting the thing to work... so I tossed it and went with normal Fluent NHibernate mappings.  It was somewhat tedious but a predictable and manageable task.  With a greenfield database, Fluent NHibernate is perfect.  Were we dealt existing schema, I would’ve feared a situation arising I couldn’t map with Fluent, but this wasn’t an issue here.   Fluent NHibernate makes the mappings strongly typed and trivial/beautiful while providing helpers for testing your mappings.  Along with that, I created a “test”, set to run explicitly, to create the schema and populate the database.  This let us never need to open SQL Server or even think about its existence.   In order to persist a new property, we simply had to add it to the mapping and add a line in our integration test for verification.  This led to a less than ideal schema but functioning software was our concern.  Later, when the dust settled and product was delivered, Eric and I wrote a script to optimize the schema.

n1053319431_408708_8085625[1] This infrastructure allowed us to just rip through code all day Saturday… which was good because we were hindered by multiple power outages, a restocking trip required by myself to replace clothes and toiletries stolen from my car the night before and some fumbling trying to figure out an ASP.NET MVC binder solution.

With an hour and a half to go to our demo, I realized I had well over two hours of work to do.  The main feature of our application, recording a patient’s support people and their stays was not going to be complete.  I still had to code the binder and the JavaScript to handle multiple support people.   I was sure trying to explain what I needed to someone would be insufficient for them to comprehend and return what I wanted.  I started plowing through it, hoping maybe I could come in under the wire when I saw an out.  I knew what the Act and Assert was in my Unit Test.  I wrote them, checked it in and asked Dennis Burton for an hour of his time to fill out the Arrange part of the test along with the implementation.  There were three failing tests and I needed them all to be green. He downloaded the project and because of our use of Inversion of Control he did not need to set up the database or know anything about the rest of the domain.  An hour later he checked in the code and because all of the tests passed I didn’t even care about looking at his implementation.  Dropping it into the project was the missing piece and we were done with about fifteen minutes to spare.

In this part I talked about what went right.   In Part 2 I’ll talk about what didn’t.

(First photo by David Giard)

Posted on Sunday, May 24, 2009 8:33 AM | Back to top


Comments on this post: Creating software in two days: GiveCamp Retrospective Part 1

# re: Creating software in two days: GiveCamp Retrospective Part 1
Requesting Gravatar...
I wish to express words of gratitude towards Skydex Soft Ltd! You are
truly the best!. I would like to thank you for your work and that you
finished my project on time. For all who has not decided yet I
strongly suggest you to use this compeny as I did, and you won't
regret!. All the things are done ontime and at a very professional
level and you will definitely receive what you expect. I am simply
happy that I chose this company. You could find more information about
the company on their websidetheir site www.skydexsoft.com - what
services they provide, and the history of the company as well.


Sincerily yours Janet
Left by Janet Berolzheimer on Aug 13, 2009 11:16 AM

# re: Creating software in two days: GiveCamp Retrospective Part 1
Requesting Gravatar...
Quite inspiring,

I like to know more how you predict the project duration and the cost ,becouse for us, this is a hardest task to do, do you have any special method for managing the project, that you like to share with others

Left by web development company on Aug 19, 2009 11:32 AM

Your comment:
 (will show your gravatar)


Copyright © Len Smith | Powered by: GeeksWithBlogs.net