Tuesday, April 27, 2010

Centric I/O

Yesterday was the first Centric I/O camp. It started for me around 7 am and finished round 9pm. It was a great day with 3 talks from Neal Ford. I really enjoyed his first talk and the style used. He was speaking on "The Language Renaissance, and Why It Matters". The next talk on DSL was not as interesting for me but the evening talk on Evolutionary Enterprise Architecture using Web Technologies was great even if my brain was about to shut down.


I am going to start a wave on the evolutionary enterprise architecture. There is a book coming out by one of Neal's colleagues.

Talking with the other technologist from Centric was also refreshing. I hope others got as much as I did out of it.

Wednesday, April 21, 2010

Thoughts on GWTQuery

Okay I have been working on a GWT application for awhile now. The other day I came across the need to have some effects in the application. Knowing about the JQuery effects and how great the JQuery library was I decided to see if the GWTQuery library (98% rewrite of JQuery in GWT) had what I needed. After about an hour I realized that the project was not being updated that frequent, the documentation was out of date and I found a post stating they thought the project may be dead.

I first heard of the project last year watching the Google I/O session videos. I have emailed Ray and not recieved a response on the status of this project. For my own sanity I decided to use JSNI and JQuery. After all, the few things I wanted to do was not going to be that slow and I can easily keep the JQuery dependency isolated.

Summary:

I hope we hear more about the GWTQuery project and I hope that Ray keeps contributing to it. For now though I am going be using JQuery and JSNI.

Building a Twitter style TextArea using GWT



When using twitter the client can only place a 140 characters in the box. There is a nice big GREY label above the box that shows the user how many characters are left. I have been playing with GWT for awhile now and decided that building that control wouldn't be too hard. Turns out it isn't but I hit a few bumps along the way.

The main gist of it is that you have to be careful how you calculate it. I was trying to keep a running count of how many times a key was pressed. The only problem is there are a lot of key codes to recongnize and the character codes can differ, it seems, across browsers. Just when I was in despair about the struggles creating this control it hit me that there is a much easier way. The only thing that needs to be taken into consideration is when the event on the control gets fired.

The solution is to take the length of the text in the TextArea and subtract it from the desired limit.

counter =140 - length

For this to work though the event needs to occur after the TextArea is updated. So keep track and update the counter using the KeyUpEvent in GWT.




int counter = 240

TextArea post = new TextArea();

post.addKeyUpHandler(new KeyUpHandler() {

public void onKeyUp(KeyUpEvent event) {
int postLength = post.getText().length();
counter = 140 - postLength;

submit.setEnabled( (counter<140) );

if( submit.isEnabled() ){
submit.removeStyleDependentName("disabled");
}else{
submit.addStyleDependentName("disabled");
}


count.setText( counter + "" );
}

});




One additional problem is how to keep the counter from going negative by allowing the user to type in too many characters. The solution is to create a KeyDownEvent handler that will check the current counter and make sure it is not less then 1 before allowing the Key event to propagate. Once the text content length reaches 140 then the event will need to be prevented.


post.addKeyDownHandler(new KeyDownHandler() {

public void onKeyDown(KeyDownEvent event) {
if( counter<1 ){
event.preventDefault();
event.stopPropagation();
}
}
});

Wednesday, April 7, 2010

Agile Project Documentation

Recently I had to summarize several weeks worth of work and hand sketches into something that is presentable to the client. The first thought is to throw together some screen shots of the application and put that in a document and send it off. The problem with that approach is that there has been a lot of thought on much more then screen shots. Thought has been given to the platform that this could be deployed to, the method for scaling the product, the ability to test the product, day to day management of the product, as well as over all coding.Thought has been given to how the system should be extendable by using interfaces in key points so alternative implementations can be created in the future. The interaction of the software components and the packaging of the software has also been under consideration.

I always have trouble writing this type of document. It takes me longer then I would like and I never feel like the flow and content are up to parr. This time I have spent sometime reflecting on the paper. The paper itself turned out to be around 30 pages long and contained the screen shot section, an architecture section, and a very small sample of what a "Getting Started" page might look like.

I think the problem with my approach is although I preach Agile for software development I never really think of anything else in bite size chunks. For example there has been several times over the last month that I had a clear picture in my mind of how to explain a part of the system. Instead of sitting down and creating a content snippet right then I let the thought evaporate. Unfortunately when I sit down to document the system and all the design the thoughts do not come back into mind so easily. In fact while some of the content comes to mind quickly most of it I am grasping for. That makes one tired.

I am looking into creating Agile documents. Documents with low amount of ceremony so I can keep the personal attachment down. I don't want to create a classic piece of literature i just want to explain the technical merits of a system. I realize to do that I need to improve on my writing abilities.

I have a though about using Google Wave as a snippet holder for both pictures and text. As thoughts come to mind I can create a new entry on the wave. By using a Wave BOT maybe I can have the snippets published to a WIKI or just as a PDF or something... Don't know yet. That is where my thought on this stops.

So why not just use a text editor or any other tool for recording snippets and then use some shell script to publish. That might be a solution tool. Currently I like using Wave because several people can collaborate on the content and it is simple to edit content on a Wave. To me the Wave environment makes since for creating Agile documentation.

The one area that I also need to think about is structure of the content. I would like to have a simple straight forward structure that I use over and over. I know there are thousands of design documents out there but I haven't seen a lot of standardization.

I am looking at a book with the title Agile Software Documentation

Monday, April 5, 2010

At the Library

Okay, I am at the library with my nephew working on finishing up some documentation. Today is the first day of blogging with an accountability partner. A colleague at work gave me the idea of being accountable to get each other into a pattern of blogging. New habits can be hard to form but repetition will create a habit. So here is first day of accountability blogging.

Marc are you blogging? Marc's blog link will go here when I find out what it is. No more time for now.


I have it now: Marc Johson

We are keeping an eye Marc's blog for his first post. Very excited!!

By the way we hope to be doing a podcast with Marc at the end of May. We will be interviewing him on the creation of his company Today Forward.

Sunday, April 4, 2010

Trip to Jackson

So this weekend I had to run with my father-in-law to Jackson TN, just about 2 hours south west of Nashville, to pick up the kids. My father-in-law drove so I spent the time reading and looking through my Kata pile of stickies formerly hanging on the wall. I have categorized my Kata's into piles dealing with basic operations, build operations, and general maitenance operations.

The one Kata that I think I have perfected is "Take a Note". I was also working on make a blog entry and I got mired down in TextMate, Apple Script, and Quicksilver. I think I may take a break from working directly on Kata's and just spend some time researching Quicksilver plugins.