October 13, 2011

Having taken some college courses on Psychology, the subject has always been interesting. Recently while reading Introducing NLP, I came across The Four Stages of Learning. This struck a chord when thinking about the challenges encountered with organizational Agile adoption.
The The Four Stages of Learning as described in the book are:
1. Unconscious Incompetence
2. Conscious Incompetence
3. Conscious Competence
4. Unconscious Competence
These stages are best described by the example of driving. From the book,
First there is unconscious incompetence. Not only do you not know how to do something, but you don’t know you don’t know. Never having driven a car for example, you have no idea what it is like.
So you start to learn. You very soon discover your limitations. You have some lessons and consciously attend to all the instruments, steer, coordinate the clutch, and watch the road. It demands all your attention, you are not yet competent, and you keep to the back streets. This is the stage of conscious incompetence when you grind the gears, oversteer, and give cyclists heart attacks. Although this stage is uncomfortable (especially for cyclists), it is the stage when you learn the most.
This leads you to the stage of conscious competence. You can drive the car, but it takes all your concentration. You have learned the skill, but you have not yet mastered it.
Lastly, and the goal of the endeavor, is unconscious competence. All those little patterns blend into one smooth unit of behavior. Then you can listen to the radio, enjoy the scenery and hold a conversation at the same time as driving. [...] If you practice something for long enough you will reach this fourth stage and form habits. [...] However, the habits may not be the most effective ones for the task. Our filters may have caused us to miss some important information en route to unconscious competence.
When you think about trying to get an organization to adopt a new process, this has to be considered. Each organizational member has already stepped through each stage of learning with the existing process and developed habits. They have the unconscious competence necessary to “get their job done” while “enjoying the scenery”.
By introducing a new tool, technique, or process into the organization, you are asking them to unlearn by going from stage 4 back to stage 2. Relearning is then moving from stage 2 back to stage 4 with more choices to create more efficient patterns. Obviously there is going to be resistance to this given the existing learning investment.
There must be strong motivation for someone to go back from stage 2 to stage 4 in the learning process. When you learned to drive a car, independence was your likely motivation. When learning to code you wanted a good-paying job (or maybe you really enjoyed it). The key point is that there is strong motivation to learn.
Convincing members of an organization to relearn their approach to developing software is even more challenging. It will certainly require more than just a good argument, you will need to motivate them and keep them motivated throughout the relearning process. Keep this in mind the next time you encounter resistance to your agile methods. It may help you be a bit more patient and willing to try alternative approaches when you understand their perspective.
Enjoyed this post? Share it! |
Posted in Agile
1 Comment »
October 2, 2011
jQuery Mobile presents a bit of a challenge when trying to keep your layouts DRY. In a general HTML document layout you have the head content, a header, a footer, and the page specific content. In other words, an HTML document is a single “page”. With jQuery Mobile you sometimes have several “pages” in a single HTML document for simplicity and/or performance reasons. Since each “page” often needs to follow the same layout, we need an approach to keep our UI code DRY.
Using the general Rails layout
Rails layouts assume the general HTML document structure. This works fine for an HTML document with a single jQuery Mobile “page”:
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<%= stylesheet_link_tag 'jquery-mobile-min', :media => 'screen' %>
<%= javascript_include_tag 'jquery' %>
<%= javascript_include_tag 'jquery.mobile.min' %>
</head>
<body>
<div id="<%= page_id %>" data-role="page">
<div data-role="header" class="main-header">
<%= image_tag 'solutionsfit-logo.png' %>
</div>
<div data-role="header" data-position="inline">
<%= yield :header %>
</div>
<% flash.each do |key, value| %>
<%= content_tag(:div, value, :class => "flash #{key}") %>
<% end %>
<div data-role="content">
<%= yield %>
</div>
<div data-role="footer">
<h4>© <%= Date.today.year %> solutionsfit</h4>
</div>
</div>
</body>
</html>
This works fine as long as you only have a single jQuery Mobile “page” in your HTML. Unfortunately, this is often not the case. When you want to include multiple jQuery Mobile “pages” in a single HTML document while keeping your layout DRY, you have to be a little more creative.
Using the CaptureHelper for multiple “pages”
Fortunately there is a solution using the CaptureHelper. From the Rails documentation:
CaptureHelper exposes methods to let you extract generated markup which can be used in other parts of a template or layout file.
This allows us to create a partial that describes our general “page” structure, shared/_page.html.erb:
<div id="<%= page_id %>" data-role="page">
<div data-role="header" class="main-header">
<%= image_tag 'solutionsfit-logo.png' %>
</div>
<div data-role="header" data-position="inline">
<%= header %>
</div>
<% flash.each do |key, value| %>
<%= content_tag(:div, value, :class => "flash #{key}") %>
<% end %>
<div data-role="content">
<%= content %>
</div>
<div data-role="footer">
<h4>© <%= Date.today.year %> solutionsfit</h4>
</div>
</div>
As you can see we define variables for header and content. To use the partial we simply use the capture method from the CaptureHelper:
<% @home_header = capture do %>
<h2>solutionsfit</h2>
<% end %>
<% @home_content = capture do %>
<p>Welcome to solutionsfit!</p>
<ul data-role="listview" data-inset="true">
<li><a href="#postings">Blog Postings</li>
</ul>
<% end %>
<%= render 'shared/page', :page_id => "home_page",
:header => @home_header, :content => @home_content %>
<% @blog_header = capture do %>
<h2>Blog Postings</h2>
<% end %>
<% @blog_content = capture do %>
<!-- Logic to list postings here -->
<% end %>
<%= render 'shared/page', :page_id => "postings",
:header => @blog_header, :content => @blog_content %>
Refactoring the general layout
Now that we have our partial defined, we can refactor our general layout to include just the basic HTML document structure:
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<%= stylesheet_link_tag 'jquery-mobile-min', :media => 'screen' %>
<%= javascript_include_tag 'jquery' %>
<%= javascript_include_tag 'jquery.mobile.min' %>
</head>
<body>
<%= yield %>
</body>
</html>
While it’s not as pretty as a general template, it allows us to DRY up our jQuery Mobile views. Another option is using a partial layout, but this has the disadvantage of requiring you to make both your header and content partials themselves. This tradeoff wasn’t worth the additional files in my case.
Enjoyed this post? Share it! |
Posted in Mobile, Rails, jQuery
No Comments »
September 28, 2011
This year I turned 30, one of those milestones in life. I would like to say it didn’t bother me, but… So I spent some time reflecting on the things I’ve always wanted to do and learn. Not knowing what you want in life is like going on a journey without a destination. How will you know what direction to take?

I had been interested in boxing since I was a kid, but being a skinny kid, I was afraid to try it out. I signed up with KO 101 Boxing. The first several classes were brutal. As a beginner I was in a class with a number of kids and they were running circles around me. A general 1.5 hour class includes running, jump rope, plyometrics, bag work, technique training, and abdominal exercises.
My biggest struggle was the jump rope. The coordination and stamina required to jump rope for 5 rounds was a challenge. The key thing you learn when jumping rope is to reduce the height of every jump. The higher you jump, the more energy you use. As you build coordination, you learn to barely clear the rope with each pass.
After a few classes, I bought a speed rope and began practicing. Classes are Monday and Wednesday night, so I would jump rope Tuesday, Thursday, and Saturday. After 4 weeks I could make it through all 5 rounds of jump rope without stopping. After 2 months I could work through the entire class without getting winded.
Learning boxing technique takes practice, but the snap on the bag as you throw a jab, cross, hook is rewarding. So if you want to get in shape and learn something new in the process, try boxing training. If nothing else, you can always say you now truly appreciate “Eye of the Tiger.”
Enjoyed this post? Share it! |
Posted in Personal
No Comments »
September 25, 2011
ActiveResource makes it easy to integrate Rails applications through RESTful services, but what if the resource is being produced by a Java application. JAX-RS is the best bet for writing these resources and with a few tricks we can get a service to conform to the requirements of an ActiveResource service. Read on to see that integrating your Rails and Java applications is easier than you think.
What ActiveResource expects
ActiveResource has several conventions it follows that make it easy to produce and consume RESTful services between Rails applications. The easiest way to communicate with ActiveResource is to follow these conventions. The following conventions are expected:
- The type of the attribute must be specified as an XML attribute (otherwise the type is String)
- Class names and attributes follow a dash convention for multiple words (e.g.
my_attribute would be my-attribute in XML)
- Resource paths follow the underscore convention for the class name and the class name should be pluralized (e.g. if we’re creating a resource for
MyResource the base path should be /path_to_services/my_resources)
JAX-RS provides the ability to customize XML marshalling by extending the XmlAdapter class. This class simply requires that you provide the logic to marshal and unmarshal your object in the required fashion. ActiveResource uses element attributes to specify type information.
For example, if we have a MyApp class with an integer representing the number of Rails clients. The XML expected by ActiveResource would be:
<my-app>
<id type="integer">5</id>
<name>My Cool App</name>
<rails-clients type="integer">1</rails-clients>
</my-app>
There are a couple of things to note here. ActiveResource follows a dash convention for class names and attributes that contain multiple words. The ActiveResource class would be as follows:
class MyApp < ActiveResource::Base
self.site = 'http://solutionsfit.com/services/
schema do
attribute 'id', :integer
attribute 'name', :string
attribute 'rails_clients', :integer
end
end
Notice also the use of the type="integer" attribute for the XML elements. This ensures that the id and rails_clients attributes are of boolean type. In addition, by convention, the path to this resource based on the self.site definition above would be: http://solutionsfit.com/services/my_apps.
Defining a JAX-RS XmlAdapter
To achieve this, we can create an XmlAdapter class in our Java application:
public class ActiveResourceIntegerAdapter
extends XmlAdapter {
@Override
public ActiveResourceInteger marshal(Integer i)
throws Exception {
return new ActiveResourceInteger(i);
}
@Override
public ActiveResourceInteger unmarshal(ActiveResourceInteger i)
throws Exception {
return i.getValue();
}
}
The next step is to define the ActiveResourceInteger class which specifies how the marshalling should occur:
public class ActiveResourceInteger {
private String type = "integer";
private Integer value;
public ActiveResourceInteger() {}
public ActiveResourceInteger(Integer value) {
this.value = value;
}
@XmlAttribute
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@XmlValue
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
}
Creating the JAX-RS Resource
Creating the JAX-RS resource is simple once we have defined our JAX-RS extension. First create the resource in the normal fashion:
@Path("/services/my_apps")
@Produces("application/xml")
public class MyAppResource {
@GET
@Path("/{myAppId}")
public MyApp getMyApp(@PathParam("myAppId") Integer myAppId) {
// retrieval logic for getting and returning MyApp instance
}
}
Notice that we follow another ActiveResource convention here by pluralizing my_apps in the @Path definition. Now let's look at the MyApp definition:
@XmlRootElement(name="my-app")
public class MyApp {
private Integer id;
private String name;
private Integer railsClients;
@XmlElement(name="id")
@XmlJavaTypeAdapter(ActiveResourceIntegerAdapter.class)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@XmlElement(name="rails-clients")
@XmlJavaTypeAdapter(ActiveResourceIntegerAdapter.class)
public Integer getRailsClients() {
return this.railsClients;
}
public void setRailsClients(Integer railsClients) {
this.railsClients = railsClients;
}
// ... ...
}
Here we simply add the @XmlJavaTypeAdapter annotation with our adapter class specified to the integer attributes. We also used the dash convention when specifying the root element name and the attribute names.
Now when your class is marshalled to XML it will follow the conventions required by ActiveResource ensuring that your attributes are named and typed as expected. These adapters can be created for each type to avoid the default String type for your ActiveResource class attributes.
Enjoyed this post? Share it! |
Posted in JAX-RS, Java, REST, Rails
No Comments »
September 23, 2011
Social awareness is a critical skill as a consultant. No, I’m not referring to the latest social networking technology, I’m talking about how well you navigate social interaction with others. It’s easy to fall into the habit of sitting at your desk all day long and coding. Coding is your job and hopefully you enjoy it, but coding can make us introverted (read anti-social). Humans interaction is much more complex than machine interaction. Subtle behavioral cues make up the lion share of how we communicate.
Humans instinctively provide these cues through body language, facial expressions, and tone of voice. Just imagine how many ways you can interpret the word hello. Just by changing body language, facial expressions, and tone of voice you can give a cheerful greeting, indicate surprise, or even belittle someone. A consultant must be skilled at reading these cues to be successful at selling ideas and maintaining positive client relationships, but social awareness requires practice. In this article we’ll discuss how you can make yourself more socially aware.
Socialize in the Office
It may sound cliché, but walk around the office during your breaks and take part in water cooler chat. Try to interact with people you’ve never met in the office. Open with them (i.e. initiate the conversation). If you are uncomfortable in social settings, prepare some conversation topics (e.g. simple things like the weather or a sports game). Pickup on their cues in the conversation. If they mention something that you are interested in (e.g. fitness, boxing), tell a story of your own about the topic. Try to relate to their experiences in a meaningful way. Not only does this help you build social skills, but it also increases your social network.
Pay Attention in Meetings
Not just to what others are saying, but pay attention to their behavioral cues and reactions. If there is someone who is very successful at driving meetings in his or her direction, you will likely notice that they are very adept at reading others. Learn from them and even ask for their advice. Those who are successful are often excited to share their thoughts with others.
Dress for Success
While being a coder often gives us the freedom to dress a little more casual than the rest of the business world, dressing well serves several purposes. First, it sets you apart from the coder crowd. While it may not be a fair stereotype, if you look more professional, others won’t see you as one of those “weird IT guys.” A professional look makes you more approachable. Second, looking nice can help to build your confidence (for more tips on building confidence see this previous post). If you need some style help, go to a fashionable business casual boutique and ask for help (e.g. Banana Republic). Once you have a good feel for your style you can shop less expensive stores.
Take up a Sport and/or a Social Cause
Sports and social causes are a great way to meet people and socialize. The great thing about these types of gatherings is the attitude of all those involved. In general, these people will be upbeat and in a great mood. This makes interaction much easier. In addition, opening becomes easier as you will be introduced to everyone when you start.
Work on your Emotional IQ
Be considerate of others and evaluate how your actions or words affect their emotions. The Wikipedia definition of emotional IQ:
a self-perceived ability to identify, assess, and control the emotions of oneself, of others, and of groups
Avoid being overly technical, be friendly, outgoing, and conscious of the feelings of others. This gets you far in the workplace.
Tips for Success
- Don’t be too much of a talker. Keep your conversations as short and to the point as possible. In general, people like a brief social interaction but long winded conversation keeps them away from their work and may cause them to think of you as boring.
- Conversation goes two ways. Give the other participant openings to add to the conversation. People generally like to talk about themselves and will have good feelings toward you if you are a good listener.
- Don’t get discouraged. Some people are not social (hey, you may be thinking you’re not social as you read this) or may be in a hurry. If someone cuts out of a conversation quickly, don’t take it personally.
- Beware of office gossip. Gossip is not a good conversation topic. If you are talking to someone who begins to gossip, try to exit the conversation gracefully. Those who gossip are very likely to gossip about you and what you said.
If you have other tips from experience that help to build social awareness, please post them in the comments.
Enjoyed this post? Share it! |
Posted in Agile
2 Comments »
September 22, 2011

This year I ran the WOKC Oktoberfest 5K in Addison, TX. The proceeds from the race go toward a great cause:
All proceeds benefit Wipe Out Kids’ Cancer (WOKC), a Dallas-based non-profit organization founded in 1980 dedicated to eradicating pediatric cancer by funding innovative research, education and treatment, while providing hope to children and families battling cancer
If you live in the Dallas area, this is a yearly event that I would highly recommend. The race includes competitive runners as well as those just interested in supporting the cause. Beyond the great cause, once you cross the finish line you find tables full of all the German beer and pepperoni pizza you can handle. What else would you expect for Oktoberfest? Well, maybe sausage instead of pizza, or at least sausage pizza.
The beer and pizza must have been motivating as I ran a decent 22:30 time. This was my first 5K to really attempt a competitive time and my goal is to run a sub-20 5K by the end of the year. I’m running a few more 5Ks in October so I’ll report back as I work toward my goal. Unfortunately, these don’t finish with endless beer, but I’m hoping I can still motivate myself.
Enjoyed this post? Share it! |
Posted in Personal
Comments Off
September 15, 2011
In a recent discussion with a colleague, we were pondering the idea of how a coder can become a consultant. When I say coder, I’m referring to someone who has become skilled at the craft of developing software. This is not a junior developer, but a developer who has the ability to solve complex software problems. When I say consultant, I mean a coder who has: confidence, social awareness, persuasiveness, and the ability to negotiate.
In more concrete terms, a consultant can code but also has the ability to sell ideas, elicit requirements, negotiate scope and cost, and maintain a positive client relationships. An initial step in this journey is building confidence. Specifically the confidence required to speak in front of groups. This article will focus on some steps you can take to help build this confidence and reduce your anxiety.
Study those with success
Anxiety-level: Low
Confidence boost: Low
A good first step is to study those who are successful consultants and try to learn from their actions and behavior. These can be colleagues or speakers at conferences. There are plenty of videos online of very skilled presenters (e.g. InfoQ is a great source). Pay attention to the way they interact with others, how they present to an audience, and how they carry themselves. You can use and practice their techniques when you follow the other steps outlined below.
Demo your code to end-users
Anxiety-level: Low
Confidence boost: Medium
A common agile practice at the close of an iteration or sprint is a demo. The demo is a time to be proud of your work as you show off your accomplishments. By walking through your code in front of the group, you can begin to overcome any fears of speaking in front of a group and positive comments from the end-users help to boost your confidence. Demos are an easy place to start speaking in front of groups thanks to their scripted nature. Your likely to feel more comfortable because you know exactly what you are going to say. If your team doesn’t follow this practice, recommend that they do.
Get involved in requirements gathering
Anxiety-level: Medium
Confidence boost: Medium
Perhaps you are already working with users to elicit requirements. Certainly direct communication is preferable between developers and end-users to gather requirements as this ensures a common understanding of the end goal. In addition, it helps you as a developer to become more skilled in social interaction as you work to gather the information necessary to implement a solution. Communicating with end-users requires the ability to build rapport and communicate effectively. The next time your team is gathering requirements for an iteration or sprint, speak up and be an active participant.
Present to your team
Anxiety-level: Medium
Confidence boost: High
Recommend that your team hold lunch-time or after hours learning sessions and volunteer to be the first speaker. Not only is this a way to build knowledge among your team and show yourself as a leader, but it will help polish your skills in speaking in front of a group. Make sure to take questions from the group and try to elicit conversation. Being comfortable and confident with thinking on your feet is a critical skill that requires practice to do it well. Practicing this skill in a comfortable setting in front of your colleagues will help to reduce anxiety.
Present to your local user group or at a conference
Anxiety-level: High
Confidence boost: High
Once you feel comfortable in front of a group, you can take it to the next level by finding a good topic and presenting at a local user group or conference. Speaking in front of a large group of strangers can initally be a nerve-racking experience but accomplishing this feet will greatly boost your confidence.
Tips for Success
- Never focus on mistakes. If you make a mistake, simply move on or you can even joke about it. Joking about mistakes often makes a group like you even more as it shows humility.
- Be prepared. The Boy Scout motto is actually very useful for reducing anxiety. You will always feel better if you are very knowledgeable about the subject matter you are presenting on or if you prepared questions for end-users ahead of time.
- Find a mentor. A mentor can provide useful tips for improvement by observing you and providing guidance along the way. A mentor often has plenty of insight from personal experience that he or she can instill in you.
If you have other tips from experience that help to build confidence, please post them in the comments.
Enjoyed this post? Share it! |
Posted in Agile
3 Comments »
August 15, 2011
Thanks to all who attended my presentation on Saturday at Dallas Techfest. As promised you can find the slides and source code at the links below:
Presentation Slides
Source Code
Enjoyed this post? Share it! |
Posted in Uncategorized
2 Comments »
July 30, 2010
Thanks to all who attended my Enterprise Mashups with RESTful Web Services and jQuery presentation at Dallas Techfest. The following links provide access to all presentation materials:
Presentation Slides
Live Example
Download Example Zip
Enjoyed this post? Share it! |
Posted in REST, jQuery
No Comments »
May 11, 2010
JBoss just published a white paper that describes how Seam enables rapid development of RIAs by eliminating technology hurdles and placing developer focus back on solving business problems. Specific enterprise use cases demonstrate how increasingly complex features can rapidly be introduced into a software product with Seam in an iterative fashion.
The white paper is written in a way that avoids a technical deep-dive so that regardless of technical expertise, the value of Seam can be well understood. This allows not only developers but also management understand why JBoss Seam is the right framework for an organization’s next agile RIA development project. I authored the paper in collaboration with my colleague Nirav Assar.
Enjoyed this post? Share it! |
Posted in Agile, JBoss Seam
1 Comment »
Comments
October 13, 2011
The most difficult and the most dangerous state is this. Unconcious Incompetence...
September 23, 2011
Yes, exactly. Thanks for the insightful comment.
September 23, 2011
These are great points. I think what you are getting at here is being a social...
September 15, 2011
Thanks for the great tips!!!
September 15, 2011
Definitely a good point on “dress for success.” This is going to...