July 2008 - Posts

Ann Arbor Give Camp - Angel's Place

I was fortunate enough to be not only an organizer for the Ann Arbor Give Camp, but I also put myself on the development team for Angel's Place -- a local charity that helps place developmentally and physically challenged adults into good homes.  Our team of Paul Vollweiler, Carl Furrow, Aditya (Adi) Thakker and myself had a great time with our assigment.

After Friday's night's dinner, we met with our charitiy representative Marcie Levey and started working on a solution for their ever-growing waiting list (that is currently stored in Excel!).  Once we had a good idea of what we wanted to do, Paul set up an SVN repository for us to use for the weekend and then Carl jumped on the UI.  Paul, Adi and I whiteboarded the schema until about 1am Saturday morning.  Then we started coding our domain model using ActiveRecord.  We were just about done at 2am, but we kept going for about another hour writing some code to populate the inital tables.

On Saturday we finalized the domain model and started work on the UI (WinForms).  Carl had organized the form into different tabs which related to the different sections of the paper form the Angel's Place staff is already familiar with.  In addition, he set up an architecture where each tab had a separate user control that was used to display data for a particular applicant.  This allowed all of us to work together on the same UI without having to worry about conflicts in VS.NET's "designer" files.  We just concentrated our UI coding on a particular user control!  That along made us very productive in the home stretch.

All in all it was a great success!  We didn't complete our app 100% before Sunday, but Paul has put a lot more work into it and we'll be handing it over to the charity some time this week.

Technorati tags:
Posted by PSteele | with no comments
Filed under:

Ann Arbor Give Camp - WOW!

Wow!  Wow!  All I can say is WOW!

As one who helped organize this event (along with Microsoft's Jennifer Marsman, John Hopkins and Todd Bohlen) I was simply amazed, impressed and astounded about the weekend's events.  We had an awesome group of developers give up a beautiful July weekend in Michigan (and if you know Michigan, there haven't been too many nice weekends this summer) to come out and help charities solve their IT problems -- mostly by developing/enhancing a website or creating some kind of small data collection app.

While the majority of the weekend was head's down development, one of the best parts was Sunday afternoon where everyone (charities and developers) got together and showed the work that was done.  It was amazing to see the amount of work accomplished in a single weekend.  You've got to realize we had some charities come in with nothing -- no domain name, no website, no email, nothing! -- and walked out Sunday afternoon with a full CMS-backed website that allowed them to get their message out.  Awesome!

I can't wait to be a part of the next Give Camp!  Thanks to Jennifer for bringing me in on this.

Technorati tags:
Posted by PSteele | 1 comment(s)
Filed under:

Moving from NVelocity to Brail

I'm a big fan of Castle's Monorail -- an MVC implementation for ASP.NET.  One of the nice things about it is that you get to pick which view engine you want to use.  The engines currently available are NVelocity, Brail (based on Boo) and AspView.  There's also a new view engine for Monorail based on NHaml.

When people first start learning Monorail, a lot of them use NVelocity.  It's a very simple templating language (which kind of forces you to keep complex logic out of the view) and most all of the Monorail documentation has samples using NVelocity.  I've used NVelocity for the few small Monorail projects I've done and I've been pretty happy with it.

I wanted to give Brail a try so I pulled out one of my older Monorail sample projects (doesn't everybody build a small sample app when they're first learning something?).  Monorail supports registering more than one view engine so I just updated my web.config to include brail as well.  This seemed like an easy way to run NVelocity and Brail side-by-side so I could play around with converting my old views to Brail as well as creating new ones.

I did notice one thing right away: You can't have a layout in one engine and the view in another.  My controller had a "default" layout (called default.vm).  I added a new method to the controller called "BrailTest" and then created my view "BrailTest.brail".  When Monorail found the "BrailTest.brail", that meant the layout had to be called "default.brail".  When the layout "default.brail" wasn't found, I got an error.  So even though it's technically possible to use two view engines at the same time, note that you'll have to maintain two layout files.  I don't even know what would happend with view components!  :)

Starting Fresh With Brail

So I decided to start a new Monorail project that would use Brail as the view engine.  Accessing my PropertyBag variables is almost exactly the same: $myVar in NVelocity vs. ${myVar} in Brail.  What I fell in love with his having a real .NET CLR language (Boo) for my view engine.  If I need some tricky logic, I just create a small helper method in Boo and I'm all set.  Very nice!

So here's a few points for anyone thinking about moving from NVelocity to Brail:

  1. Brail is case sensitive.  As a C# programmer, I usually keep my "case" in order, but I got sloppy with NVelocity and used a lot of lowercase everywhere.  Can't do that with Brail anymore.
  2. Layouts: While NVelocity uses "$childContent" to indicate the location of the rendered view, Brail uses "${ChildOutput}".
  3. If you decide to create a function in Brail ("def"), it needs to be the first thing in the Brail file -- before any rendering code.
  4. Boo uses indenting for blocks.  Brail adds an additional requirement of having an "end" keyword.  Not a big deal for me since I haven't done any real coding in Boo.
  5. Make sure you include the ":" with your else statements!  This one had me puzzled for quite a while.  If you're not familiar with blocks in Boo/Brail, he's a sample if statement:

if charity.AssignedRoom is not null:
    // do some stuff
end

Note the "end" is specific to Brail (not Boo).  Well, if you need to add an else clause, make sure you include the ":" with the else:

if charity.AssignedRoom is not null:
    // do some stuff
else:
    // do some other stuff
end

All in all, I really like Brail and don't think I'll be moving back to NVelocity any time soon.  Well done Ayende!

Posted by PSteele | with no comments
Filed under: ,
More Posts