Shameless self-promotion: If you're interested in learning about XSLT and ColdFusion, you might want to check out my article XSLT and ColdFusion: Whipping Your XML Data into Shape in the latest ColdFusion Developer's Journal. If you're using XML data and aren't using XSLT, you should be!
Friday, August 20, 2004
Tuesday, August 10, 2004
I completed a very simple real estate listing application that I think serves as a decent proof of concept for combining ColdFusion and Java within the Mach-II framework. If you're interested you can download the zip file here.
Overall this was a really interesting exercise, and I sent the link out to the Mach-II list on Topica, so I'll be curious to see what others think. The Java code is far from stellar since my Java's pretty rusty at this point, and I only spent about a day on the whole thing, so while it's not spectacular, it works and was fun to put together. Quite honestly I ran into fewer issues than I thought I would.
The natural break point in my mind between Java and CF in a Mach-II application is that the Listeners need to stay as CFCs. Once you start monkeying with those you're looking at modifying the Mach-II framework code, which I wanted to avoid. The bean objects and the DAOs and Gateways all seem to work fairly well in Java. Not being able to throw the Mach-II Event object into a Java object was a minor annoyance, but no real concern.
I'd say the biggest issue in my mind is running a database query in Java and getting those results back to CF. Because you can't just toss CF a Java ResultSet, there are of course several options. In the case of a bean, no worries at all because you run the query and populate the bean all within Java, and the bean itself is a Java object that CF can use. For a "list"-type query it's a bit more of an issue. I thought about using a Java Vector since that can be thrown back to CF and will become an Array, but I decided instead just to build an XML string from my Java query results and pass that back to CF. Works well and also keeps the data pretty usable by anything that can consume XML.
I'm sure I'll come up with more ideas as I go further down this path, and I'll post any feedback I get from the Mach-II list folks here. I'm pretty excited about the potential this offers!
Saturday, August 7, 2004
I'm in the middle of working through building a hybrid CF/Java application within the Mach-II framework. My motivation for doing this is that there have started to be some rumblings at my company that we may be moving to Java as a company-wide standard, and since I'm in the middle of modifying an existing application and have a bunch of new ones on deck, I thought this was a good opportunity to investigate some integration possibilities. I'll post what I find here. So far so good--I have the bean CFCs converted and am doing my first DAO now.