Archive for November, 2008
Unfortunately the images to this post were lost during the migration from Blogengine.Net to WordPress
I have been using a Mac as my main development machine for over a year now. I have been very happy with it, you could call me an Apple fanboy. Because I develop in the .Net framework, and I’m not planning on changing that, I had to find a solution to be able to run Windows on my Mac. There are two options to get that done:
- Installing Bootcamp: this implies that you have to reboot your machine to get to Windows
- Virtualization: running Windows as a virtual machine on top of Mac OS X
The first reason I changed to Mac was the slick design but after using it intensively I came to realize that that isn’t the strong point of a Mac. The strong point of the Mac is OS X. It’s a robust operating system that doesn’t get in your way. I was so pleased with OS X that I wanted to use my Mac for all general computer use (surfing, email, …) and just use Windows as a shell for Visual Studio. So Bootcamp was no option for me.
The first choice was made, I wanted to work with Virtual Machines to run Windows on my Mac. There are two virtualization solutions on Mac, VMWare Fusion and Parallels. Because a good friend of mine, who has an excellent video production company by the way, recommended me Parallels I went for that solution and never looked back … until a few days ago.
I was trying to set up a new Parallels Virtual Machine and was installing Windows XP. After 5 tries I had given up. Windows (in Parallels) kept throwing blue screens at me. In the past I had never had this problem. So out of frustration I decided to try VMWare Fusion. I installed it and created my first VMWare Virtual Machine. The first killer feature I noticed is that the desktop and documents is shared between your virtual machine and Mac OS X. It is very easy to copy files between the two.
The perfect situation for me is that I have one Virtual Machine, which I can copy if I want to test something like an early bèta and then delete it when I’m done. In this way I don’t have to install application after application that I don’t use in my Virtual Machine and I can keep my Windows clean. A VMWare virtual machine is only one file, you can copy it and when you boot it VMWare Fusion detects that the VM is copied. A Parallels Virtual Machine exists of several files and is less easier to copy. Another point scored by VMWare Fusion.
While doing some research on the two products, I noticed that Parallels is popular with designers and VMWare Fusion is more used by programmers. The fact that Parallels is so popular is in my opinion because of the design of the product. Starting a virtual machine is very slick, you’ve got rotating windows and stuff like that which makes it a great experience. Developers who use VMWare Fusion are mostly coming from Windows, on which VMWare is already very popular. On top of that, I have the feeling that VMWare Fusion is a little more robust then Parallels. A .Net developer tends to use his virtual machines a bit more thoroughly then a designer who most of the time just uses them to do some cross platform testing. I think that explains why designer prefers Parallels and developers prefer VMWare Fusion.
So I’ve made the switch VMWare Fusion and I’m very happy with it at the moment. Are there any .Net developers on Mac among my readers? Which virtualization platform do you guys use?
There is one thing that almost made me throw VMWare Fusion out of the window. The next screenshot explains it all:
Notice the Install McAfee menu item, I hope VMWare got a lot of money out of it because I really hate it when stuff like this get incorporated into a good product.
Note: I haven’t tested Parallels 4 yet, I wrote this post before it came out.
Using and abusing ASP.NET MVC for fun and profit
Being a huge fan of ASP.NET MVC, I couldn’t miss the opportunity to see guys that are much smarter than I am show off how they use the MVC framework. Jeremy and Chad showed real code of how they had been using the ASP.NET MVC framework in their projects.
Because this is a brand new framework, I have these moments when I’m using it that it doesn’t feel quite right. I feel that the way I’m coding something isn’t the best way to do it, but I don’t know how to get around it. While sitting in the session I had a lot of aha-moments, I saw how other people tackled problems that I couldn’t wrap my head around until now.
These are some key points that from now on I will try to keep in mind while using the ASP.NET MVC framework:
- Keep your views light, your controllers medium and your model heavy
- HttpContext is your enemy, controllers should not come in direct contact with the HttpContext even now it’s mockable
- Get rid of magic strings (for example hashtable examples like ViewData)
- Thunderome principle
- No if’s or foreach’s in the view, use extension methods, htmlhelpers and partial views to get rid of logic in your view
Last but not least was a demo that Jeremy gave of StoryTeller, it was a short demo but it looked very promising. I highly recommend viewing the session, you can find the video’s at the KaizenConf wiki.
This time Jeremy paired up with Glenn Block to tell us more about presentation patterns. They talked about several presentation patterns including passive view, supervising controller and view-viewmodel-model. The thing I realized is that I’m not using presentation patterns enough in my day to day job and that I should start using them where I can as soon as possible.
After the fantastic sessions it was time to kick off the open space. This was my first open space and I didn’t really know what to expect. Doc List coordinated it all and it was a great learning experience. We started with a fishbowl, after which everyone participating could propose subjects. After that everyone voted and the topics that he or she was interested in. The schedule was formed.
An open space leans on four principles:
- Whoever comes is the right people
- Whatever happens is the only thing that could have
- Whenever it starts is the right time
- When it’s over it’s over
I followed a lot of sessions and have a lot of loose notes. I had a really good feeling with the concept of open space. The sessions are more debates and the participants discuss the things they want to talk about, not only what the speaker wants to show. Because almost everyone is participating you learn a lot from each other.
This was by far the best conference I’ve ever been to. I’ve learned so many things in such a short period of time. I would like to thank everyone who we met in Austin specially Conrad and Michael for letting us tag along and of course Scott for organizing the whole thing. If you are interested, there as a LOT of material produced you can find it on the KaizenConf wiki.
Unfortunately the images to this post were lost during the migration from Blogengine.Net to WordPress
It’s finally there, Jan and I departed from Belgium to Austin, Texas to attend Kaizenconf. I have been looking forward to this for quite a while. It didn’t start out good when I spilled my first drink on the plane, but it only got better from then on. After a long flight with a stopover in Atlanta we arrived at the Austin airport. A lot smaller then I expected but that didn’t really matter.
On the first 2 days of Kaizenconf some promising workshops where scheduled, we decided to go listen to the great ayende talking about Advanced NHibernate. The talk started off with a blast when ayende gave a demo of the NHibernate Profiler that is being developed. Although beta it looks like this will be a real hit and it will help developers to get to know and control NHibernate better. I don’t see myself as an advanced NHibernate user but it was nice to follow a workshop that isn’t the usual introduction on how to create a Northwind CRUD application.
Below is a screenshot of the NHibernate Profiler, although it’s not the best of quality you can see the query that NHibernate has generated, the different queries that were fired onto the database and much more. Very, very promising!
Another topic that was explained is the use of Lucene with NHibernate. By using a couple of attributes on your domain models to indicate which parts should be indexed, you get a very easy way to make your data searchable. Because the original is always better, here is a short video where the advantages of using Lucene with NHibernate are explained:
We went on to NHibernate caching and again I discovered something that will change the way I use NHibernate on a daily basis. Seems like caching is actually very intelligent but, as with everything, you have to watch out not to shoot in your own foot. Oren showed us an example that called the database 4 times without using any caching and called the database 42, yes forty-two, times with badly configured caching.
Here are some random notes I took that I’d like to keep in mind for future use of NHibernate:
- When loading an object via session.Load the query gets fired when the object is being accessed, not when the Load() function is called
- NHibernate solves threading issues with caching by returning different instances of the same object to different users
- Queries can also be cached, call the SetCacheable(true) function on every occurrence of the given query you want to cache
After this excellent session we were looking for something to eat. Luckily some of the attendees (thank you Chris and Tim) were kind enough to give us a ride to Rudy’s BBQ where we learned that ‘Real people eat meat’. I don’t think they have a lot of veggies under their customers.
For the second workshop a difficult choice had to be made. It was choosing between the DDD chalk talk of David Laribee or the workshop about Functional programming of Matt Podwysocki. You probably already guessed the one I chose. This was something completely different then the NHibernate talk and Matt asked several times if our brain hadn’t exploded yet, and if I’m honest I had to answer yes every time he asked it. There was a lo-hot of information to take in.
The first part of the presentation was about making C# more functional. By heavily using the new features in C# 3.0, a lot of for-each loops could be eliminated with the help of stuff like LINQ and lambda expressions. Matt told us that F# is very good at math stuff, the software that determines the best player in Halo 3 is written in F#. Because F# has a specific purpose, there will never be a designer to create GUI’s or web pages using F#. I think I heard a little cheering in the room after those words. I still have to take a closer look to the abundance of examples Matt provided us to be able to give a deeper insight into F# so I’ll leave it at that for now.
Although I’d like to show a piece of code that Matt shared to point out the dangers that come with lazy evaluation of code:
GetContent = fileStream.ReadToEnd();
String content = GetContent();
Because the fileStream is out of scope when calling the GetContent function reference, this will give unexpected behavior which is very hard to debug if you ask me. Another good session for which I’d like to thank Matt.
The conclusion of the first day of kaizenconf is very good. As I already said the sessions were of high quality. I’m already looking forward to day 2 which has an ASP.Net MVC session given by Jeremy Miller and Chad Myers. Very exciting!