Saturday, July 19, 2008

Social Web And Window Shopping

Social web. What do you think that means?

Imagine walking down the sidewalk. You stop at the big display window for a store. You're looking at this really cool item being displayed. Near you, there are a few people there looking too. You strike up a quick conversation with the person next to you. You and she share insights and then walk on; both a little wiser and happier. The shopping experience is much more enjoyable and memorable.

This same social experience can be had on the web. See the video:



Saturday, July 5, 2008

System Metaphor Gold

A good System Metaphor is a golden thing to have. It's the theme that ties everything and everyone together. In an existing system with a great System Metaphor, one can find anticipated concepts reflected in the code easier. A System Metaphor is also a fantastic communication bridge between the Customer and Developers.

The System Metaphor article by William Wake explains what a System Metaphor is. I suggest going beyond the article and checking out his book titled Extreme Programming Explored to see the "More Examples" section provided in chapter 6.

Examples of System Metaphor and discussions about System Metaphors have been going on for at least 8 years. At http://c2.com/cgi/wiki?SystemMetaphor, people such as AlistairCockburn and MichaelFeathers have debated on how to make System Metaphor work best. Interestingly, Martin Fowler stated in his XP 2002 Conference article "...I don't worry too much about metaphor when working with XP...." Has he changed his mind since then?

A thought currently in my head is what to do about System Metaphor Disharmony. If an existing system lacks a System Metaphor that we can recognize, a System Metaphor conceptual rehashing is necessary. Adding communicative new code and cleaning up old code is just easier with a System Metaphor.

So, go forward! Find those System Metaphors! Go for the Gold! :)

Friday, June 13, 2008

Testing an Annotation

I found neat ways to test annotations.

Here is some annotation test code using JUnit

public class LongParameterListRefactoringTest {

@Test
public void isAnnotationWhenAsked() throws Exception {
assertTrue(LongParameterListRefactoring.class.isAnnotation());
}

@Test
public void annotationIsAnnotated() throws Exception {
assertTrue(LongParameterListRefactoring.class.getAnnotations().length > 0);
}

@Test
public void isAnnotatedWithRetentionAnnotation() throws Exception {
Annotation annotation = LongParameterListRefactoring.class.getAnnotations()[0];
assertTrue(annotation instanceof Retention);
}

@Test
public void isAnnotatedAsSourceCodeAnnotation() throws Exception {
Annotation annotation = LongParameterListRefactoring.class.getAnnotations()[0];
Retention retention = (Retention)annotation;
assertEquals(RetentionPolicy.SOURCE, retention.value());
}

}
This code lived at the SeePeople project.

Note: annotationIsAnnotated has since been changed. Can you guess why?

Tuesday, March 25, 2008

Yes, Smile and Repeat Yourself

If you care enough about something, you will repeat yourself. That's a good thing.

"I love you!", I said to my wife this morning. I said it yesterday. I've said it for over a decade. I never grow tired of it. I care about my wife and that miracle we call love.

Writing great code is important! Creating things of value is important! Being someone of value is important! Communication, Simplicity, Feedback, Courage, and Respect are all important values.

If I am asked the same question repeatedly, I am happy to answer someone who sincerely seeks knowledge and wisdom.

Human communication often requires things to be repeated. It may take 10 times! I saw this in a training class I just took. The same question was asked 2 minutes after the answer was already given. The trainer, Brian Button, calmly responded with a smile and gave the same answer.

That's the way to go! Smile, support communication, and move on.

Saturday, January 26, 2008

XP Principles Support You - Kent Beck Again

I read and heard something extremely powerful which led me to share with you this link to the Implementation Patterns book interview with Kent Beck: http://www.infoq.com/interviews/beck-implementation-patterns. I wish to share with you one small sliver of insight said in this very inspirational and insightful interview.

In response to "XP is ...practice oriented.........patterns and XP and how they work together?", Kent Beck goes way beyond the question and shares beautiful Agile insights. Here is one insight:

He reminds us there are 3 things to consider with Agile Development; values, principles, and practices. He talks about being Agile and not just doing Agile practices.

In answer to a statement such as "XP was made for the people and not the other way around", I hope you and I remember that that is why Extreme Programming (XP) Principles are published too. They are in the XP white book and are listed in Martin Fowler's Bliki.

When a practice is not working for us in a particular context, Extreme Programming Principles are what we can retreat to. Sitting on our XP principles, we can figure out how to tweak a practice, replace a practice, drop a practice, or add a practice as we need to.

In that Implementation Patterns book interview mentioned above, Kent does a great job of telling us how we should step back and examine a practice in light of a principle. It's said in that interview, it's said in Martin Fowler's Bliki post ( http://martinfowler.com/bliki/PrinciplesOfXP.html ), and it is repeated here.

Hopefully, you and I will remember.

Thursday, December 27, 2007

Fluent Interfaces, Domain Specific Languages, OO Roots

I see industry backing for Fluent Interfaces. It is in more places than you may know. In my opinion, all people in the software industry will want to know what Fluent Interfaces are, where they are used, and how they fit into the canvas of what they care about.

What are Fluent Interfaces? Fluent Interfaces is an API style that empowers the user of the API to programatically express something in a natural and easy to read way. Martin Fowler describes Fluent Interfaces well. See http://martinfowler.com/bliki/FluentInterface.html

Steve Asher
explores Fluent Interfaces in-depth from the user and designer point of view at his Build Without Boundaries blog at http://buildwithoutboundaries.blogspot.com. Search for Fluent API.

Having Martin Fowler support Fluent Interfaces is huge. I also see Fluent Interfaces as the bridge towards Domain Specific Languages (DSL). Are DSLs a possibility in mainstream software development?

Kent wrote in a JavaRanch post that there is a transition from OO languages to DSLs (Domain Specific Languages). What a powerful statement! Is it true? What's the sticking power to Fluid Interfaces and DSLs?

The Object Oriented (OO) approach to programming caught on because it feels natural. We play with objects in life. We speak about them within the context of a domain. The customers speak from within their domain perspective. The easier the trip between the problem domain concepts and reflecting those concepts in code the better.

Who's presenting their API / functionality via a Fluent Interface? Thanks to Steve Asher, I now know JUnit has begun that journey. See http://junit.sourceforge.net/doc/ReleaseNotes4.4.html where the assertThat(...) example is given. JMock uses a fluid interface too. See http://jmock.org/expectations.html If you search for "new Expectations" twice you will see examples of a Fluid Interface in action. It is used also where I work at CARFAX. Again, I refer you to the Build Without Boundaries blog.

Similar to the time when people implemented Object Oriented concepts via languages like C and Ada, we will see people using Fluid Interfaces and other approaches with existing languages. The benefits are likely to outweigh most difficulties and challenges.

The next step for DSLs and Fluid Interfaces will be stronger support and perhaps new languages entirely. Will the fashion of Fluid Interfaces and DSLs hold? Time will tell.

Thursday, November 29, 2007

xUnit Patterns and the Mid-Missouri XP Meeting

The Mid-Missouri XP (Extreme Programming) group meeting last night was quite enjoyable. James Carr led the meeting. James Carr's great experience with test frameworks and Software Development in general really showed through in a positive light.

We dove right into Gerard Meszaros' XUnit Test Patterns site at http://xunitpatterns.com/ and specifically http://xunitpatterns.com/Test%20Double.html. We covered Test Stub, Test Spy, Mock Object, Fake Object, and much more.

I put forth the questions: What are the essential Test Patterns? Where is the UML Distilled version of Test Patterns? The answer was Fake Object and Test Stub will get you to where you want to be 95% of the time.

There was much discussion too. The people who attended had dived into various things and were just great people too. We swapped stories of experience and various technologies that we have explored. Since many people there used Java, one great example of a test framework that was mentioned is JMock.

(You can hook up with what the Mid-Missouri XP group is doing at http://tech.groups.yahoo.com/group/mid_mo_xp/ : In the group, there is a post about the meeting from James Carr )