The amazing adventures of Doug Hughes

Archive for May, 2009

Cf.Objective() – Musings From a First Timer

Last week I found myself at the annual cf.Objective() conference in Minneapolis, MN. Being that this was my first time to attend a conference like this, I was unsure what to expect or what the experience would mean to me in the end.

Upon arriving at the Hyatt Regency (lovely hotel by the way), I immediately noticed there were several developer types sitting around in the lobby. At this point it also occurred to me that some of my Alagad compatriots might be two feet from me and I wouldn’t know it. I had never met any of them in person except for my long time friend Jeff Chastain. As it turned out, one of them was an Alagad guy. How was I to know Jared is a big, burly, biker type? Let’s just say his Facebook picture must be old. Very old. This same process continued in a nice “for.each” loop until I had met each of the guys with one notable exception. I think I would have recognized Doug Hughes without any help at all. I’m not sure why, I just would have.

On Thursday morning we went to the Key Note presentation by Adobe. It was well delivered and quite informative. Talking mainly about products we, apparently, are not to mention, so I won’t. I did find it oddly humorous that the Adobe guys were somewhat surprised that the new features added for code development got such loud applause of approval. Who did they think was in the audience? Let the presentation parade begin!

You know, it’s really hard to decide on which presentations to attend. On more than one occasion I found myself thinking I should go to this one and that one. Crap, they are at the same time! As I understand it, in previous years Saturday has been reserved for repeat performances. I know I would have really appreciated that being the case this year as well. The diversity of the presentations was refreshing. I sat in on everything from “Indiana Jones and the Server of Doom (thank you, Mr Brunt) to Mark Esher’s “Writing Testable Code”. Without exception I found each of the presentations informative and engaging. I suppose that’s why I was there in the first place.

As we all know, conferences are not just for learning. Fun is an integral part of the whole experience. Thursday night proved to be the fun part. All of Alagad and many others went to Fogo de Chao for dinner. I’m relatively sure that by the time we left they were completely out of meat. In our group, Chris Petersen was the winner. Honestly, the man ate at least three and a half pounds of some of the best meats I’ve had in long time. After dinner the same group of convention goers all met at the Minneapolis Zoo for an IMAX presentation of Star Trek.

A very special word of thanks to Doug, our fearless leader, for making all of this possible. We all had a terrific time and as a team building exercise, it scored very highly.

You know they say in software development there is no clear cut way to get from point A to point B. Judging from the wide diversity of opinions in the presentations, that rule certainly applies in our section of the industry. Whether it was listening to Dan Wilson singing the praises of Model Glue 3 and how it handles scaffolding or Peter Bell talking about rapid OO development and how scaffolding is useless. Each presenter had his own way of doing what they do.

I realize that there are many different solutions to a particular problem set but sometimes it be can overwhelming to hear one and think you might use it in the future only to go to the next presentation and find yourself liking that solution better than the one before. Fortunately I have friends like Jeff Chastain, Scott Stroz, and Simeon Bateman to offer their views. Of course it would also be nice if they could agree. Sometimes. Just kidding.

Upon leaving the conference I was struck by the fact that I had just been in the presence of the best-of-the-best our industry has to offer. Whether it was Mark Drew or Doug Hughes or Sean Corfield or Peter Bell (forgive me if you think you should have been included in this list), these guys are the movers, shakers and shapers of our industry. I found myself a little awestruck at times even though everyone I met was accessible, friendly and ,most importantly, willing to share what they know. It’s an interesting trait in our little corner of the world, people are willing to teach you what they know. You don’t usually find that in the hyper-competitive world we live in. I, for one, sincerely appreciate it.

I have been a ColdFusion developer since version 1.5. I have learned more in the past year from guys like these than I had in the previous ten years. With people in our industry like these I have no doubt that our little corner of the world will continue to grow and prosper. Jared, cf.Objective() was a resounding success for myself and for the many people I talked to. Thank you for all of the effort you put into it. I hope to see you there next year.

Throwing Down the Guantlet

Unless you live in a cave, you know that in the last few days another Object Oriented (OO) vs. procedural debate has flared up. I thought this would be a great opportunity to discuss an attitude I have seen from some developers that mirrors the attitude I saw in quite a few people in my previous career.

For those who do not know, before becoming a developer, I spent 14 years as a paramedic. One similarity I have noticed between my former and current careers is that you can never know enough. There is always something new you can learn to make you better at your job. Another similarity is that if you ever stop learning, well, then the job has passed you by.

I found that the best medics are the ones who would critique a call when it was done and try to find where they could have performed better and work on improving those skills. I would like to think I was one of those medics. Regardless of the outcome of the call, I always found at least one area where I did not preform as well as I may have wanted. Its easy to look at the patient outcome as the sole indicator of how the call went, but rarely was that a true portrayal of how the call went.

I have also found that the best developers are the ones who critique a project when it was done and try to find where they could have performed better and work on improving those skills. I would like to think I am one of those developers. Regardless of the outcome of the project, I always found at least one area where I did not preform as well as I may have wanted. Its easy to look at the project outcome as the sole indicator of how the project went, but rarely is that a true portrayal of how the project went.

When I was medic, I always wanted to learn more. I always wanted to do what I could to become a better medic. As a developer, I always want to learn more. I always want to do what I can to become a better developer.

For me, becoming a better developer means learning new ways to solve problems. Whether this was from learning (or continuing to learn) OO, learning how to use frameworks or even new technologies (such as Flex) I gained new tools I could use to solve problems. Sometimes, what I learned is that, for me, the new tool might not be such a great fit, but, I still learned something.

With each new tool I can add to my toolbox, the better I can become as a developer and, more importantly, the more valuable I become as a developer. I say ‘become’ in that sentence is because just having the tool does not make you better, you need to consider these new tools and learn when is the best time to use them. A carpenter can have every tool under the sun, but if all he ever uses is a hammer, without considering using any of his other tools, he’s not going to be a very good carpenter. Another way of saying this is, if all you know how to use is a hammer, everything looks like a nail.

While I have never been one to shy away from learning new stuff, recently my desire to learn new stuff has not been as fierce as I would like. That changes today. I am issuing a challenge. A challenge to become a better developer. A challenge to everyone reading this, myself included, to pick a new tool – be it a new application framework, new concept (such as OO), new process (such as unit testing or using code repositories such as SVN or Git) or a new technology (such as Flex or Groovy) – and sit down and learn how and when to use it. Learn the advantages you gain and any possible negative effects of using this tool. Then keep the tool in your toolbox until the time comes that you need to use it. Finally, when you feel comfortable with that tool, go pick another one and start the process all over again.

I challenge you to become a better developer and not let the job pass you by.

360 Flex Wrap Up

I was really excited to have the opportunity to attend the 360 Flex conference in Indianapolis this past week. For those that don’t know 360 Flex is a medium size conference that focuses on the developer community and generally fosters a great deal of social communication.

At 360 Flex adobe announced that their Flex Builder product would undergo a name change. (Read more here) The new name, ‘Flash Builder’, is intended to reduce confusion about what the product does and the platform it runs on. The underlying Flex sdk will still maintain the ‘Flex’ naming convention.

In my humble opinion, I don’t think this is anything to lose sleep over. I still believe that there will still be a significant difference in intention when referencing ‘Flex developers’ vs ‘Flash developers’. I would argue that one could draw similar parallels with the ‘Ruby developers’ and ‘Rails developers’. I think it’s important to keep in mind that Flex is an AS framework and while it has some additional functionality (mxmlc) at it’s heart it all compiles down to AS3 for the Flash platform.

The conference had a slew of additional community driven announcements. A few that I found really interesting were: Axiis, Merapi and the Flight framework.

Axiis is a new open source data visualization framework by Tom Gonzalez and Michael Vandaniker. The Axiis framework makes use of the Degrafa declarative graphics framework to allow developers to create stunning data visualizations with unbelievable flexibility. Axiis went into an open alpha release and can be found at http://axiis.org/

Merapi is a Action Script – Java bridge that allows developers to connect Flex applications to Java applications over a socket server. Merapi makes use of the AMF binary format for serialization of objects which means that you persist classes across both languages. Merapi has been around for a good while now (2 years?) and has just now announced the open sourcing of their code. You can check it out here: http://merapi.googlecode.com/

The Flight framework is a new framework for developing Flash and Flex applications. Two of my favorite developers Tyler and Jac Wright put together this Model-View-Controler framework that speeds up the team development cycle and has some additional bonus features like Weak-reference binding and undo/redo/history management.

Overall, I consider myself very lucky to have had the opportunity to attend 360 Flex. I had an amazing time, met some great developers and I learned a lot. I’m extremely thankful to Tom (http://lordbron.wordpress.com/) and John (http://johnwilker.com) for putting this conference together. I can’t wait to see you guys next time!

cf.Objective 2009 – Web Application Project Management

As promised, attached is the presentation I just finished up at cf.Objective this year.  This presentation was on using open source tools for web application project management.

This is my first time for this presentation, so I appreciate any feedback.  If there is enough interest, I would be glad to do this presentation againfor the online CFUG or some other venue.

This has been posted to SlideSix now …. http://slidesix.com/view/Web-Application-Project-Management-zPQda

Thanks again for the opportunity.

cf.Objective 2009 – Taking Code Reuse to a Higher Level

As promised, attached is the presentation I just finished up at cf.Objective this year. This presentation was on using object oriented techniques and design patterns to take code reuse to the next level. The premise here was to go beyond custom tags and user defined functions which are the norm for many ColdFusion developers and start to think about creating reusable systems.

This is my first time for this presentation, so I appreciate any feedback. If there is enough interest, I would be glad to do this presentation againfor the online CFUG or some other venue.

Thanks again for the opportunity.

UPDATE: This has been posted to SlideSix now …. http://slidesix.com/view/Taking-Code-Reuse-to-a-Higher-Level

Site Testing with Apache's Jakarta JMeter

Everyone test’s their web sites before going live (right??), even if it just means that you click on the site after pushing it to production, but how do you simulate the large user count your production environment may see? Apache’s Jakarta Project has a product called JMeter that fits this bill nicely, though getting it working can be intimidating. This post will walk you through setting up a basic web site test and where to configure the important bits with the latest JMeter release.

First, of course, you need to go download the latest JMeter binary release:

http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi

On OS X you will need the binary file that ends in .tgz, on Windows grab the binary that ends in .zip. You will also need a JRE setup on your system (to test if you do, drop to a command / terminal prompt, and enter ‘java -version’. If you get ‘bad command or file name’, go hit Sun’s site and download the appropriate JVM / JRE)
Unzip the file to any folder on your system, then navigate into the ‘/bin’ folder, and on OS X you will see a ‘jmeter’ terminal-like icon, and windows has a jmeter.bat file. Fire those up, and after thinking for a bit you should see a window like the following:

jmeter startup

First, lets add an HTTP test. Right click on ‘Test Plan’, and add a ‘Thread Group’. This thread group defines how many threads (each thread represents a simultaneous user), and how many times you want your tests to be run. Setup your thread group something like this:

thread group

Next, right click on your new thread group, and choose ‘ HTTP Request HTTPClient’. This will add a simulated client request to our test plan. You can have many different client requests setup at once, and your threads will happily click through them as if they are users browsing your site. Then setup the HTTP Request HTTPClient options as illustrated below:

add http request

http Request settings

I will add 1 more sampler here, simulating a user searching for ‘Alagad’ on google. Add a request parameter by clicking the add under ‘Send parameters with the request’, enter the name ‘q’, and the value ‘alagad’. The path here will be ‘/search’, and the server name or IP will still be http://www.google.com

alagad search

Now we are almost done, but how do we view the results of our test? If we started this running, it would happily send requests to google (please don’t overdo, I don’t want to tick them off with jmeter tests). Right click on your ‘Testing Google’ thread group, choose add, choose listener, and finally choose ‘Aggregate Report’. There are many different listeners here, but this one will give you a simple summary of the number of request made, how many if any had errors, and some average times for responses. Now go to the ‘Run’ main menu, and choose ‘Start’ at the top. If you have your ‘Aggregate Report’ node selected while it starts running, you will see that it gets populated with data right away. Play around with some of the other listeners, you can write results data to files, you can inspect the response on every single request (or only error requests, I recommend doing only errors), and you can even see general graphed metrics.

aggregate report

For fun, try testing your site without trusted cache, then with trusted cache. As you increase the thread count of your jmeter test, trusted cache makes a larger and larger difference. Happy testing!

SimTouch Multi-touch Simulator

A while back I wrote an Adobe Air Application that simulates multi-touch events. The goal of the application is to assist developers in their own development of multi-touch applications knowing that they might not have access to multi-touch hardware or that they might find a simulator more efficiant for testing during development. The core benefit to using SimTouch is the transparent background allowing the application developer to have a better grasp of what he/she is ‘touching’.

SimTouch works by simulating touch events and passing that information to other flash applications via a protocal called TUIO. SimTouch uses the same xml format that FlOSC might use to translate OSC message to a TUIO object. SimTouch needs a simple socket server to relay the XML Socket message between applications. Typically on port 3000.

Here is a quick YouTube video that shows SimTouch being used in with the Physics.as example.

http://www.youtube.com/watch?v=MkRXr2Y85c0

This is yet another open source venture and the code can be found at:

http://code.google.com/p/simtouch/

There is also a good bit of information on this simulator on the Natural User Interface forums:

http://nuigroup.com/forums/viewthread/2647/

I’m posting this here to see if there is any facination in Adobe Flex, Air and Flash multi-touch developement projects on this blog. Almost all of my little multi-touch projects are open-source and I’m happy to go into a little more detail on ways to build and deploy them. Any interest?

I hope this helps some assipiring multi-touch entusiasts and I can’t wait to see what cool applications you guys are creating!

Getting Started With Enterprise Java is One Huge Pain

Over the last few months I’ve been reading several books about Groovy, Spring, Maven, Hibernate and more. I’ve stated before on this blog that I’m moving towards implementing my application’s model in Groovy and using ColdFusion for the presentation tier for HTML applications or Spring’s BlazeDS integration for Flex applications. And now, with those few months of experience under my belt I can authoritatively say that Enterprise Java is a royal pain.

You see, I actually understand Java just fine. I can read the language and, to me, it’s fairly clear. But, as with my German, I’m much better at reading it than speaking it. The reason isn’t that I can’t write the syntax, but that the supporting technologies are so amorphous and decentralized that they can simply be very difficult to learn. Beyond that, they’re often created with extreme flexibility in mind and that means more complexity.

As an example, I’ve recently been working to create a Java (Groovy, really) based web service. This is a whole world of difference from how you’d do it in ColdFusion. I had already decided to use Spring to configure my application’s model and what I wanted to do was expose a service remotely using a specific WSDL. Spring doesn’t include a way to remotely expose services as a SOAP web service (though a dozen other RMI techniques are supported). While researching this I came across a project called Xfire which provides that functionality for Spring. Now, Xfire has a metric ton of dependencies (seriously, check it out here). And, in the interest of flexibility, Xfire allows you to choose from one of many Stax implementations, whatever that is.

So, just to be clear, there are many ways you can remotely expose services using Spring. And, within a particular option there are many choices for Stax implementations. Oh, and I forgot that there are at least two ways to configure Xfire. Oh, and if you don’t want to use Xfire you could use something like Apache Axis. To ask a rhetorical question, how does a newbie have any hope of making a good choice? It seems that only answer is through trial and error.

The cool thing about this is that after a few days of work I was able to expose a Spring configured service via Xfire and it worked great. That is until I did something it didn’t like and I started getting Null Pointer Errors. So, I decided to throw out Xfire and try Axis. The thing is, I’d lost track of the dependencies in my application. I already had maybe 30 jars that my application depending on just for this one service (not counting the Jboss server and everything it requires). I didn’t know what to throw out any more!

That prompted me to do some research on Maven, which is in some respects is an alternative to Ant. I’m not going to get into a description of how Maven differs from Ant, but I will say that it’s a build tool that automatically manages your dependencies for you. The idea being that rather than downloading bazillion jars manually, you simply write some XML that says your application depends on Spring and Xfire and Maven will then download everything for you, along with each dependency’s dependencies.

So, I spent several days reading up on Maven. The thing about Maven is that it wants you to organize your project in a specific manner. For example, there are certain folders by convention that you write your source code in and it builds to specific target directories, again, by convention. This makes using Eclipse a bit more challenging because Eclipse wants you to sort your directories the way it expects. And, when you start adding in features like the Groovy Feature plugin things start really getting cumbersome.

When using Maven with Eclipse you’ll need to use the m2Eclipse plugin (which depends on two other plugins!). Within Eclipse then you’ll need to use m2Eclipse to create a new project. As a part of that process you specify that you want to create a Groovy project. This works like a charm and you can then use the IDE to create new Groovy classes and tests. But, if you want to use any of the built in features of the IDE to run unit tests then you also have to configure the Groovy feature and get that working. I spent, again, a couple days getting this worked out. As it was, I had Maven configured to build a Groovy project, and when I’d write unit tests Maven would run them just fine. However, if, within the IDE, I were to try to run a test via the Groovy plugin I’d get an error about how it couldn’t find my class.

Through trial and error I have learned that you can run Eclipse from a console. If you do this then the console will output all sorts of logging information. When I was having this last problem I started Eclipse from the command line and looked to see what it was outputting when I tried to run my unit test. It took some reading, but eventually I realized that the IDE was trying to use groovy 1.5.7 while Maven was using Groovy 1.6. As a result, when my code was compiled it depended on Groovy 1.6 and the Unit test was expecting 1.5.7 and wouldn’t run 1.6 code. It makes lots of sense, but figuring this out was a royal pain!

Once I knew that, I was able to upgrade my Eclipse plugin to be the same version as Maven was using and suddenly my project would not only build, but I could manually run unit tests.

I’m not sure if I have a moral in this blog entry or if I’m just ranting. However, I can say that when things start working and can I get that flexibility working in my favor I love it. But, when things are not working and the error messages are less than helpful it can be extremely frustrating. So, be thankful for ColdFusion. But also, don’t give up on these other technologies. They do actually work, but they’re hard to learn all at once.

Tag Cloud