Den Ben’s Blog

March 8, 2009

Getting my hands dirty again

Filed under: Propaganda, Software Development — benpittoors @ 14:51

It’s been more than a year since I last actively participated as a developer in a development team.  Sure, I wrote some kick-ass T-SQL scripts and the occasional line of C#.  But, over the last year my tasks were more targeted to data modeling, functional design and project- and team coordination rather than to writing source code.

This was up until about 3 weeks ago, when I was given the chance to write some code again.  I wrote most of the functional design for the project and a team of 3 developers already implemented a great deal of it.

Now, during the time of my source code writing abstinence, my colleague Davy Brion had done serving his time in Enterprise Hell and was asked to strengthen our in-house software development team.  Davy introduced a lot of technologies and patterns that extended the way we previously developed our software projects.

He ditched our code generated data layer and introduced NHibernate instead.  Being a big fan of dependency injection he also threw Castle Windsor into the picture.  And to top it of, for our unit tests he showed us how to easily mock dependencies using Rhino.Mocks.

It only took me about a day or 2 to fully understand and start using the new architecture in a productive way.  So how did I manage to grasp these concepts so quickly?  Well, the answer is easy: they aren’t all that hard to understand!

NHibernate

While having had no experience in NHibernate at all, I already knew the general idea of ORM.  And as I joined the development in a stage of the project in which already alot of funtionalities were implemented, I had some real life examples of mapping files, entities and data repositories laid out in front of me.  Taking it from there was not that hard.  Although for the occasional question it is kinda handy to have an NHibernate developer in your team.

Castle Windsor

Again, I knew about dependency injection as a way to implement strategies and the likes but seeing CW in action really blew my mind.  You just register your components in code (or xml) and don’t care about them anymore.  The IoC will automatically inject the configured dependencies for you (as long as you provide the means to do so by adding the corresponding constructor parameters or public properties).

Rhino.Mocks

We already were writing unit tests for a few years (as is the core of our genesis development methodology) before Davy introduced Rhino.Mocks.  Some of the techniques a mocking framework solves were not new to me.  I already had stubbed some dependencies with manually written ‘test’ code.  Again, the simplicity of creating mocks, stubs and expectations with Rhino.Mocks really impressed me.  And the unit tests are _fast_!

So, All’s Well That Ends Well?

I did manage to screw one thing up though :)  I wrote a piece of code that created a new entity in memory and that did not initialize a non-nullable field.  Since the tests for that code, mocked the data repository that is responsible for persisting the entity, they ran just fine while in fact they covered faulty code.  Adding an extra test for every non-nullable field would solve this problem, but I don’t believe that is the best approach (a bit tedious don’t you think?).  We’re already thinking about an elegant solution for this… maybe one day you’ll read about that on Davy’s blog orso… :)

October 25, 2008

Why does Apple memory cost so much?

Filed under: Propaganda, Rant, macbook — Tags: , , , — benpittoors @ 20:08

After installing a .Net development environment in a VirtualBox Vista machine on my macbook, I decided to upgrade from 2GB to 4GB so I fired up a web browser to the Apple Store. Man, was I disappointed…

The upgrade kit that includes two 2GB DDR2 (PC5300) laptop memory modules is listed at 280 EUR. And that was about 3 times as much as I was willing to spend on it.

Of course, I knew Apple would charge more than average for a memory upgrade. And I’m certainly not the first person to have noticed that :-). But I bought the memory for a mere 50 EUR some place else. That’s right! Less than 1/5th of the Apple Store price. So ‘above average’ is kind of an understatement here…

Ohw, and for those of you wondering: I bought “Kingston ValueRAM SO-DIMM 4GB DDR2 Kit (KVR667D2S5K2/4G)” and it works just fine in my macbook. 2 runs of memtest reported no errors.

Side note: the VirtualBox Vista experience index with 2GB’s of allocated memory for ‘Memory’ went up from 4.5 to 4.8 ;-)

October 21, 2008

Running a virtual Vista on OS X without Parallels Desktop or VMWare Fusion

Filed under: Propaganda, macbook — Tags: , , , , , , — benpittoors @ 21:13

Right! A one hour a day limit. Sure…

Ohw-kay… Setting a one hour a day limit seemed a bit optimistic at the time. But then again, I just didn’t find the time to blog about all the interesting things (uhuh) I did over the last few months. I know, I know, it’s pretty embarrassing; showing of my knowledge and all. But I’ll just smile about it, and act as if nothing happened.

On topic again (almost)

Among other things I neglected to do over the past few months (OK, OK, I’ll drop it in a moment… just bear with me on this. I promise there is a point) I also lost interest a bit in my macbook. Which is a shame, because it’s an awesome machine (mine is a 3,1 by the way). The reason for this, mostly, was because I do not have a .NET development environment on it. And since I also own a 4GB RAM Intel Core 2 Duo Vista PC I just didn’t find any reasons to invest in Parallels Desktop or VMWare Fusion. But luckily my music composing hobby recently led me back to the mac. And once again I immediately felt comfortable in Leopard. So I googled around a bit for other virtualization options on Mac OS X and I came across this page. You’ll find lots of links to virtualization software and (sometimes very) brief descriptions of what the software does and is capable of. I decided to give the best free listed alternative a go, which is VirtualBox. I’m very pleased with it so far and although I’m not going to write an extensive review about it I do feel I have some things to share… ohw, and these are my experiences with VirtualBox on Mac OS X (10.5.5) running Vista 32bit as a guest OS but VirtualBox is able to both run and run on Windows or Linux too.

Installation

Installing VirtualBox is as easy as any other software installation on OS X. You download a .dmg, it automatically gets mounted, you run the installation package, follow the installation wizard and the thing ends up in your applications folder. It also places a bunch of user files in your home folder/Library/VirtualBox location.

Creating a new Virtual Machine

There’s a wizard ;-) Most of the options will look very familiar if you have any experience with other virtualization software (Virtual PC, VMWare…). Apart from naming your new virtual machine you have to choose an OS Type first. The list is very long, ranging from DOS over the most common linux distributions to all possible Windows versions and even OS/2 Warp. I picked Windows Vista… since that was what I was about to install.

Then, it suggested a base memory size of 512MB. That seemed a bit low to me, so I upped it to 1024 (fyi, my macbook has 2GB of RAM)

After that, I needed to create a virtual hard disk. I chose a dynamically expanding one (less space in the beginning) giving it 30GB to go (which is the size it will report to the guest operating system). Unlike Parallels or VMWare Fusion you do not have the option to mount a bootcamp partition. Which is fine by me… I’m not planning to install a native Windows on my mac any time soon.

Before firing it up I mounted a Windows Vista evaluation copy installation iso. This couldn’t be done straight away. I had to add it to VirtualBox’s image library first. Not that it wasn’t easy to do so, but it seemed a bit odd to me not just being able to mount any iso image I browse for. On a side note: I mounted the iso over an smb network share and this wasn’t an issue at all. You also have the option to map your physical CD/DVD drive by the way.

Vista Installation

Upon starting up the virtual machine VirtualBox kindly notified me of the host key, which on Mac OS X is the left cmd key. The host key is used to release the keyboard and mouse capturing back to the host operating system.

The Vista installation took about half an hour. Then I noticed there was no network support. Apparently Vista didn’t recognize the standard emulated network drive. This I found in the VirtualBox manual, which of course I did not read up front ;-). The solution was very easy: I just had to install the VirtualBox guest additions (which are very similar to Virtual PC Additions). Apart from a custom network interface driver it also installed a bunch of other things enabling the guest operating system to resize its host window, automatically capture/release mouse input etc.. very nice! One remark however is that the resizing doesn’t really come smooth. It takes a while to resize the host window (visual delays) and the contents are scrambled during the resize process. But once you’ve sized the window to your desired resolution it feels snappy again.

Downloading and installing service pack 1 + all remaining windows updates took about an hour and a half extra.

Performance

While I haven’t really used the virtual machine extensively – I plan on doing so in the near future – I let Vista measure the performance for me. This resulted in a Windows Experience Index of 1.0! Not really that impressive now is it? Well, it all comes down to the base index of the emulated graphics interface. Breaking down the index into its several measures yields a more satisfying result:

  • Processor (Calculations per second): 4.3
  • Memory (RAM) (Memory operations per second): 4.5
  • Graphics (Desktop performance for Windows Aero): 1.0
  • Gaming Graphics (3D business and gaming graphics performance): 1.0
  • Primary Hard Disk (Disk data transfer rate): 5.9

Again, my macbook is macbook3,1 with a 2.2Ghz intel core 2 duo and 2GB RAM (667Mhz) so that about explains the 4.3 and 4.5. The emulated graphics are not exactly showcases but that is a classic issue for many virtualization engines (although I’ve read Parallels has added 3D acceleration support in its latest version). The disk index of 5.9 (which is the maximum possible value at the moment) is really impressive. I guess VirtualBox does a really good job at handling dynamically expanding hard drive images.

Conclusion

I like it! I’m still not convinced that it will keep me away from my physical Vista machine, but I do plan on starting to use this virtual one occasionally. The graphics performance might become an issue if I ever plan on using or even writing any WPF demo’s or the likes, and the memory limit of 1GB will most likely not do me any favors regarding database engine, OLAP – or web site performance but it is a very small step towards mac only hardware. Although that also implies me buying a bigger mac (imac, macbook pro, mac pro?) with alot more RAM in the distant – or near – future… which is a thought I can stand to live with ;-)

December 19, 2007

Setting a one hour a day limit

Filed under: Propaganda — Tags: , — benpittoors @ 21:01

If you surf the web for a few minutes; type in a search query into your favorite search engine; then you’ll probably notice that millions of people enjoy their daily blog posting activities.  And I must admit, the thought of showing of my knowledge to the world through the same means – a blog – has crossed my mind more than once.  Well, the inevitable has happened: This is my first blog post!

The title of my first post indicates that I’m setting a limit however: I absolutely will not spend more than one hour a day on this blog. Most of the days I even won’t put any time in at all.

As a Software Architect I have to deal with a whole bunch of technologies every day.  So that’s what I’ll be posting about the most I guess.  So… what can you expect here (assuming you’d expect something that is)?

  • Business Intelligence related stuff.  This can go from dimensional modeling topics to SQL Server Analysis Services 2005 (2008?) cube design.  I’m still a novice in that field but I intend to become a true data warehouse guru ;)
  • C# and the .Net framework… and even Java if I happen to be in that camp at the moment of posting.
  • Agile development methodologies (Genesis)
  • I love my MacBook running Leopard so… who knows :)

And that’s not an all inclusive list!


Blog at WordPress.com.