Thursday, January 22, 2009

Don't Click, SlickRun!



I recently discovered the Windows utility SlickRun, thanks to a comment from Jim Holmes in this blog entry from Jeff Blankenburg. I have to say that I absolutely love this utility and at this point can't imagine work without it! It has saved me numerous mouse-clicks and tedious search and navigation through Windows menus. If you are unfamiliar with this utility it basically allows you to start almost any application or file on your computer with just a few strokes on your keyboard. For example if I type "[W]-q memlogin" it opens up my IDE (unfortunately BEA Workshop) with the Membership-Login project that I am currently working on. Or if I type "[W]-q wls" it starts my WebLogic Server instance. Or if I type "[W]-q wikip la lakers" it will fire up my default web browser and take me to the Wikipedia entry for The Los Angeles Lakers (where "la lakers" is a dynamic search term). The words "memlogin", "wls" and "wikip" are keywords (SlickRun calls them MagicWords) that I have configured to fire up stuff that I care about. I can type those directly into the SlickRun prompt (see image at the top of this blog entry) which can be placed anywhere on your screen. I have mine auto-hide and then use the "[W]-q" key sequence to bring the SlickRun program into focus ([W] being the Windows Key on my keyboard).
I spent some time creating keywords for pretty much anything I use at work. Here are some of things I have set up:

  • Keyword for every Java project I have worked on at my current client.

  • Keyword for each Wiki page I maintain at my current client

  • Keyword for each website I frequent. Using the "$W$" marker to plug search parameters into URLs that have query strings.

  • Keyword for each application I regularly use (MS Office apps, FireFox, XMLSpy, Cygwin, WinMerge, NoteTab, Toad, Putty, SoapUI, JMeter, Eclipse, etc.)

  • Keywords for folders I frequently need to access on my computer (My Documents, c:\user_projects, etc). The keywords will open up the appropriate folder in Windows Explorer.

  • Keywords for my most frequently used Windows operations. For example to go to standby, to shutdown, to put on the screen saver, or to open up the display configuration (which my docking station keeps getting messed up).


If you are tired of mouse-clicks and menu navigation I suggest you give this tool a try. It just might make your workday a little more productive. It can't hurt to give it a try, it is free! Be forewarned though that the product could be a little more polished, especially their setup screen which did some funny things for me, but once you get it all set up it does work very well.

Saturday, January 10, 2009

CodeMash 2009

I just got back from CodeMash 2009. This is my third year going there and it keeps getting bigger and better. The quality of speakers is high and so is the quality of attendees. It seemed like no matter who you sat next to at breakfast, lunch or dinner they all had something interesting to say and a wealth of experience to share. Having my family there with me was the icing on the cake. They played in the water park or did some of the Kalahari activities during they day, while I was getting my techie fix and then I joined up with them in the evenings for some fun in the wave pool or a stroll down the lazy river. Hats off to the organizers of this conference. For those of you not familiar with CodeMash, it covers a broad spectrum of programming languages and technologies, and its 'focus' is essentially to diversify. That is, get you out of your comfort zone and learn about what is happening in other tech communities. This year they had sessions covering in one form or another Ruby, Scala, Erlang, C#, F#, Objective-C, Java, Groovy, Python, ActiveScript and PHP! On top of that they had various sessions on improving software development, including sessions on Agile, Lean software development, value stream mapping and Kanban. I highly recommend this conference to any developer. For the low registration fee it is a steal.







Below is a sprint through the sessions I attended this year.

Day 0 - PreCompiler

Groovy and Grails 101 w. Chris Judd and Jim Shingler

This was a good overview session on Groovy and Grails. Groovy in the morning, Grails in the afternoon. Chris did a good job of explaining all the things that suck about Java, by showing a Java class and then piece by piece groovy-tizing it down to less than half of its original size. The last lab of the morning involved writing code to read an RSS feed and write the ids and title of all blog postings to a relational database, then pull it back from the db and spit out as an XML document. We did this in about 40 min, and I have to say that even with all my Java experience I doubt that I would have been able to pull the same off with Java in that amount of time. Reading from an http url, extracting info from an XML document, writing to a database, reading from a database and creating an XML document was all very easy in Groovy and required very few lines of code. Here is the code that did it:

import groovy.sql.Sql


//Read the RSS feed
def feed = new URL("http://stanjonsson.blogspot.com/feeds/posts/default").text


//Create a database instance
def sql = Sql.newInstance(/jdbc:derby:C:\temp\blogs;create=true/, "APP",
"APP", "org.apache.derby.jdbc.EmbeddedDriver")


//Delete table if previously created
try {
sql.execute("drop table blogs")
} catch(Exception e){}


//Create table
sql.execute('''create table blogs (
id varchar(200) not null primary key,
title varchar(500)
)''')


//Parse XML and populate the table
def blogs = sql.dataSet("blogs")
feed = new XmlSlurper().parseText(feed)
feed.entry.each {entry ->
blogs.add( id: entry.id.text(), title: entry.title.text() )
}


//Read from table and create Xml
def writer = new StringWriter()
def builder = new groovy.xml.MarkupBuilder(writer)
builder.setDoubleQuotes(true)
builder.feedlist {
sql.eachRow("select * from blogs") { row ->
feedentry(id:row.id) {
title row.title
}
}
}


//Print out XML, and voilà, done!
println writer.toString()

Pretty easy heh? No try-catch blocks, no headaches around setting up and closing database resources, no InputStreams, no importing an external XML parser. And the code even creates the database and table on the fly!!

For those curious the output from running the above is:

<feedlist>
<feedentry id="tag:blogger.com,1999:blog-2241013152284479770.post-720388331940374029">
<title>No Fluff Just Stuff 2008</title>
</feedentry>
<feedentry id="tag:blogger.com,1999:blog-2241013152284479770.post-1855527957885191012">
<title>Career 2.0</title>
</feedentry>
</feedlist>

Which, hehum, proves that I really need to be more active in my blogging.

During the afternoon session we went over the Grails framework, which is highly reminiscent of Rails. Jim showed us how to quickly put together a web site by defining a couple of domain objects and having Grails do its magic by generating the persintance layer and database tables and a nifty front end for CRUD operations on the domain objects. It looked really nice, but started loosing some of its charm once he started mocking with the view GSPs and we came to realize it effectively made any further auto-generation from the domain objects impossible (or you would overwrite your changes). So the lesson learned is to put detailed thought into designing your domain objects up front and save your self some work by having Grails auto-generate your views, controllers and persistence layer (via GORM, a Groovy object relational mapping implementation on top of Hibernate). But know that once you have put some work into customizing your application any changes to your domain objects means you will need to edit your views, controllers and database mappings by hand.

Here are the slides from the PreCompiler.

Day 1

Introducing iPhone SDK - Chris Adamson

This was a session had been looking forward to a lot. I have been a trusty iPhone 3G owner since it was released last July (I even stood in line before stores opened the day it was released!) and have been eyeing getting into iPhone development. The session provided a good overview of what it takes to get into iPhone development and walked through the implementation of a simple application. Unfortunately the starting cost is somewhat high; get a Mac, learn Objective-C, pay for a development license, deal with Apple's registration process, write your app and wait for up to month to get it approved. Objective-C is a Smalltalk inspired C like language dating back to 1986. I must admit that manual memory management and pointers aren't exactly things I have missed for the past 10 years or so. So delving into Objective-C is something I'd do with some hesitation. Actually, Chris Judd's iPhone with Grails presentation on Day 2 got me thinking I might start by doing an iPhone web application rather than native application.

Slides from the presentation.

Three tips to improve your dev process - Jim Holmes

Former Quick Solutions colleague Jim Holmes had an interesting talk on things we can do to improve our software development processes. He discussed the importance of daily standups and retrospectives, and provided tips to improve estimation. The session was mainly memorable for the somewhat heated discussion that materialized between Jim and a few of his audience members, headed by Mary Poppendieck, who as Jim put it "lead him out on a branch and then proceeded to saw it off".

Slides to be posted at FrazzledDad.com.

Erlang: The Basics - Kevin Smith

Very interesting session and by far the one that made my eyes spin the most. As Kevin put it "Erlang Is Weird". If you can not imagine life without for-loops, while-loops or strings, then Erlang is not for you! I enjoyed getting familiar with the language, but to be honest, don't see myself as a hard core Erlang fanboy anytime soon. But due Erlang's strength in dealing with concurrency I imagine the language will continue to prosper in a world where 256 core CPUs will soon be a reality.
Since there are no loops in Erlang, recursion is the name of the game. Here is a simple Erlang code to print out the contents of a list:

print([H|T]) ->
io:format(“~p~n”, [H]),
print(T);


print([]) ->
ok.

I found it interesting that the language has three (!) line terminators (, ; and .), when most of the new generation languages (Ruby, Python, Groovy, Scala, etc.) have gone the route of dropping terminators.

Slides here.

iPhone development with Grails - Chris Judd

Another session I was looking forward to. Chris walked us through the pros and cons of doing native vs. web application development for the iPhone. The pros of native development being:

  • Access to native features like GPS, accelerometer and camera.

  • Offline access.

  • Performance.

  • The glamour and marketing associated with having your app in the AppStore.


The pros of web app development being:

  • Don't have to learn Objective-C. You can develop with whatever technology you are most comfortable with.

  • Deployment under your control.

  • Don't have to get a development license.

  • Don't have to bury yourself in a mountain of legal agreements.

  • The process is on your timeline and not Apple's


Chris then walked us through developing an iPhone web application using Grails with a custom iPhone plugin that he wrote for the iUI JavaScript framework, which allows you to customize the look and feel of your web app to rival that of a native application.

I have been brewing an idea for an application that I would like to write for my phone. Since the benefits of writing it as a native application are limited and clients will require access to a centralized database, I am making it my mission to write it as a Grails web app in 2009. I even went ahead and registered the domain goodweatherlocator.com just now, which should give you some idea about what I am planning to build.

Slides from the session here.

Sexier Software With Flex - James Ward

This was an overview session on how to build applications using Flex. It showed some pretty sexy Flex applications and then walked us through the creation of a basic Flex app using MXML and ActionScript.

I have never been very interested in RIA development, but figured I would at least dip my toe in the pool.

If you are unfamiliar with Flex, check out the tour at http://flex.org/tour.


Day 2


Practices of an Agile Developer - Venkat Subramaniam

As in his keynote a day earlier Venkat was excellent in this no frills Agile session. He provided many good tips on how to get into Agile and how to practice Agile software development, along with some gold nuggets on how to improve yourself as a software developer:

  • The most important thing in adopting Agile is attitude.

  • Criticize ideas, not people. Take pride in arriving at a solution rather than proving whose idea was best.

  • Learn everything about something and something about everything.

  • It is very hard to learn if don't learn continuously. It is incredibly easy if you do it all the time.

  • Spend 30 min a day reading something unrelated to your current job.

  • Present details and let your customers decide. Developers, managers or business analysts shouldn't make business critical decision - let the business owners make those.

  • Run your unit tests on all platforms you plan to support.

  • Use standup meetings to keep the team on the same page.


No slides, but Practices of an Agile Developer by Venkat and Andy Hunt a recommended reading. A colleague of mine won a copy of it at the closing ceremony and from my 5 min of browsing through it looked very promising.

Cool Stuff With computer Vision - Scott Preston

Scott showed us his robot Feynman and how he sees the world. Apparently robots are really into Jessica Alba because much of the presentation focused on a beach photo of her, seen through various image filters. When he showed us how his bot can discover and zoom in on her breasts, I noticed the lone female in the room moved uncomfortably in her seat.

All in all this was an entertaining session that gets a 10 on the geek scale.

Slides and photos of Jessica's top here.

Spring 3.0 MVC - Ken Sipe

A nice overview of Spring MVC (mainly 2.5 features) and all the benefits it provides over older MVC frameworks like Struts. Takes "convention over configuration" to the max and greatly reduces the amount of Java code needed for a typical Web application. Or as Ken put it, "The next best thing to Grails"!

Slides to be posted here.

Cloud Computing with .Net - Wesley Faler

The last session of the conference. I figured I couldn't go home without seeing at least one .Net related presentation. Wes walked us through the Cloud Computing concept and how it differs from web farms, grids and clusters. The nuts and bolts of it is essentially computing resources on demand. He got me all excited when describing Amazon's EC2 service and the fact that you can use it with numerous different programming languages. But once he gave us some samples of the pricing, my excitement withered away.

Fancy slides here.

This wraps up my CodeMash 2009 experience. As in previous years I had a lot of fun and will definitely be looking to coming back again. From what I've heard CodeMash 2010 will be even bigger and better.

Sunday, July 27, 2008

No Fluff Just Stuff 2008

I just finished attending the 2008 No Fluff Just Stuff conference in Columbus, Ohio. It was a lot of fun, had some informative sessions and as expected these days some pointless fights over language syntax. Here are highlights from some of the sessions I attended.




10 Things an Architect should know
Speaker: Richard Monson-Heafel

This session was a good eye opener for getting your head out of the sand. A one-liner summary would translate to something like: Stop wasting time arguing about implementation details and start focusing on customer needs!
Below is some paraphrasing of the top 6 noteworthy things I got out of Richard's top 10 list.


People are the Platform

User interface is the most important part of your system. The point of IT is to make people more productive not to write beautiful systems. What happens underneath the hood is really not that important, as long as it works. A great UI on top of ugly middleware is much better than bad UI on top of pretty middleware.

All Solutions are Obsolete

When picking technology, pick what works best today, don’t try to predict the future.
For example a couple of years ago a lot of people banked on JSF becoming tomorrows golden standard, and are now suffering (to some extent). You can’t really predict what is going to be the popular in the future. Just pick what works best today and stop worrying about future proofing your system. There is no such thing as future proofing... it is a myth.

Data is forever, everything else can change

IT architecture keeps changing, but the data (often) lasts forever.
With that in mind Richard promoted the use of relational databases, as opposed to object databases or XML databases, which are tied to a specific technology. Likewise Richard took some shots at Rails & Grails, for probably getting things wrong in the long run. Basically stating that we should not have systems be generating our databases. We should build the database first to meet the company needs and then the systems on top of the databases. 5 years from now the database might still be there but everything else has changed.
I can agree with this to some extent, as I have had some bad experiences in the past working with tools that try to autogenerate a database based on some higher level entity. Usually what gets generated is somewhat of a mess and not easily reusable by other systems at a later time. On the flipside though, the productivity gains of newer development frameworks make them hard pass on. We just need to be mindful of taming them to some extent to generate maintainable databases.

Flexibility Breeds Complexity

Simplicity can create flexibility, but flexibility will always create complexity.
When designing a system always err towards simplicity.
Building a simple system and adding features to it later probably costs you less in the long run than building a super flexible system upfront to handle all possible future changes.

Know The Business

As a software architect you are in the tough position of having to be an expert on all things related to the technology of the company, but just as importantly you need to know and understand the business of the company you work for. You need to know the business as well as the business people! Remember, it is your job to make the business people more productive. If you don't understand what they do, then how can you help them?

Software Architects Should also be Coders

Get out of your ivory tower and into the trenches. Bits talk, Bulshit walks.
Every architect should spend at least 10% of their time doing code reviews with the engineers building their product. That’s how you see what is working well and what is giving people headache. Pull up a chair and sit next to a developer for an hour. In addition to getting a better feel for what the developer is dealing with you'll be surprised at how hard he/she will work during that hour! :)


So You Have Been Promoted to Tech Lead. What do you Do.

Speaker: Mark Johnson

This session brought up some useful points for us Tech Leads to think about.
A few of them were:
  • Requirements Acceptance Criteria
    • 66% of requirements have no business value
    • When you are on a project that gets flooded with new requirements, try to put each one of through the following pick list:

      Any requirement that ends up in the "Kill" category you should bring back to the business (or product owner) and explain your case for getting that requirement dropped. On the flip side be more open to requirements that have high business value but low complexity, risk and cost. If you can get some of those in, in favor of throwing out a couple of "killers" you might make your project more likely to succeed, even though business people keep wanting to change things on you. Also, don't just automatically say no to every new request (over defend you project). Evaluate it via the above pick list and try to work out what is in the best interest of everyone involved.
  • Delegate
    (This might have been the hardest thing for me to learn when I stared doing tech lead work)
    • Stop playing superman! Don't assign all the hardest tasks to yourself. You won't have time to implement them properly. Trust your developers and they will usually reward you.
    • Don't go to every meeting! In most meetings nothing noteworthy happens. Delegate attending some meetings to your teammates.
  • Once you come up with a plan, share it with everyone
    • Make sure you have peoples buy in to what you are planning to do. If you run into trouble later people will be much more willing to help you out if you included them from the beginning.

Getting Started with BPEL

Speaker: Mark Johnson


I have to admit that this session sent a few gusts of cold shivers down my spine. I did not know much about BPEL and was kind of curious to see what the fuss was about. After doing some preaching about BPEL being XML driven and one of its design goals being "Not to define a graphical representation of processes", a few slides into the presentation Mark brought up the NetBeans BPEL IDE. To my shock I found myself staring at something that looked an awful lot like a WLI JPD (WebLogic Integaration Java Process Definition)! It tied together several web services in an elegant looking flow diagram, with forks and splits and what have you. Even some visual transformations of data from one web service passed to another. Now, for anyone not familiar with the JPD technology, it tries to do pretty much the same thing, basically tie together multiple service calls and transformations in a nice looking flow diagram. On the surface it sounds great, but my actual experience in dealing with the JPD technology has brought about multiple frustrations:
  • The flow through your JPD is written in a custom XML language which ties back to autogenerated Java code that programmers are discouraged to change
  • It breaks many key OO concepts such as
    • No encapsulation (everything that holds data is a public global variable in the JPD class),
    • No inheritance. Two JPDs for similar services are pretty much a copy-paste of eachother.
    • One business method per JPD. There is only one entry point into your typical JPD.
  • Some of the JPD UI language concepts don't work as expected
    • For example the JPD Parallel node, which is meant to call multiple services in parallel and then wait for all to finish before proceeding onto the next node in your flow. After some hair pulling I discovered that actually doing things in sequence rather than parallel resulted in much faster code! The parallel node ends up spawning a new thread for each service call, which can be very taxing on your app server resources.
  • When writing JPDs, a lot of time is spent trying to figure out how to get something working, as opposite to focusing on writing business logic.
  • You never really know what is going on underneath the hood.
    • WebLogic claims that you don't need to know anything about how the JPDs are implemented. But in actuality you will run into problems that require you to understand what is really going on when your JPD is being executed (like with the parallel processing nodes) . Over time you will come to realize that underneath all the glory you have a ton of autogenerated EJBs and JMS messages hard at work, but little documentation on what is really taking place.
  • Most JPDs are hard to read, even for developers!
    • The idea of JPD being a great tool for you to communicate your process to business people was not my experience during the couple of years I used the technology. Most of our JPDs ended up being complicated and convoluted, and we found ourselves using sequence diagrams as a more useful tool to communicate design to our business analysts. Over time we learned to simplify our JPDs, but even so I never saw them being used much when communicating with the business.
Now I am not saying that BPEL necessarily suffers from the above problems. It might have an awesome implementation and myriad documentation. I have no idea. But when I asked Mark point blank if his developers enjoyed developing in BPEL and whether they had any complaints, and he ended up admitting that most of them preferred pure Java, I got my answer.

At the end of the day I decided to apply a duck typing analogy on BPEL. If it acts like a JPD and quacks like a JPD, then it must be a JPD! :-) I hope I will not have to deal with this technology in the future.

Friday, July 25, 2008

Career 2.0

I just attended Jared Richardson's Career 2.0: Take Control of Your Life keynote at the 2008 Columbus No Fluff Just Stuff conference. One of his key points was, to take your carrier to the next level, you need to blog! Guess what, I drank the Kool-Aid, and I am blogging. Yay!

Thursday, July 24, 2008