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

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

July 2008 - Posts

  • The great thing about me is that there's so many of me

    Geek points for identifying the movie quote from the title. 

     

    Okay, I'm going to get this completely out of my system in one go and not do it anymore.  I used to roll my eyes at people that only use their blog for "look at me, I'm speaking at such and such on this date and I just published this or that," but it appears that I'm one of those people now.  I swear, I'm writing up original blog posts with real content after this one -- and finishing some useful StructureMap documentation.

    First, my latest article for MSDN Magazine is up today on Object Role Stereotypes.  I was excited to write this article because I'm a huge fan of Rebecca Wirfs-Brock and her work on Responsibility Driven Design.  UML might be great at helping you visualize an existing or proposed design, but Responsibility Driven Design can help you figure out what the design should be and understand existing designs.  I've always thought RDD was undervalued in the clamor for fancy visual modeling tools.  I'm going to follow up pretty shortly with some material that got cut from this article for length.  I got quite a bit of inspiration for my recent StructureMap rearchitecture work from the research I did for this article.  I'd like to share that as well for more examples.

    I'm going to be speaking this November at QCon San Francisco on my lessons learned about design, TDD, and framework usability from 5+ years of evolving the StructureMap code.  It's a tremendous lineup of speakers for the conference and I'm just thrilled to be there.  I'm especially looking forward to the tracks on DSL's, the "Architectures you've always wondered about," and the track on Functional Programming.  Not to mention just being in San Francisco itself.

    A short article I wrote earlier this year for CoDe Magazine entitled Using Continuous Integration to Reduce Project Friction is up on DevX.  If you need some help convincing your team or management to adopt Continuous Integration, this might give you some ammunition.


    And finally, I've got a few last things to work out, but I'm finally going to start my "Presentation Patterns" book for Addison Wesley.  I'm effectively redoing the content from "Build Your Own CAB" plus the material I never got around to and making that a real book.  As of now, the proposed Table of Contents is:

     

     

    1. What’s so hard about building a User Interface?
      1. Look at everything that’s going on here
      2. How do I test this?
      3. How do I connect all this together?
    2. Separated Presentation
      1. The travails of using Active View
      2. The Humble Dialog Box (narrative)
      3. Separated Presentation (narrative)
      4. GUI Architectures (pattern)
      5. Passive View  (pattern)
      6. Supervising Controller (pattern)
      7. Presentation Model (Model-View-ViewModel) (pattern)
      8. Communication between the View and Presenter (narrative)

                                              i.    By events

                                            ii.    Direct communication

      1. What’s the Model? (long narrative)
      2. Model Based Validation with the Notification Pattern
    1. The Mechanics of the View
      1. Managing Screen State (narrative)
      2. Flow Synchronization (pattern)
      3. Observer Synchronization (pattern)
      4. Flattener (pattern)
      5. MicroControllers (pattern)
      6. Embedded Controller (pattern)
      7. Screen State (pattern)
    2. Complex Screens
      1. Composite Controller (pattern)
      2. Layout (pattern)
      3. Messaging
    3. The Application Shell
      1. Coordination between Screens (narrative)
      2. Screen Activation Lifecycle (narrative)
      3. Presenter First
      4. Application Shell
      5. Application Controller
      6. Screen Collection
      7. Screen Subject
      8. Layer SuperType
    4. Event Coordination
      1. Coordination between Screens
      2. Latch (pattern)
      3. Event Aggregator (pattern)
      4. Command (pattern)
    5. Crafting a Domain Specific Language (not well defined yet)
    6. Modularity
      1. Using an Inversion of Control Tool
      2. Bootstrapper (pattern)
      3. Registry (pattern)
    7. Communicating with the Server
      1. MORE DEFINITION HERE
      2. Command Executor (pattern)
    8. Automated Testing
      1. Unit testing the Presenter layer
      2. Unit testing the View
      3. Subcutaneous Testing
      4. Strategies for User Interface Testing
      5. Screen Driver (pattern)

    From the early feedback, it looks like I'll move the testing material up and I think I'm going to include some discussion of "Mobile Objects" ala CSLA vs DTO's / Bounded Context / Separate Domain Model for client & server.  I'd also like to talk about using an ESB like nServiceBus or Mass Transit for client to server communication.   The examples will primarily be WPF, but I'll include some WinForms, Java Swing, and probably Flex.  I thought hard about using Cocoa examples, but for all of its cool features, I cannot read Objective C code.  The focus is on patterns and design rather than specific technologies.

     

     

    Okay, I'm done with the self promotion now.  I promise.

  • My friend Weston is looking for some good Agile .Net developers in Austin

    My friend Weston Binford is looking for some good .Net developers in Austin.  Austin.  Agile.  Place where they actually care about doing things well.  Maybe go to JP's "I will make you awesome in one absurdly action-packed week" class.  What's not to like?

     

    From the job posting:

     

    I manage a software development team creating internal business applications. Two years ago, I took over the team and we switched our project management from Waterfall to Scrum with four week sprints. We have created a WebForms application tied to a database using an object/relational mapper. The application still has "legacy" C# code and some modules written in stored procedures before we embraced domain-driven design. We have used Model-View-Presenter to ease unit testing, but we are acutely aware of the pain of WebForms development and are looking to move to Model-View-Controller using ASP.NET MVC or, perhaps, Monorail.

    We have embraced collective code ownership, continuous integration, unit testing, code coverage, domain-driven design, and sustainable pace. Creating maintainable software is our primary goal. We are committed to continuous learning and are empowered to get the tools that we need. For example, the company paid for J.P. Boodhoo's Nothin' but .NET Developer Boot Camp (highly recommended) and we have dual monitor (moving to tri-monitor) workstations and a copy of Resharper. We work together in a team room to maximize communication.

    Based on the success of the first application, we have a mandate to develop two other applications from scratch in .NET 3.5 using agile techniques. The development is long-term and strategic for the company. We are looking for three senior developers with strong object-oriented skills and experience with extreme programming or other agile development techniques to join our team as full-time employees.

    You can get more details about our business at our web site, http://www.mvbalaw.com/. We are a stable, family-oriented business. We provide benefits including company-paid health insurance for the whole family, 401(k) match, vacation and holidays.

    Interested?

    If so, individuals only (no recruiters, please) e-mail me directly at developerjobs@mvbalaw.com.

    Thanks,
    Weston M. Binford III
    Director of Software Development
    McCreary, Veselka, Bragg & Allen, P.C.

     

  • Ward & I talk over the EF Vote of No Confidence Document

    The second part of Ward Bell & I's conversation on ORM is up at the ALT.NET Podcast.  In this part we dive right into the vote of no confidence document that kicked up so (much more than was justified) fuss and racket about a month ago.

    We recorded it a couple weeks back, and I've spent a little time thinking about the EF VoNC. At this point I'd say that:

    1. After looking more at it, EF v1 is actually worse than I thought it was

    2. No, I don't regret signing and helping to write the no confidence thing.  I wish it had unfolded differently and I'm disappointed at the negativity around it, but I still think it was worth doing.  I still don't think the wording of the document was very inflammatory, but I guess the idea of openly criticizing a Microsoft product is still taboo for big areas of the .Net community.  If nothing else, it's actually sparked something of a real dialog between two or more camps of development that rarely communicate with each other

    3. What I've heard from EF v2 (Mr. Bellware goes to Redmond, Washington) sounds pretty good.  The EF team might have already been on the cleaner POCO path anyway.  I really wish they'd been a bit more transparent and upfront about that.  From all appearances, it's always looked like the EF team was completely blowing off our original concerns about the usability of EF.  Anyway, here's to hoping the EF team's new openness and transparency leads to a better relationship from now on. 

    4. I think EF v2 sounds like it might be usable from my perspective, so would I recommend using EF v1 if you want all that EDM stuff and migrate to the POCO model in v2 later?  I'm going to make the sure to be controversial standpoint that it'll be easier to start with NHibernate now and migrate to EF v2 later than it would be to start with EF v1.

    5. Regardless of what they do, I think the EF is unlikely to completely succeed.  The EF is getting yanked into way too many directions to make everybody happy.  Look at their fancy advisory council.  Some DDD guys, an Agile guru, a database weenie who wants to write all his code in T-SQL sprocs like it's 1995, and an MDA guy.  How could one single tool make all of those different people happy without collapsing under its own complexity?  Oh, and tou think ALT.NET whines about the EF?  On a couple different occasions I've watched data centric guys yell at the EF team for perceived shortcomings in stored procedure support.  I couldn't tell you the specifics of their complaints though, because I snoozed off as soon as I heard the words "stored procedure."

    6. ALT.NET gets a rap for bad behavior, but in the wake of the VoNC document, I thought the traditionalists (the TechEd/INETA/Regional Director types) behaved poorly as well.  The kicker for me was Stephen Forte's crack that developers want ORM's because they're too stupid and lazy to learn set-based algebra, then says that he hopes "cooler heads" will prevail later in the exact same post.  Um, rank hypocrisy anyone?
  • Ward's Wiki is still a great resource

    I have no idea if it's still being updated, but I'm floored by how useful and relevant Ward's Wiki is today 10+ years after its inception.  I'm doing research for an article today and the single most helpful source of information and thought is *still* the original Wiki.  If you're a student of software design, and object oriented design in particular, do yourself a favor and spend some time perusing the conversations that happened there way back when (late 90's ish).


  • New StructureMap users group on GoogleGroups

    Chad was kind enough to create a new StructureMap users group on GoogleGroups.  I'm running very behind on StructureMap docs and not doing a good job of answering support emails at the moment, but I'm hopeful that the new group will help on both accounts.  Please, please, please put any and all questions about StructureMap in the new forum.  I'll try to add any questions I answer from email to the new board.

    Doing a preview release of 2.4.9 has turned out to be a good idea.  I've made some fixes from reported problems and our own dogfooding that will get rolled into 2.5 soon.  I'm also adding some new defensive programming checks for some common problems. 

  • Ward Bell and I wade into O/R Mapping Issues

    Ward Bell from IdeaBlade and I recorded an episode of the ALT.NET Podcast with Mike Moore on Object Relational Mapping.  It's a two parter, with the first part being a discussion on what we want from O/R Mapping, and the second episode getting into the whole Entity Framework controversy.  I'm obviously ALT.NET to the hilt, but Ward is coming from a different perspective.  Hopefully between the two of us we covered the ground in a balanced way.  From Mike's announcement, we touched on:

    P.S.  I'm absolutely sick of people quoting Ted Neward's Vietnam post.  Waaa.  Sometimes it's really hard and you have to roll your own one-off solutions for edge cases -- and the edge cases that I remember were caused by some goofy database designs and an arbitrary design decision.  Besides, Neward isn't saying let's go write stored procedures.  He's wanting OODB's.  So if he can use an historical reference to describe ORM, I'll use a different one for OODB's:

     

    Next year with an OODB. (think "Next year in Jerusalem") 

  • Classes that show up in every project

    Just out of whimsy, here's my list of classes or interfaces that seem to show up in every project I work on.  

    1. Bootstrapper - sets up StructureMap and whatever UI machinery.  I formalized this in StructureMap 2.5 for diagnostic purposes.
    2. Debugging - Just a test fixture marked as explicit for playing with little bits of code and troubleshooting
    3. ObjectMother and/or DataMother (Test Data Builder ala Nat Pryce)
    4. TestUtility - Usually just a quickie way to run Fit/StoryTeller tests inside of NUnit tests
    5. ICommand - Execute() and usually something else
    6. A console app called DatabaseGenerator to setup the development and testing databases.  Wraps the NHibernate hbm2ddl tool for us.
    7. A console app called CodeGen to kick off whatever code generation we're using.  We codegen DTO's and Fit Fixture classes.
    8. If it's a desktop application, I'll have an ApplicationController and ApplicationShell
    9. SpecificationExtensions - This is relatively new.  I love the SpecUnit stuff that Bellware did with extension methods for RSpec like unit test assertions.  We add our own extensions at will.
    10. XmlExtensions - Extension methods for Xml manipulation.  Just a little bit of effort makes Xml consumption so much easier
    11. IRepository.  We dumped IRepository<T> with Save(T) methods in favor of IRepository with Save<T>(T) and use Linq for NHibernate to express queries to avoid having to write one off repositories for each aggregate root.  It's too early to say if it's a better approach, but I'm hopeful.  Our current one looks like:

        public interface IRepository

        {

            T Find<T>(long id) where T : Entity;

            void Delete<T>(T target);

            T[] Query<T>(Expression<System.Func<T, bool>> where);

            T FindBy<T, U>(Expression<System.Func<T, U>> expression, U search) where T : class;

            T FindBy<T>(Expression<System.Func<T, bool>> where);

            void Save<T>(T target);

        }

     

     

    What's yours?  Or is this just a sign of being in a rut? 

  • How does design get done on an Agile Project?

    Last week I gave a talk at Agile Austin entitled “How does design get done on an Agile Project?”  The slide deck can be downloaded here, and, thanks to Chad Myers, you can watch the video feed on Viddler.  (There is content in there after I get done being hamhanded with the A/V stuff).

    Major points and questions:

     

    What do you mean there isn’t an Architecture Phase?  When does design get done?  All the time.  Continuously.  Design is too important for the success of your project to be restricted to a brief “architecture phase” anyway.  Design is all around us.  Design surrounds us, penetrates us, and binds the system together.  No seriously, design is happening.

     

    Can this work?  Yes, it can, if you have good people with solid design skills who can also communicate their ideas and thoughts to others.  People are still the most important factor in a project. 

     

    Who does the design?  Every single coder on the project.  Oh, your senior guys are going to make most of the decisions, but every single developer should be participating in the design and be able to explain the design.  Developers do much better with a design if they understand how it came about.  The best way to understand how it came about was to be there at its creation.  At a bare minimum, the worst developer on the project team should at least be a source of feedback for the design.  “This is hard to code this way” or “I don’t understand what I’m supposed to do here” from your junior most developer is still a sign that something might not be right with your design. 

     

    Anyway, enjoy Chad’s camera work, and here’s some relevant links.

     

    Links:

    Is Design Dead? – Martin Fowler in one of the most quoted papers of all time

    A Microcosm of Agile Design – but, but, but Web Services are easier than they used to be.  I don’t care if it’s easy to build a web service.  It’s still more mechanical work to build a Web Service than a library that runs in process with the rest of your code.  The automated tests run slower if there’s SOAP in there anywhere, the deployment is a bit more work, and it’s just more friction all the way around. 

    First Causes:  Reversibility.  But it’ll be cheaper if we do it now!  We should just build the web service/caching infrastructure/generalization now while we’re in the code!  It’ll be harder later!  We have to get it right upfront, or all hell is going to happen.  All those fears are valid, but we can eliminate the cause for concern by paying attention to the reversibility of our design decisions.

    “Code Complete” is a lie!  Done, done, done is the truth

    The Last Responsible Moment – Make decisions at the right time.  Sometimes delaying a commitment to a design until you have more information is the best course of action.

    Ordering Code Construction Tasks – Work vertically by feature!  Don’t schedule your development in terms of infrastructure or technical layer.  Everything follows from a business goal.

  • Let's see, if I...

    ...am facing a hard problem, that seems like it must be a common scenario, I should probably...

    Write an all new logging tool?  Um, no.

    Reinvent Sql?  Um, no

    Use IL generation?  Immediately stop whatever it is you're trying to do

     

     

    The correct course of action Grasshopper is to GOOGLE IT FIRST!!!!  If it seems like a function that should be in the .Net framework, it is.  If you think that somebody has to have already done this, they have.

     

    Listening to a friend, who shall go nameless to protect the victim's privacy, gripe about some co-irkers.  I like my job.
     

More Posts

Our Sponsors

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP