CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter
Like CodeBetter.Com? Get more Stuff you need to Code Better at Devlicio.Us Devlicio.us

ForEach, a simple but very useful extension method

This evening I was writing some code (Yay!) for an Xml based MEF catalog I am prototyping. I came across the need to invoke a set of methods on an IEnumerable<T> that was returned from a LINQ to XML query. Unfortunately no such animal exists on IEnumerable.

It took me < 5 mins to write this

   1: public static class IEnumerableUtils
   2: {
   3:       public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
   4:       {
   5:         foreach(T item in collection)
   6:           action(item);
   7:       }
   8: }

Any questions?

Prism, MEF and DI oh my

herdingCode-165px

A few weeks ago I had a chance to chance to chat with the gang over at  Herding Code on all of the above. I was in a particularly talkative mood after coming from a full day of presenting at Tech-Ready, so I'll warn you that there might be some rambling. As a result the podcast was split into two parts. In the first part we discuss Prism and DI in general. In the second part we delve into the specifics of MEF, and whether or not it is the one true DI container to unite them all ;) The best part is at the end when I get to turn the tables and put them in the hot seat :)

I had a great time hanging out with those guys, well virtually at least. I really like the open round table style format of the podcast. Check it out below.

Episode 11: Glenn Block on Prism, Unity, and MEF (part 1)

Episode 12: Glenn Block on Prism, Unity, and MEF (part 2)

Continuous Improvement in .NET Software Development

The website is up for the "Continuous Improvement in .Net Software Development" conference has been posted at http://kaizenconf.com/.  It's a bit different in scope than ALT.NET Seattle in that there will be free workshops before the open spaces event over the weekend. 

I've been instructed to say that the information on the website is of yet incomplete, so watch that website for more information.

DevTeach

 

Looks like I will be at DevTeach in Montreal this December. I will be doing 4 talks (so much to keep in my head at once). There are many other great people showing up that I really look forward to seeing.

 

 

In the Agile Track I will do a talk

 

"TDD in a DbC World"

Design by Contract is slowly moving its way into the mainstream. Many wrongfully find Test Driven Development and Design by Contract to be in conflict with each other.

This session will familiarize the audience with some some basic concepts of Design by Contract and the use of a theorem prover for the static checking of contracts. Discussion will then look in more depth at how we can maintain a Test First mentality in a Contract First world.

 

This talk is the same as the one I am doing in the alt.net track at QCon

 

 

The rest of the talks are all in the Architecture Track:

Domain Driven Design Chalk Talk

We as developers and designers face increasingly more difficult problem spaces. By creating models around these problems we can create better, more flexible, longer lasting, and further distilled solutions to these problems. Domain-Driven Design is a formalization of this process.

This talk introduces many of the basic patterns in Domain-Driven Design but instead of focusing on the patterns themselves it focuses on the interactions and intentions of the patterns. In other words, we will talk about "entities" for about 30 seconds before we get down and dirty on some real life problems and handle the tough stuff like determining aggregate boundaries and the roles of application services.

A novice should be able to take away something from this talk, but then again so should an expert.

 

I am particularly looking forward to this one as I have done a few of these in the past but never actually "prepared" for one. After watching the video from alt.net this weekend there are definitely some places where having a list of what I want to talk about will come in handy.

 

The Non-Functional Juggler

This is not just me making failed attempts at keeping flaming knives in the air, although that would probably be more entertaining.

Non-Functional specifications are at the core of any architecture. Learning to balance non-functional specifications with each other and align them with business needs is the most important skill an architect can possess.

The presentation looks at some of the varying types of non-functional specifications, how they interact with each other, and how you as an architect can determine the level of success for your project by managing them.

 

Command Query Separation

Betrand Meyer introduced the concept of Command and Query separation to Design by Contract nearly 30 years ago. Command and Query separation need not only apply at a micro-level to our code but should be a key architectural theme in our systems.

This presentation after defining Command and Query separation as a theme, looks at a few common architectures and how we can improve them through the strong use of separation.

Moving to Microsoft

During the past month, I have accepted a new position at Microsoft.  I am now working on the Expression Web project that is part of the Expression Studio product suite.  It’s an exciting time as I am learning my way around the team, product and company.  Expression Web is an excellent web content design tool - from Standards Compliance, to developing cleaner CSS and being able to tie it in with ASP.NET and PHP all make this tool a must-have.

So what is it like to work at Microsoft? It’s awesome – getting dialed in to the team here and getting to know different groups around the company is great.  After spending a few weeks in Redmond at Building 42, I am now working in the Minneapolis, Minnesota development office with a growing team.

What does this change in my blog and projects – namely dotMath?  Nothing really - dotMath licensing stays the same and I will continue blogging here at CodeBetter.   I am looking to resume blogging and focusing on coding issues once again with a whole new set of blog content!

 

So...that happened

The first alt.net Canada conference is come and gone and as Doc went through the rules of engagement for Open Spaces on Friday evening, the one that stuck out for me this time was "Whatever happens is the only thing that could have".

As he listed it, I couldn't help thinking of State and Main, written by my favorite screenwriter, David Mamet. In it, the star of the movie they are shooting, played by Alec Baldwin, gets into a spectacular car crash (no wait, that's not the analogy I was thinking of). He walks away unscathed, looks around, and says quietly to himself, "So...that happened."

It's the way he says it so blithely that triggered the memory during alt.net. He says it as if it is the only thing that possibly could have happened. Which is the essence of principle three of Open Spaces. And it would be an awesome quote to start the retrospective had I been more on the ball.

I don't have a decent segue into the real point of this post but I love working movies into my posts, especially ones by David Mamet.

The event was, in my humbilly opinion, better than I hoped it would be. Which shouldn't have happened had I heeded Doc's advice to "be prepared to be surprised" but there it is nonetheless. A good turnout. Minimal logistic issues, thanks to a very good-natured group. Bil Simser has done a pretty phenomenal job so far videographing the event. Here is my brief take on some of the talks I attended:

Which presentation technology should you use?
It depends

Telecommuniting, or "Don't you hate pants?"
This was a topic after my own heart but I have more to say on it than I can cover here. Coming soon...

Command/Query Separation and Occasionally connected applications
I blipped back and forth 'twixt these two because they were similar...yet different. Seems to me that command/query separation would be a good way to build an occasionally-connected app. Tucked a bit of info away for the day when I eventually need to build one.

Volunteering our skills to more than just OSS
Convened by Donald Belcham and one of my favorite topics of the conference, primarily because it is the epitome of what I love about this event. You'll never see a similar topic discussed at your average code camp or likely even at a major conference. In it, we talked about projects people have done to benefit the community at large, not just other developers and we talked about how to volunteer for similar projects. I'm hoping details will be forthcoming on the Proceedings page but if they aren't in a few days, I'll elaborate.

Convention over configuration
Discussed existing uses of the principle in things like StructureMap and NHibernate, as well as recent implementations of it in MVC and Fluent NHibernate. Also talked about potential pitfalls, when its appropriate, and how convention compares with tooling. Again, I can elaborate if there is interest.

How do you choose the right framework?
There was just a little too much focus on "What is Microsoft doing wrong?" that I made some attempts to steer people away from but all in all, I got my questions answered. The answer to the title question I gathered was "hone your instincts and use them."

 

As I mentioned in the wrap-up, my major goal was to re-connect with old friends and start making new ones. I find the social aspect of alt.net to be the most beneficial as it fits well with the nature of Open Spaces. Despite my closing remarks, there almost certainly *will* be another event and discussions have already begun on possible locations and dates. And early indications are very positive.

Thanks all for a great weekend and especially to Doc for facilitating both the event and the conversation on the way back to the hotel Saturday night with Lyle and Osie (and I sure hope I spelled your name reasonably).

Kyle the Alternative

The Null Pattern is a Good Thing

That's all I've got to say this morning.  Check it our here:  http://en.wikipedia.org/wiki/Null_Object_pattern

More Posts Next page »


Our Sponsors

Free Tech Publications


What's New

CodeBetter.Com Blogs

Glenn Block
47 Posts | 165 Comments | 89 Trackbacks
Jeremy D. Miller -- The Shade Tree Developer
559 Posts | 4,189 Comments | 1,879 Trackbacks
Greg Young [MVP]
96 Posts | 578 Comments | 281 Trackbacks
Kyle Baley - The Coding Hillbilly
93 Posts | 520 Comments | 159 Trackbacks
Steve Hebert's Development Blog
311 Posts | 542 Comments | 99 Trackbacks
James Kovacs
38 Posts | 131 Comments | 43 Trackbacks
Matthew Podwysocki
43 Posts | 108 Comments | 163 Trackbacks
Karl Seguin
133 Posts | 1,201 Comments | 354 Trackbacks
Patrick Smacchia [MVP C#]
63 Posts | 263 Comments | 311 Trackbacks
Raymond Lewallen
300 Posts | 1,973 Comments | 354 Trackbacks
Dave Laribee
59 Posts | 424 Comments | 144 Trackbacks
David Hayden [MVP C#]
282 Posts | 763 Comments | 571 Trackbacks
Jeff Lynch [MVP]
228 Posts | 494 Comments | 108 Trackbacks
Ian Cooper [MVP]
33 Posts | 195 Comments | 144 Trackbacks
Peter's Gekko
536 Posts | 2,334 Comments | 583 Trackbacks
Aaron Jensen
10 Posts | 34 Comments | 18 Trackbacks
Rod Paddock
37 Posts | 145 Comments | 40 Trackbacks
Jacob Lewallen
5 Posts | 40 Comments | 7 Trackbacks

Other Blogs

CodeBetter.Com Events
3 Posts | 0 Comments | 13 Trackbacks
CodeBetter.Com Link Blog
178 Posts | 9 Comments | 2 Trackbacks
All About Products
2 Posts | 5 Comments | 2 Trackbacks
Featured Articles
1 Posts | 4 Comments | 1 Trackbacks

CodeBetter.Com Alumni

Jean-Paul S. Boodhoo
136 Posts | 496 Comments | 146 Trackbacks
Don Demsak
5 Posts | 14 Comments | 1 Trackbacks
Jay Kimble -- The Dev Theologian
423 Posts | 1,431 Comments | 167 Trackbacks
Eric Wise
290 Posts | 1,494 Comments | 218 Trackbacks
Brian Peek [MVP C#]
15 Posts | 15 Comments | 3 Trackbacks
Mark DiGiovanni
88 Posts | 322 Comments | 45 Trackbacks
Paul Laudeman
113 Posts | 234 Comments | 23 Trackbacks
Ben Reichelt's Weblog
172 Posts | 514 Comments | 74 Trackbacks
Ranjan Sakalley
41 Posts | 272 Comments | 6 Trackbacks
Public Class GeoffAppleby
300 Posts | 1,943 Comments | 108 Trackbacks
DonXML - Live From PDC
3 Posts | 4 Comments | 3 Trackbacks
Grant Killian's Blog
171 Posts | 475 Comments | 8 Trackbacks

CodeBetter.Com Emeritus

Darrell Norton's Blog [MVP]
730 Posts | 2,383 Comments | 331 Trackbacks
Jeffrey Palermo (.com)
654 Posts | 2,478 Comments | 620 Trackbacks
Brendan Tompkins [MVP]
405 Posts | 2,740 Comments | 347 Trackbacks