Archive for January, 2009

Setting up a FubuMVC Project from Scratch

I am going to start a series of articles on using FubuMVC for web projects. I have several reason for writing these, one of which is FubuMVC has a lack of documentation right now, so these articles will help out that cause. Also I am starting to do mostly web work, and want to do these apps with FubuMVC as opposed to Asp.net MVC. (This is purely for personal reasons).

Upcoming Topics:

Setting up the Bootstrapper and Global.asax
Creating Models, Views, and Controllers with FubuMVC
Adding database connectivity
Using HTML helpers

I will most likely cross post these to the FubuMVC wiki once they are refined and final, so if any of you have comments, ways to do things better, or find things I should explain or do differently, please leave me a comment.

Before You Begin

Before you start your setup, head over to the FubuMVC website, grab the latest version of the source and compile it. This way you will have the references I am using below.

Project Setup

The first thing you need to do is go setup your project and folder structure. I am not going to detail the process here, because most people have thier own preferences and naming conventions but for my sampl I will be using the following folder structure:

  • FubuSample
    • lib
    • src
      • FubuSample.Core
      • FubuSample.Web
      • FubuSample.Tests
      • FubuSample.sln

    You may have noticed above that I am using three different projects: FubuSample.Core (class library), FubuSample.Web (Web Application) and FubuSample.Tests (class library). Setup these projects and we will move on, mine look like this:

FubuSampleProjectSetupv1

Got it, great. Next thing I am going to do is add references required for FubuMVC to work. I added the following references to my projects:

    1. FubuSample.Core
      1. FubuMVC.Core
      2. FubuMVC.Container.StructureMap
      3. StructureMap
      4. Microsoft.Practices.ServiceLocation
    2. FubuSample.Web
      1. FubuSample.Core
      2. FubuMVC.Core
      3. FubuMVC.Container.StructureMap
      4. StructureMap
      5. Microsoft.Practices.ServiceLocation
    3. FubuSample.Tests
      1. FubuSample.Core
      2. FubuSample.Web
      3. FubuMVC.Core
      4. FubuMVC.Container.StructureMap
      5. NUnit.Framework
      6. Rhino.Mocks
      7. StructureMap

Once all the references are are in your 3 projects, you are almost ready to get going. The next thing to do is to setup a basic folder structure inside your projects. In the web project I added a Views folder and a Content folder; under the content folder I added seperate folders for images, scripts and stylesheets. Moving on to the Core project I added top level folders for  Config, Domain, and Web. Under the Web folder I also added folders named Controllers, DisplayModels, Html, and WebForms. My folder structure now looks like this for my projects:

FubuSampleProjectSetupv2-AfterFolders

Next up, setting up the Bootstrapper, Global.asax and Web.config for FubuMVC

A New Year, a New Opportunity

I wanted to take a quick minute and let everybody know that I am pursuing a new opportunity with my career. I have been with my current employer for 10 years. I know that I have matured a great deal both professionally and personally during that time. I have no doubt that my current job and the relationships I developed have prepared me for the next step in my career. So now you are probably wondering what I am going to do, and to tell you the truth I haven’t cleared with my new employer how much I can write about yet, but I will do that soon.

 

I can tell you this though, I am going to be managing and developing the software development side of a company that is in startup mode. We will be primarily doing Asp.Net Web Apps, MVC style. This is a little scary for me as I have been doing Win Forms development for the past 5 years, but I have kept my fingers in a lot of web stuff. I am also thinking we are going to build on top of FubuMVC vs. Asp.Net MVC . This is primarily because I am wanting to get involved with the development of FubuMVC as an Open Source Project this year. I have several pages of documentation on getting started with FubuMVC from scratch, I am sanitizing and creating posts / articles out of them as I have time.

 

I am really excited about this new job, I have a good feeling that it is going to open up lots of new opportunities for me to stay involved with the Alt.Net community, and maybe I will get to see more of you more often.

 

p.s. I will post more details if/when I am able.

Education Breakdown?

I just got back from vacation and I was trying to catch up on the Alt.Net mailing list, and ran across a few heated discussions. Inside one of these discussions I ran across a post with the following statement:

Personally I think that university Computer Science programs are a
joke (at least in the U.S., can’t speak for other countries). In my 4
years at the U. of Toledo I think I had 5 classes that taught me
something relevant to real world software development. The words
"unit test" were never uttered in my classrooms <shudder>. College
grads take this education into workplace and have no idea how to
practically use the skills that they have learned.

 

As far as I know there is nowhere you can go to get a formal education
on advanced software development topics. User groups and conferences
are great, but there are tons of devs that don’t go to those things.
I’m talking about classes that teach you software development
principles like what unit testing is, how to do test-driven
development, what SOLID is, domain driven design, etc., or maybe more
technology specific things like how to use NHibernate, how to optimize
ASP .NET applications, etc.

I have to say that I wholeheartedly agree with this statement. In my 7 years in college I had never heard of Unit Testing, SOLID principles, etc. It wasn’t until I began to use the basic building blocks I was taught in daily software development that I realized, “Hey, there is a better way to do this stuff.” Then I found the Alt.Net community and began further educating myself on these topics. The most important part of what I just discussed is, “I educated myself.” In large part this is the one single thing that separates a great developer from a programmer, initiative. You have to want to continuously improve and hone your skills in order to become a great developer.

 

Why does this education breakdown exist?

I have my opinions on why this education breakdown exists and I would love to hear yours as well. I think one of the biggest reasons this happens is because Computer Science programs tend grow from within themselves. I mean obviously if you have been in college for 12 years and have a PhD in Computer Science then you are an expert software developer, right? I say WRONG; It becomes the blind leading the blind in a redundant cycle over and over. Most PhD Computer Science professors are what I would call “Research Oriented.” They go through their entire educational career never writing any real business software. They focus on research projects, and exercises that are only important in school. They are not forced into dealing with the pain and struggle that full-time normal developers encounter each and every day. The dynamics of developing software with a team and a boss, and their bosses boss, not to mention timelines and financial constraints. These “Expert” professors hold the students well being (grades) in their hands, and mandate that you do it their way or you fail. Nobody wants to fail so they do it their way, and the cycle continues.

Some professors may actually come from the industry, but many only join academia in retirement. More likely than not, they were not a developer when they retired, they had become “successful” and moved into management. Either way, it has probably been a while since they were in the trenches developing software on a daily basis. Compounding the problem are advances in language, methods, and principles. The software they wrote a long time ago was in different languages than what is taught at colleges and universities today. They are now learning new languages so they can teach them to students. They are so focused on the new languages that they neglect the principles that are language independent like Unit Testing, SOLID principles, ORM’s, TDD, etc.

 

What can we do to stop the cycle?

I believe we have to take action as individuals inside the community to change the path that our future team members are on as soon as possible. Each year, the cycle perpetuates itself.

One of the ways we can do this within our own teams is to have “The Way”. Inside our development team we have “The Way”, which is the way we develop software. We practice TDD, Unit Testing, DDD, we adhere to SOLID principles, we use NHibernate. That is “The Way” we develop software. Now this puts a burden on the company, and on the seasoned developers to spend time with new team members and teach them how to do these things. This does two things: it helps develop a team working environment and hopefully instills in them personal initiative to continuously improve their software skills.

Another way that I am currently doing is to get involved with your local college, community college, or University and teach some classes. Remember, the professor’s way is the students way. I currently teach classes at our local university and these are the exact things I want to engrain in the minds of these students. Next week I begin teaching an upper level Systems Analysis and Design class. During the semester we will design and begin developing an Open Source Learning Management System,will make the students learn and practice concepts such as pairing, unit testing, SOLID principles and practice using an ORM. They will create this project in C#, as that is my language of choice, but will understand that these tools and concepts are not tied to one language.

You may or may not be able to teach a class at your local university but I would be highly surprised if you could not, at the very least, give a talk at a “Computer Science Club” meeting about these things in an evening.

I know I do not have all the answers, but this is the best way for me to make a difference. I would like to hear opinions and other things we can do to help alleviate this breakdown in education of our future employees and teammates.

-Ryan

Quick 2008 Recap and a few New Years Resolutions

Whew, I cannot believe that 2008 is over already, it seems like it just started. 2008 was a great year for me as a developer for several reasons.

 

Met new People

I was able to meet a ton of new people in 2008, both online through blogs and other communities, and at KaizenConf in Austin. This is probably the single most important thing that happened to me in 2008 because it helped put me into circle of people that share the same thoughts and values about software development that I do.

 

Alt.Net Introduction

I was also introduced to the Alt.Net movement during 2008. I have been developing software for several years and some of the things I had been doing just didn’t seem quite right, they worked, but they had a smell to them. Enter Alt.Net, this stuff just makes sense. It is smart software development, that revolves around creating highly testable, highly maintainable code that follows the SOLID design principles. I have come to realize that if you just ask yourself “How does this proposed solution adhere to the SOLID principles” you will write much more elegant code.

KaizenConf Open Spaces Conference

This was my first open spaces conference and I didn’t know what to expect but I came away with the feeling that this was the best conference I had ever been to. KaizenConf helped fuel my fire for continuing with more Alt.Net stuff, working on Lean Software Development and KanBan methods, and staying involved with the community. It even spurred me to start blogging more frequently about these topics.

 

Some 2009 Resolutions

I have a few resolutions I am going to make for the new year, some are computer related, some are not.

  • Blog More – I am targeting 52 blog posts in 2009, that is a little more than double from 2008 and is only 1 per week.
  • Fish more, I love fly fishing, just need to make more time
  •   - Fly Fish for Bass – talk about fun!

  • Write Elegant Code – I am staying committed to SOLID principles, testability and maintainable code.
  • Learn more about Asp.Net – Especially MVC stuff, I have been doing WinForms development for the past 4 years, so I am looking forward to this one.
  • Learn a new Programming Language – Everybody should do this every year.

I am going to stop there, I don’t want to set any unrealistic expectations for myself during the year. I think all of these are very attainable and I hope that my list has spurred some inner resolution making within you to go out and commit to something new in 2009.