Thursday, May 29, 2008

Leading the OpenBD BOF

I was originally slated to lead the Improving Quality through Code Review and Mentoring. A twist of fate happened and OpenBD was pitted at the same time in another BOF, originally lead by Vince. Unfortunately Vince from New Atlanta will not be able to make the Open BlueDragon BOF. So now Mark Drew has agreed to take over my original BOF so I can lead the OpenBD BOF! Long and the short. I am leading the Open BlueDragon BOF at cfUnited (with plenty of help from Matt Woodward and Sean Corfield of course)! Leave comments on what you would like to see/discuss in that BOF!

Thursday, May 22, 2008

JavaOne Treasures

My company sent 6 folks to JavaOne and today was the first of many recap/regurgitation of JavaOne goodness. Mylyn a tool the CFML community has already been introduced to by some fellow bloggers is, of course, making a big splash in the Java community as well. Since I have had a large amount of experience with it I got the chance to help present the plugin to everyone, which was fun to see it get a bigger response. Next my Java counter part talked about JSF and blabbered a bit about the JSF2.0 spec, hype or real we'll see I suppose.

The next recap was of a tool that everyone, EVERYONE, should have in their toolbelt. The tool is best used with Java 6 but can hook in with Java 5 and even 1.4 a little. The tool is free; VisualVM and can, with Java 6, visually show you all sorts of stats on what is running in your JVM. It can get down to how many of what classes you have in memory. Its also plugable and they already have a cool plugin to show a histogram of your GC which can be very interesting! The tool is at RC1 right now and is a must for anyone doing any sort of development on the Java platform.

Next Hot topics/Buzz was presented. It was cool to see Flex get a mention, gave me a chance to pimp ColdFusion as well as talk about BlazeDS. Groovy was of course brought up and we had a short discussion of it. In the same light Ruby and other dynamic languages (funny not CFML) were brought interesting missing from the list was Scala which I thought had some buzz at JavaOne from other accounts. Selenium got a mention and seems to be growing as an accepted tool in many communities now, again a good thing to see. I was really hoping JavaFX would get more than a 5 second mention but I expect much more about JavaFX over the next couple of months, again vapor or reality...we'll see. Finally 2 debugging tools were talked about Fiddler, and Omniscient. Omniscient looks particularly interesting as it essentially records your applications stacks and allows you to replay something to allow you to do intensive root cuase analysis on a bug, very cool stuff.

Overall it was an excellent recap with loads of good tips and information and I am really looking forward to playing with Omniscient and VisualVM as I start doing more and more with OpenBD.

Saturday, May 17, 2008

Open BD Plugin Architecture

Alan Williamson said he needed to document and blog about the plugin architecture of Open BlueDragon, after all it is his baby. Being the huge proponent of it, I decided to go poke around the source and figure some of this out on my own. What follows is my interpretation of the plugin architecture after messing with it this this morning. I'm sure Alan will have better documentation in the wiki.

Firstly since I didn't really feel like writing a hello world function I took the code Andrew Scott posted the other day and turned it into a plugin. Since the plugin stuff has not got much press Andrew did what he knew he could do and added his function to the core, something that has gotten some criticism already. This type of functionality is perfect for the plugin architecture so i figured it would be perfect for my example. In an effort to keep this entry from getting too long I am going to focus in on the com.bluedragon.plugin package and how to use the plugin architecture and I will leave out how to create a tag or method till later. Besides others have already figured it out so you can too right?

The Plugin package contains only 2 concrete classes and for now we only need to worry about one of them, and an interface; the PluginManager (concrete) and Plugin (interface). We'll be using the PluginManager to register our functions and tags, on a side note it looks like this is also Java's interface to CFCs. On start up the PluginManager is called and it uses a node in bluedragon.xml to know what plugins to load. The node is <plugin> and the path is (found on line 67 of PluginManager): server.system.plugin. Here is a snippet example:
<server>

<system>

<plugin>com.bluedragon.extra.ExtraPackPlugIn</plugin>

</system>

</server>

The classes specified in the plugin node should be in the classpath, on launch, and each should implement the Plugin interface (the other class in the package mentioned earlier). One of the methods you have to implement is pluginStart. This method takes an instance of the PluginManager which you can then use to register all your addin methods and tags. To add a tag it would lok something like this:

manager.registerFunction("QueryGetRow", "com.cfinnovate.example.QueryGetRow");
(or registerTag, for tags).

The first argument will be the name used inside of your CFML and the second is the class that implements the functionaity for your method/tag. Generally they'll extend functionBase or cfTag. NOTE: you can override builtin functions and tags with the PluginManager's methods.

The important thing to call out here is your methods and tags can be written exactly as if they were built into the core, just put them in your own package. The end result is a, 100% portable to the core, extension to Open BlueDragon. As far as eclipse setup I created a new resource folder inside of my openbd project called plugins and put the plugin code in my own package and it worked perfectly. This also allows for easy export to a jar to distribute to others. Here is a recap:
  1. Create a Class that implements Plugin
  2. Place that class (and your actual method/tag classes) in the classpath
  3. Put the plugin implementing class in the server.system.plugin node
  4. Start the server and enjoy
If you would like to see a working example check out this example jar (which contains the source as well). Please note that the function itself is Andrew's which he shared with OpenBD and this is example code. An entire example project can be found in my SADHaTS project. Please note that to make it easier to share I put it in its own project. If you want to test out building the way I explained earlier just copy the package into a new resource tree in your openBD project. Happy coding!

Update: Alan has blogged about it now here

Thursday, May 15, 2008

Open BlueDragon Update

CVS and Bug tracking is up and running. There is an open readonly CVS account for folks that want to create patches and/or get the latest straight off CVS:

Connection type: pserver
Host: cvs.bluedragon.org
Repo Path: /cvs/openbd
User: openbdpublic
password: password

Bug Tracker:
https://openbd-bugz.cvsdude.com/

I'll follow up with a quick tutorial this evening on how to create patches and submit them through the bug tracker! I am very excited, its all coming together, hopefully the wiki will be up by the end of the week too!

Tuesday, May 13, 2008

ColdFusion 7 & 8 annoyance

Just a quick post about an annoying "feature" of ColdFusion 7 & 8, and maybe even 6.1. In CF5 and CF6.0 nesting cfoutput tags was forbidden unless you specified a valid Group attribute in the parent cfoutput, not so much in CF7 (and maybe 6.1). Whenever that functionality changed it went fairly undocumented, though there is a comment in livedocs for v7 and a subtle wording change from 6-6.1. So fair warning if your testing environment is ohh lets say 7 but for some backwards reason you have to release code back on CF5 (or 6.0) code might break by this undocumented difference.

There is a subtle wording change from 6-> 6.1 but I do not think that does this, major, change justice:

Live Docs v6:

To nest cfoutput blocks, you must specify the group and query attributes at the top-most level, and the group attribute for each inner block except the innermost cfoutput block.

Live Docs 6.1:
If you nest cfoutput blocks that process a query, you specify the query and group attributes at the top-most level; you can specify a group attribute for each inner block except the innermost cfoutput block.


Nothing in the Change history...annoying.

Sunday, May 11, 2008

Pulse2 Review

This weekend I finally got around to giving pulse2 a spin. For those that have not heard of pulse2 its an eclipse based application that does the dirty work when it comes to configuring..eclipse. I know this sounds kind of odd but that's what it is and does. Once you open pulse2 you can chose which Eclipse runtime you want, like the core + WTP, then all additional plugins in the Pulse2 catalog. Once you have chosen the plugins you want Pulse does the dirty work of downloading and resolving dependencies. If you have 2 profiles with the same plugin it will not download it twice, its smart like that. You can also save these configs as profiles and share them with others. Pulse2 in its basic form is free but as I quickly found out anything worth while really requires the freelance account and that is subscription based @ $6/month or $60/year.

My initial thought, and why it took me so long to use pulse, was meh I can do this all on my own. However, loading different profiles can be really useful. Lets say I am working on mxUnit's eclipse plugin I can load an IDE specifically geared towards plugin dev. This would be pretty different than if I was working on OpenBD's core (something else I did this weekend). I quickly learned how nice Pulse2 is and this is a perfect way to help others in the community, share my profile and anyone can use it! The problem for me comes in that you can only use plugins in Pulse2's catalog to use Pulse2 for free. Even worse some of the plugins in the catalog require a freelance account to use (Aptana and Jboss tools are the 2 biggies here). This seems crappy to me since there is not way they can keep the catalog up-to-date. A perfect example of this is mxUnit; if I want to make a profile for the average CFML developer its either without the mxUnit plugin or it is a freelance account profile.

You can always install plugins yourself and have them not managed by Pulse but again I loose the profile aspect of it. In addition to being able to add your own plugins with a freelance account you can also share configuration settings. This is really awesome since I have multiple dev computers pulse will now keep them all in sync with one another. That to me seems like the type of services that I should pay for, not the ability to manage any plugin I want, isn't that what pulse set out to do FREE to begin with? Other than my not all plugins can be managed gripe, I also had quite a few issues with Pulse2 on Leopard, invalid argument exceptions. So bad that I would repeatedly have to shut down Pulse2 and relaunch to get my profiles configured all the way. Once the profile was configured Pulse did work perfectly so it was choppy starting but overall the product worked and worked well.

At this point I am not sure the service is worth the $60/year, I know it is not much but I can already accomplish most of what the service extras do for me with source control and checking in/out my eclipse configurations. What's more my method works with more than just eclipse it works will all my dev tools. This type of functionality is in the roadmap and once that comes to fruition I think it will surely be worth the cost. I might just get the subscription now so I can help fund the project and continue to use my extra managed plugins I guess I'll make that decision in 29 days.

Wednesday, May 07, 2008

Open BlueDragon released

It's been a bit since I posted. I've been busy, cf.Objective and Open BlueDragon launched, then catch-up at work. I've been messing around with an installer for Windows for OpenBD and I am working on some additional video tutorials as well. I posted a rough one right after the OpenBD launch. Expect more in the future: