Sunday, April 4, 2010

The Managed Extensibility Framework (MEF) Part Creation Policies

I'm gonna kick of a series on MEF partly for my own benefit, but maybe this will make sense to you as well. However, this won't be a beginners tutorial.

MEF ships with 3 types of part creation policies, Any, Shared and NonShared. By default all exports get the CreationPolicy.Any. What's a lesser known fact is that this allows the consumer -- imports -- to specify either CreationPolicy.Shared or CreationPolicy.NonShared.

Both attributes [Import] and [ImportMany] has a RequiredCreationPolicy property which let's you specify how the imports are satisfied. I tend to prefer to imply the correct behavior on the consumer side and not mandate that the producer has to think about it. With the default policy being CreationPolicy.Any a convenient factory pattern just imports with the CreationPolicy.NonShared. And if you're importing a collection you just don't have to worry about the composition failing, because if it's not working they're doing something wrong, it's not your problem.

Of course if you export a specific policy and import the other policy, the import is not satisfied which can lead to an unexpected exception being thrown.

Thursday, April 1, 2010

Best of MIX2010

I would also recommend Joe Belfiore presentation CL01 Changing our Game – an Introduction to Windows Phone 7 Series and the others that continue the Windows Phone 7 Series. It's a really interesting piece of technology and beautifully designed with great potential.

Monday, February 15, 2010

Sunday, February 14, 2010

Difficult != time consuming

There. I said it. Difficult problems are problems that lack a solution. Problems that can be solved, problems that have many existing solutions today, are not difficult. Not all problems are difficult, but they are time consuming and it would be preferable if they could be solved by someone else. The problem with such a solution is that things change, and when you rely entirely on other people for your solutions, you'll lose the ability to adapt in a situation when your out of the box (component) or solution can't sustain your domain. That's why you sometimes have to do things yourself, in your own way. Because no one else understands your problems that well.

Sunday, July 12, 2009

Publishers want a law to control online news access

I just recently stumbled upon this comment while reading this article over at Ars technica.

Maybe I'd feel a little more sympathy for the press if they actually did their jobs nowadays. Rewriting press releases in your own words is not journalism. Reporting on what is on Twitter is not journalism. Running yet another story on the most popular video on Youtube is not journalism. It's mimicry. Very little actual journalism happens anymore. The rare exception is local news, where you do get reporters going to committee meetings, calling multiple sources, and in general doing research. But national news? Eh. They do little more than rewrite press releases.

Evolve or die.

I couldn't agree more, I don't watch TV and generally avoid newspapers because of the sub-par writing. I tend to prefer my first-hand sources, here on the Internet.

What bothers me is that it seems like someone, or something is trying to control the flow of information... this is why we built the Internet and it's not about control, it's all about sharing!

Wednesday, March 18, 2009

MIX09

Go to the http://videos.visitmix.com/MIX09/ website and check out the rest of this year's presentations.

Saturday, March 14, 2009

Rotten apples

I bought my first Apple product (a MacBook) late 2007, I was a proud owner back then, and it was a absolutely wonderful design.

For roughly 6 months, I learned new things about Mac OS X and it was good. I was motivated to learn more about UNIX, and dug into Mac OS X development with Xcode. I had never intended that the MacBook would replace my desktop use enterily, but through a number of unforeseen events it has. However, it wasn't possible for me to entirely leave the Win32 platform behind, I'm a Win32 guy at heart, and I managed to bring that to Mac OS X with the help of VMware Fusion.

As of this date, I own, a late 20007 MacBook, a Apple Mighty Mouse and a 4G iPod nano. I've been using Apple products and Mac OS X for about 18 months now...

From this point on, it's all down hill... and I believe this Mac vs. PC debate is mostly silly, and in large, fueled by people with no knowledge of how a computer actually works. Some people will argue that they don't care about that, and they shouldn't be caring about it, because it is not in their job description to care about it and I respect that, but don't go make false accusations about things you don't understand.

The reason why I'm abandoning ship and going back to Windows, is because of Microsoft, they fix problems. I'll admit that Windows back in the day, was a troubled experience, but so was all pre-Mac OS X releases. Microsoft today, is very keen on listening and helping out, and since hardware, that runs Windows, ain't proprietary Apple branded and redicoulously expensive. Any third-party with the knowledge and experience can fix driver issues. I've had issues with OpenGL support on my late 2007 MacBook, and while there were driver updates for Windows, Apple left MacBook users like me, in the dark to rot. And that's another reason why I'm going back, Windows is an open platform, not open source or free as in freedom but accessible, by any hardware. And these graphics issues happen to have been solved by Intel, but there is no Mac OS X download, just a Windows version...

Mac OS X didn't really shine until they went POSIX and replaced their kernel with a UNIX variant. But what's distrubing about that, is that Linus Torvalds (in this Tech Talk) calls on Mac OS X to be an even worse platform for software development than Windows, and Linus knows a thing or two about UNIX. It's like Ballmer said, we're paying $500 more, for a brand! And while that's a feat in itself, I doubt Apple can keep this up for much longer. While the MacBook and Apple logo is everywhere, surprisingly few people run Mac OS X.

Right now, I'm in the process of installing Windows on my MacBook, but while downloading some required bits to format my iPod, I'm getting a disk full error. I bring up Finder, it says I have 166 GiB of disk space available... This is just one of the many problems I've experienced with Mac OS X, and it's about to go away.

HOWTO: Install Windows Vista/Server 2008 on a late 2007 MacBook3,1

First off, this is about liberating the MacBook, you'll only need some of the Boot Camp drivers and the firmware update which emulates a BIOS. Once you have this you're done with Mac OS X. You'll only need the Mac OS X installation DVD once. Derek Hatchard blogs about the specifics. You just use it to partion your hard drive with a MBR. To my knowledge no MacBook supports booting of an USB stick so you'll have to have a Windows installation DVD. The rest is simple, you can boot the Windows installation of the DVD as you would normally. My disc drive gave me a hard time but being presistant helped, after poping in and out many times it eventually completed the installation, be presistent!

I had major issues with the suttering audio and had to install a very specific driver to get around this. After manually and forcefully installing the Broadcom v5.10.38.26, "Broadcom 4322AG 802.11a/b/g/draft-n Wi-Fi Adapter" things began to work fine again. Unfortenetly, I could not find a reliable way to determine which hardware matches what driver, it looked like most MacBook users went with the Broadcom 4322AG driver so you could start with that, it worked for me.