in

 

Sean Chambers

I am a Lead Developer from Palm Coast Florida. If I could describe my skillset I would include TDD, DDD, Alt.net, NHibernate, Castle Project and so on

October 2007 - Posts

  • Boston is in the series!!!

    The red sox have just won game 7 of the american league pennant. The final was 11-2.

    Sorry to post non development related stuff but Boston is my team!!!!!!

    The world series begins on wednesday I believe. It's gonna be a good match!

    Posted Oct 21 2007, 10:57 PM by schambers with 8 comment(s)
    Filed under:
  • Yet another Microsoft MVC/MonoRail blog post

    I am not going to quote any other blogs posts that I have read in the past two weeks about these topics, If you do a System.Web.MVC search or were at ALT.Net then I'm sure you've already read enough about it.

    This is definately some cool stuff. I almost came to tears when I saw Jason post that everything is interface based. It's also a good feeling to finally see that Microsoft is listening to the community and is making steps to make a difference and not get left behind.

    That being said, I find only one problem at the moment with MS MVC...It's not open source. This opens up a myriad of problems and road blocks that are not in the way when working with MonoRail or other open source projects.

    I did a post a long time ago about why I loved MonoRail so much. Basically, a thread was started on the mailing list where I believe Colin Ramsay asked a question about Controller tests or something. After only 24 hours there was new code on the trunk, everyone was pleased and we were set to go. Try that out on the new MVC architecture. Good luck.

    The problem is, once you reach a certain skill level and profecient enough, you can pull down development trunks, modify code to suit your needs and recompile. You can contribute to open source projects to help the community. This is not so with Microsoft tools because they are not open source. This is a big problem if you ask me. Especially how fast the skilled community is moving now. Microsoft needs to create some common ground so they don't get left behind yet again when no changes are applied to MS MVC for 6 months or more. (I really hope this is not the case. If anyone knows otherwise please prove me wrong!)

    Now, I know I read somewhere (and I can't find the post now), that this will be placed on codeplex for all to download. Here are some immediate questions that I would like to pose to MS:

    • Does this also mean that people can browse the source and submit patches?
    • Once bugs are found or additions need to be made how long will the turn around be?
    • Will Microsoft actually listen to the community as where System.Web.MVC needs to head development wise if the community cannot submit patches?

    Maybe I am just looking for the negative but I really feel these are points that will determine if I personally use this Microsoft tool. I love MonoRail and will continue to use it by default for all projects, but in projects where the client doesn't want to use open source tools, then I will of course opt for this.

    I should not even be posting about this topic at all. I put it off for two weeks to try to avoid it but I feel like I need to chime in as well. I have banged my head against the wall for so long when using Microsoft tools that I avoid their tools at any cost. I am hoping that this is finally the exception because I am willing to give them another chance. Microsoft tools is a gripe for me. I struggled with them for so long that I don't even bother anymore.

    I am willing to give this tool a shot though. This could be worth the effort. We will have to wait and see!

  • Avoiding Development Disasters @ WTF

    At the moment we are between feedings for Aidan and all is quiet at the moment. I am trying to catch up on my rss feeds and came across a really good post on Worse Than Failure title "Avoiding Development Disasters"

    I don't really have the mental capacity at the moment to write a good response on my thoughts but everyone should go take a gander.

    I have noticed that when you only sleep 2-3 hours, it is probably worse than getting no sleep. I have a new found respect for all parents all over the world.

  • The world welcomes Aidan!

    Yesterday October 10th 2007, Aidan Chambers was born into the world!!!

    Time : 3:14 pm 
    Weight: 8lbs. 12oz.
    Length: 21 3/4 in.

    Full head of black hair! A big baby all around. Mother and baby are doing fine. Dad is a little sleepy himself =)

    Here's a photo of mom with Aidan

    I will post more photos later.

    I'll be around in the coming days

    Posted Oct 11 2007, 11:51 AM by schambers with 4 comment(s)
    Filed under:
  • Staying on top of Test Coverage

    It's always a good idea to make sure you stay on top of test coverage. As the image to the left clearly displays, it will quickly get out of hand and before you know it your coverage is in the toilet =)

    I am usually pretty good about staying on top of my test coverage. In this instance there was a very strict timeline and the launch date could not be moved. Thus, some tests got skipped. Not alot, but as you can see the whole Services namespace has no coverage at all. BAD! BAD! BAD!  Especially since the Services.Authentication namespace manages authentication of clients logging into this peticular application.

    It's very easy to say to yourself, "I'll write a test for this method later" and then forget about it. This is probably one of my most poorly covered code bases, besides legacy apps. All of my other tdd projects have at the very minimum a 80% coverage, alot of them have 90% coverage. The classes that have no possible way of being tested (HttpPostedFileAdapter as an example), I place in their own namespace and exclude them from NCoverExplorer's coverage output. This way I am not including code that I have no way of testing. The screenshot to the left is code that should have 90% coverage but doesn't.

    On another note, it is a HUGE undertaking to bring a poorly covered project back up to proper coverage after the fact.Another reason why it should be done from the start. Originally this code base started out at 45% test coverage =(  It took me a week just to bring it up 12%!!! Granted, I spent a day fixing some nant stuff in there and also doing alot of refactoring that wasn't done before.

    Lacking on test coverage will only make it hurt worse later down the line. We all know how important it is to deliver a product on time, but is a product deadline excuse enough to let test coverage slip? By doing that you are only decreasing maintaintability, scalability and money later down the line. Probably even more so then originally because now you are retrofitting legacy code with tests. That's right, as soon as you deliver that product, the pain of writing tests becomes much worse. Why not do it correctly the first time?

    If I could go back in time to when this project first started, I would probably have suggested that we pushed the launch date back at least 2 months.

     Bottom line is, stay on top of your test coverage. If not you'll regret it like me =)

    Posted Oct 09 2007, 01:15 PM by schambers with no comments
    Filed under:
  • Wednesday is the Day

    The time has finally come. After 9 long months of waiting and a miserable fiancee, our son Aidan will be delivered this week on Wednesday (hopefully)

    We are heading down to the hospital on Tuesday evening so that our Doctor can induce her labor on Wednesday morning. Hopefully she will have an easy child birth and not too much pain. This is our first child so we're not really sure what to expect. I am very excited. My fiancee keeps joking that he's going to pop out holding a keyboard and banging away churning out code =)  if I could only be so lucky..heheh

    After Wednesday I have the next week and half off to help out with the newborn and help my fiancee relax. It's a very exciting time. The whole pregnancy I think she was always more excited than me but I can hardly sleep at night now =)

    Anyways, I will be posting photos after we leave the hospital...unless they can hook it up with some wifi =)

    Wish me luck!

  • DesignByContract with Fluent Interfaces

    I was reading through some blog posts and through a recent post, stumbled across this one from Bill McCafferty and took a look at the DesignByContract CodeProject article. This is just a simple utility class to pass in assertions and get an exception to be thrown with a message if the contract has been violated. I did this manually in my last project using repetitive code that got to be a pain. On a new project I definately wanted to use a utility to perform these checks for me. The DesignByContract sample would seem to fit the solution. It is working fine thus far, but I didn't like how the method calls looked and thought it would be a prime candidate for some fluent interfaces.

    Here is my shabby attempt at a DesignByContract class to perform checks with fluent interfaces. Now instead of this:

    Check.Require(!string.IsNullOrEmpty(username), "username is required");

    we can have this:

    // with strings
    Check.Parameter(username).WithMessage("username is required").IsNotNullOrEmpty();

    // with objects
    Check.Parameter(someObject).WithMessage("some object is required").IsNotNull();

    A little longer to type, but with ReSharper who really types out whole method names anymore =) Theres probably a better way to do it with generics but for the time being I just needed to make sure that parameters were not null. So all this class does is check for null/not null. In the near future I will add assertion checks in there as well. I haven't had a need for that yet and why write unnecessary code!

    You can get the DesignByContract.cs and tests from my Google Source code repository here:

    http://schambers.googlecode.com/svn/trunk/FluentDBC/

    If anyone has any additions please send me a patch and I will be happy to add it!

  • Testing MonoRail Filters

    I was trying to test an Authentication Filter today that needed to redirect the user to a login page.

    The problem was that it used context.Controller.Url, context was a MockRailsEngineContext and the Url property throws a NotImplementedException. Ayende quickly jumped on the ball and resolved the problem! Dang that was fast.

    If you need to do the same just grab the trunk and it now that property will return a value rather than an exception.

     Thanks Ayende!

Copyright Los Techies 2007. All rights reserved.
Powered by Community Server (Commercial Edition), by Telligent Systems