views:

89

answers:

2

I ask because most patterns are pretty intimidating at first glance, and I haven't had much experience coding them. Most that I've had the chance to implement were worth the effort, but some made me feel like I wasted my time. I'd like to try taking down a beast and finding that it was not as much of a struggle as it initially seemed.

Here are some suggestions of what I'm looking for in a good answer:

  • A short description or link to a resource
  • Why you thought it was ugly
  • Why it turned out to be beautiful
  • An idea for a small project which could be wrapped around the pattern to show off its utility

Please avoid posting any code. I want this to be a learning experience.

+1  A: 

MVC + iPhone/Mac. Was cumbersome then the beauty of it shone through after beginning to understand it.

That was my first experience with MVC pattern anyway. Interface Builder makes it even nicer to do.

Nick Bedford
+2  A: 

For me it was DI/IOC & Mocking.

It started off with me learning how to unit test. I quickly learnt this meant that when you invoke the code, it would run ALL of your code right down into the database. So I asked the next obvious question "how can i unit test my business logic without it going to my database?"

When i got told about mocking that sounded like a whole lot of extra work. Especially all the code i'd have to write chose when to use a mock in a test vs. when to use the "real" version in production.

So I asked the next question "is there a way to simplify that?". The answer was "yeah of course, use DI & IoC. I had it explained to me and my head exploded. It made NO sense, it was the exact OPPOSITE way to how I had been coding for the last 10 years.

Of course now I love what this pattern does for me. The clean seperation, the ease of testing. But when i first started learning about it, it seriously freaked me out!

Example of a small project to show it? Watch the screencasts on DotNetRocks TV.

David Burela
Thanks, I'll give it a shot :) Thanks for the details.
Sean