CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

My friend needs some help on an article

I would never do this, but a "friend" of mine has procrastinated entirely too long and let a deadline for an article sneak up on him.  Here's a couple ideas that my friend has for his next article.  The article has to be on design fundamentals from a relatively ideology agnostic standpoint (not overtly pro-Agile or TDD in other words).  His first article in the series on the Open/Closed Principle will appear next month.  Please think about which topics would benefit your team members too, Mr. "I know the basics cold" Alpha Geek.

  • "Design Vectors" / "It's the Little Things" / "A title that doesn't stink" -- Why do you care about Encapsulation, Coupling, and Cohesion.   Then follow up with some heuristics to push your design towards these qualities.  Tell, Don't Ask, Law of Demeter, Don't Repeat Yourself, and a bit on some Code Smells.  My friend wants to sneak in an example of using a lambda expression to remove duplication.  Yes, Mr. Alpha Geek, you've read the Pragmatic Programmer front ways, backwards, and sideways, but this is for a more general audience.
  • Creational Patterns -- Builder, Factory, Abstract Factory.  Then talk about using an IoC tool as a generic way to implement these patterns.  The importance of separating functionality from the grunge work of assembling object graphs.  My friend isn't that excited about this one.
  • Object Stereotypes -- An introduction to the idea of object stereotypes from Responsibility Driven Design.  Apply these stereotypes to some bigger patterns like MVC/MVP.  It's an under appreciated topic.
  • Inversion of Control as a Pattern -- Forget the IoC/DI tooling.  Let's talk about how, why, and when this pattern is useful.
  • Patterns for Persistence and Data Access -- Lots of stuff from Fowler's PEAA book.  Unit of Work, Database Mapper, Active Record, Row & Table Gateway.
Anything sound good to you?  My "friend" would appreciate some opinions here.


Comments

Jarod said:

my friend told me to tell your friend that he, speaking on behalf of his team, wants to read all of the topics... so just pick one!

But I say 2, 1, 3, 5, 4

# May 7, 2008 2:34 AM

Bart said:

I vote for the first one.

# May 7, 2008 2:56 AM

Chad Myers said:

My vote is for #4 - the IoC pattern. I'm tired of hearing people say that we do these things just to make testability easier.

# May 7, 2008 3:20 AM

My friend needs some help on an article » Agnostic Front News said:

Pingback from  My friend needs some help on an article » Agnostic Front News

# May 7, 2008 3:52 AM

David Tchepak said:

+1 to Chad's comment on IoC.  Be great to have an article on IoC itself, rather than simply of a way of replacing dependencies at test-time.

# May 7, 2008 3:56 AM

ScottC said:

Where might these articles appear?

# May 7, 2008 8:17 AM

TedE said:

I'd like to see Object Stereotypes, since I'm not very familiar with that topic.

# May 7, 2008 9:18 AM

Jeremy D. Miller said:

@ScottC,

It's for MSDN Magazine, so you'll be able to read it one way or another

# May 7, 2008 9:25 AM

Chris Bilson said:

+1 for Object Stereotypes. Will you blog proto-articles?

# May 7, 2008 9:49 AM

Jeremy D. Miller said:

@Chris,

I can't do that this time.  I'll link to it though.

# May 7, 2008 9:51 AM

Chris Chew said:

I'd love to see an article from your friend on Object Stereotypes!

# May 7, 2008 10:36 AM

James Lorenzen said:

+1 IoC

# May 7, 2008 10:44 AM

Bil Simser said:

The IoC one is nice and could make for a good article. My second runner up would be the creational patterns as they can tie into the IoC one, but maybe that should be your "friends" next article.

# May 7, 2008 10:57 AM

jdn said:

IoC, and why it is used/useful for anything but helping testability (sorry Chad :P)

# May 7, 2008 11:11 AM

JohnOpincar said:

I vote for IoC and creational patterns.

# May 7, 2008 12:43 PM

open sound control said:

Pingback from  open sound control

# May 7, 2008 1:01 PM

Lucas said:

Without a doubt the first one.

# May 7, 2008 1:06 PM

Colin Jack said:

I'd like to see Object Stereotypes, seems like the most interesting of the lot.

# May 7, 2008 1:13 PM

Joe said:

Creational patterns, real world usage.

# May 7, 2008 1:29 PM

Sergio Pereira said:

It's no secret that I have a thing for incorporating lambdas in your design ( devlicio.us/.../default.aspx ) but I'd also see a lot of value in an article about favoring composition over inheritance.

# May 7, 2008 2:01 PM

Tom Opgenorth said:

#1 by far.  You need those principles as a foundation.

# May 7, 2008 2:15 PM

Kasi Prasad said:

I'd like to see the really basic stuff like SRP and OCP (hopefully with thorough coverage of Strategy) covered. As an MCT (Microsoft Certified Trainer) I am suprised by the number of developers I encounter who have never heard of these terms nor how they are implemented. I think these simple concepts go along way toward teaching the "Why" behind many of the other topics you mention (specifically IoC, Coupling and Cohesion).

Oh and btw, Excellent Work on that MSDN article regarding ALT.NET. Glad to see MS supporting ALT.NET in a publication that really reaches the masses.

-Kasi

# May 7, 2008 2:34 PM

Jeremy D. Miller said:

@Kasi,

This is a bimonthly series of articles for MSDN.  The very first one coming up in the June issue addresses OCP and SRP.  

@All,

Thanks for all the comments here.  I think what I'm going to do first is the Object Stereotypes, but probably use some IoC scenarios as illustrative examples.  I've got more prepared for that.  I might get the "why IoC" thing out on the blog.

I'll definitely do #1 at some point.  Maybe I'll do the creational patterns next since so many people asked for it.

Thanks everybody!

# May 7, 2008 2:52 PM

Seth Petry-Johnson said:

+1 IoC, +1 Persistence and Data Access.

# May 7, 2008 4:18 PM

Nat said:

I  vote for the design vectors.  It sounds like your friend has a lot of personal experience and wisdom to put across.

From your short abstracts, I think your friend needs to work more on the IoC/DI/object-construction topics. For example...

"The importance of separating functionality from the grunge work of assembling object graphs".  In OO code, you can't separate functionality from assemblage of objects.  The functionality IS the assemblage of objects.  If you can separate functionality from composition, it means your classes are too large.  If you try to separate functionality from composition, you end up with code only expresses how the system works, instead of what it does and why.

The others sound like your friend is repeating what he has read elsewhere.  I'd much rather read his thoughts about software than his rewording of someone elses.

# May 7, 2008 5:10 PM

Jeremy D. Miller said:

@Nat,

""The importance of separating functionality from the grunge work of assembling object graphs".  In OO code, you can't separate functionality from assemblage of objects."

Yes you can, and many times you should.  Object graphs do real work in and by themselves.  Assembling those object graphs from storage, the database, Xml config, or whatnot is often a separate responsibility from the business logic performed by those object graphs.  Sorry, but I think the IoC article has some value based on your comment.

# May 7, 2008 8:45 PM

Robz said:

+1 IoC

# May 7, 2008 9:45 PM

Andy Stopford said:

>>  I think what I'm going to do first is the Object Stereotypes, but probably use some IoC scenarios as illustrative examples

when you say 'I' you mean your friend, right? ;-)

# May 8, 2008 7:51 AM

isaiah said:

design vectors and object sterotypes please

# May 8, 2008 7:53 AM

andrew finkenstadt said:

1+ control of inversion

# May 8, 2008 9:23 AM

Bil Simser said:

Heh. What's funny is *everyone* uses "IoC" describing inversion of control (and hey, why not, it's shorter to type). I bet *everyone* has an IoC static class with a couple of methods like Resolve and Resolve<T> in them and an initialize method that takes in IWindsorContainer.

The debate now is should "IoC" be "Locator" since that's what it's doing which introduces more DDD like terms to replace the technobabble.

# May 8, 2008 9:27 AM

Chad Myers said:

@Bil That's the first stage in bending the mind around IoC and away from 'traditional' creation patterns. I started out using ObjectFactory.Get<IFoo>() all over the place, but what I found was that it was essentially just a replacement for the 'new' operator and I still had many of the same problems.  Sure, I have a lot more flexibility, but it's still not true INVERSION of control, it's more DELEGATION of control.

The next phase (that I went through at least) was to get to the point where no object is creating another object (well, at least the objects I control, new StringBuilder() is OK, for example).

The only place I want to see ObjectFactory.Get<TYPE>() anywhere is when the app is initializing or in some central place that kicks off a cascading dependency resolution fiasco that results in all my objects being ready to go when they're needed.

# May 8, 2008 9:54 AM

J.P. Hamilton said:

Object Stereotypes or Creational Patterns

# May 8, 2008 9:33 PM

Kiris said:

+1 to object stereo types.  While the other stuff is interesting, I think this one is under served in terms of coverage.

# May 8, 2008 11:34 PM

Derick Bailey said:

There's a lot of suggested topics about underlying principles, and "high" level patterns. I'd like to see an article that ties things together - a look at why patterns exist, in the context of the principles.

for example, MVP/MVC are great patterns - but if you truely understand DI, LSP, SoC, Orthogonality, etc. etc., then MVP/MVC are some of the possible natural outcome of the code you will want to write for a UI.

# May 9, 2008 10:45 AM

Kalpesh said:

All topics are interesting.

However, any topic with "what is it?", "how it works?", why should you care? and where it can be applied with real life example (other than northwind) would help.

Thanks to you & friend.

# May 11, 2008 2:56 PM

Jeremy D. Miller said:

@Kalpesh,

I'm with you on this one.  I don't *ever* want to see another article that goes "point XYZ at the Northwind database and let 'er fly!"

# May 11, 2008 3:16 PM

demeter said:

Pingback from  demeter

# May 12, 2008 2:24 PM

Jeremy D. Miller -- The Shade Tree Developer said:

I, I mean, my friend , just wrapped up an article on object stereotypes. At the last minute I decided

# May 19, 2008 3:49 PM

Community Blogs said:

I, I mean, my friend , just wrapped up an article on object stereotypes. At the last minute I decided

# May 19, 2008 3:58 PM

The little things do matter | Developer Home said:

Pingback from  The little things do matter | Developer Home

# May 27, 2008 8:23 AM

The little things do matter | Developer Home said:

Pingback from  The little things do matter | Developer Home

# May 27, 2008 2:01 PM

Kalpesh said:

I know your friend now ;)

It goes into recursion, if the author of the article is your friend.

# May 27, 2008 6:32 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP