Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Friday, July 30, 2010

CF is not Java, it is a Java Framework

So the other day I saw this on a ColdFusion mailing list and I am once again reminded how over simplified some of our developers view on the (Java) world is:

Why is no one mentioning the Java argument? Ask your friends if they think Java sucks and can't handle load.

I really dislike it when people say this. It simply shows a lack of understand and blind ignorance for the technology they love. Just because the engine is written in Java does not mean it is automatically at the same level as Java. There are many places where ColdFusion sucks (performance or other wise) compared to Java. There are indeed places where ColdFusion is better than Java. This is because ColdFusion is a Java framework and it all depends on ColdFusion's architecture. Much of ColdFusion's architecture rely's on reflection, which still has a stigma in the Java community of poor performance (though that has largely gone away). Due to this reliance CF has been tweaked over the years to get performance so things like CF9's hibernate integration are wicked fast even compared to the typical Java implementations (you have to pay the reflection piper with Hibernate either way). Heavy objects though will not work as fast with ColdFusion. Yes this has become much faster but it is not Java and it will never be Java. ColdFusion is a Java framework, please stop with the it is Java argument. Yes it does compile to Java classes but recognize that those classes are absolutely useless without the CFML engine that runs as a

framework to execute the ColdFusion generated classes. The engine has it's strengths and weaknesses just like any other Java framework. In the Java community if a site crashes I immediately ask is it wicket? I ask this because I've had bad experiences with it and memory management, among other things. No one is going to say ohhh well it is Java, b/c wicket still sucks (sorry anyone that likes wicket, I've not looked at it in years so it may well have risen above stuck pig level) as a Java framework.

Sunday, August 16, 2009

CFUnited Presentation Roudup

CFunited was busy for everyone involved so I have no excuse for falling behind in making blog entries as many others just as busy as I did kept up just fine. I'll only post 2 entries for CFUnited this one with all my presentations and then a second one recapping my CFUnited experience (spoiler: It kicked ass!). On with the recap!

Red Green Refactor
PDF Keynote

I was fortunate enough to be given the opportunity to present this topic 2 times at the conference. I feel like both presentations were solid and entertaining; including a reference to old Purple Pants (if you do not know, probably best not to ask :) ). Barney B was disappointed in my lack of gratuitous vulgarity, I'll attempt to not let him down next year. I got really good feedback, even testimonial that TDD does speed up development!

Fusebox Past Present Future (Busy Developers Guide to Fusebox)
PDF Keynote

This was a bit awkward given the current situation surrounding Fusebox and Myself. The first half I did my best to sell on the framework and break down some of the old myths. At about 5:55 I entered my 5th Myth: Fusebox is Dead and instead of really getting into that I made the attendees aware of the current state (at the time) and announced I was resigning. I think spent the second half of the presentation talking about FuseNG (or Fork-a-doodle-doo). Expect more entries soon surrounding FuseNG 1.0 (code named Cuddles).

Code Review and Team Dynamics
PDF Keynote

This started my 3 hour marathon of presenting. It was also a late add to the conference, I was subbing for Jake Munson who was unable to present do to person reasons. I love this presentation, I've given it a few times previous. I felt really good about my delivery and I think everyone got something out of the presentation. I think I might create a new presentation on the same vein but with more emphasis on Team Dynamics and mentoring for next years conferences. I appreciate all the positive feedback from everyone!

Busy Developers Guide to Java Part 1
PDF Keynote

This was one of those presentations with so much content it has to go perfect or you run out of time. I screwed up 2 times and ran over. I was also called Drill Sgt. and Reverend after this presentation. Apparently I was too brash haha! I felt everyone still learn a great deal about java and I got some great positive feedback as well, definitely help enable folks in this one. This was the second session I got to repeat. The second iteration I tried not to preach as much I also pulled some content that might have been too preachy. I ended right on time and had some great interaction, just like the first time. I think this session has great replay potential for future conferences.

Busy Developers Guide to Java Part 2
PDF Keynote

This was my final presentation of the 3 hour presentation marathon. I'll admit that about halfway through the Part1 session I felt ill. This continued into part 2. About half ways through one of the most embarrassing things happened, I had to excuse myself from the presentation for a moment. Luckily this was the last session of the day and everyone was very understanding and allowed me to run over the time and finish the content. I appreciate everyone's patients with me. Aside from the total misery I was in as far as how I felt I think this presentation was awesome. I got good participation from the attendees and very positive feedback from many folks. Anytime I stick around after a session to answer additional probing questions seeking to learn more is awesome.

Overall I had a blast presenting. I hope everyone attending my presentations was entertained and learned or was motivate. As long as I was able to positively affected at least one individual that is all the more I can ask for as a presenter the rest is gravy. Our community is growing and I am glad to be part of the growth. Here's to CFUnited and any other conference that facilitates collaboration and growing! Thanks Stellr for organizing, promoting and kicking ass.

Sunday, August 09, 2009

CFUnited Introduction to Java

For anyone attending my Java part 1 session I have checked in all of my sample code to my SVN repo:

http://svn.cfinnovate.com/trunk/presentation-materials/

There are 2 Eclipse projects you will want to download from the repo. I wanted to make this available ahead of time for anyone interested in following along! I'd recommend download it now and then syncing at the conference, download speeds have historically sucked at conferences.

I do not think part 2 will have enough time for much code. Since it is all about JEE environment we'll spend most of our example time exploring the ColdFusion installation (Hopefully you have this already!).

Thursday, May 14, 2009

CFML Portlets

Finally the presentation has been given and the world (albeit a small world) has got its first glimpse at what we (my self and Bob Burns) have kept to ourselves for way too long. I haven't really said much recently and it's because I have been very busy getting ready for presentations at cfObjective. I don't think I mentioned Bob enough, he really was to catalyst for this project many moons ago. He rocks in so many ways I really can not describe it. The presentation slides can be downloaded here. The project documentation is a bit shallow right now, that will change, and all the information will be on the Wiki. The code is in SVN (http://svn.cfinnovate.com). I'll keep this short but I promised links on my blog so there you go. If you are interested in hearing more about CFML portlets let me know I'll oblige!

Tuesday, September 02, 2008

Fusebox in Java??

A couple of weekends ago I stepped into my Java developer shoes and attended No Fluff Just Stuff, think cf.Objective() in attendance size, cfUnited Express in local feeling, and cfUnited (or SOTR) for quality of speakers. I wrote up the majority of the entry during that conference. Instead of publishing it at that time I decided to sit on it for a bit before rereading my thoughts and posting this entry. At NFJS Neil Ford talked about polyglot programming, something I myself have joined in about in the past. If you will recall polyglot programming has morphed into this thought process of using the appropriate language to complete a task. The JVM has become a very powerful platform, now supporting some 200+ languages. Most of these languages can interact with one another at some level, if not directly then they can use the the Java level. While CFML happens to be my preferred language to write most of my applications in I have to wonder should frameworks be written in CFML?

Historically we were bound to strictly CFML, putting any part of a framework for CFML apps in Java would require putting the class on the classpath, not so shared hosting friendly. Well we have all progressed and learned a thing or 2 about Java and this traditional thought process needs to evolve some. Thanks to Mark Mandel and some of his crazy cool java class loader work, even if you don't know much about class loaders, we are not bound to our traditional thoughts about how we can load java classes. We can now easily load java classes after server start up from places other than the predefined classpaths. Armed with this knowledge I can now objectively ask, should Fusebox be written in CFML or should it be written in Java (or groovy or anything else that I could consume from CFML)? Even weeks later, presumably after all the Java Kool Aid has left me system, I still am leaning towards Fuseox should be written in Java. Maybe should is a bit too string of a word there, Fusebox could benefit from being implemented, at least in part, in Java. This is not a proclamation that I am going to rewrite Fusebox into Java, remember I said I was going to think out loud when it came to Fusebox development, but I really am leaning towards writing parts of Fusebox in Java.

Saturday, June 14, 2008

Polyglot Programming and CFML Developers

For those that do not know what Polyglot Programming is allow me to introduce you to the term! It really sounds fancy but when it comes right down to it Polyglot Programming is the utilization of multiple languages to complete a task. We all are more or less polyglot programmers; using CFML, ECMAScript (Javascript or Actionscript), CSS, HTML, and (some of us) Flex/Flash. So for this discussion we'll refine Polyglot Programming down to using multiple server side languages to accomplish a task (as this is the really discussion going on most of the time these days). I think ever since CFML was available on the Java platform many of us began to be partial polyglots (I know this literally would mean we are each programs written in multiple languages but I'm going to use it to describe ourselves instead). As a point of reference one of my first projects I worked on with ColdFusion MX I used Java to zip content. The reason I say partial polyglots is I didn't really write Java I just used CFML to execute a couple of Java objects. Looking beyond a CFML developer barely learning enough Java to dip down into the Java layer, what is the typical growth path of a CFML developer?

CFML is such a high level language the only level above CFML right now would be frameworks, or a custom DSL. I get the feeling that frameworks is where the average CFML developer interested in growing spends his/her time, learning frameworks. This is a good practice as one can learn a great deal from frameworks, not to mention the benefit of using frameworks in many instances. The problem I see here is the average CFML developer is not learning CFML's foundational language, Java*, and not really wandering that far from their comfort zone. Sure frameworks might force you to learn a new technique or push you into a new paradigm but you are still working in CFML. ColdFusion has done a spectacular job hiding the java underpinning behind a curtain. While that lowers the barrier to entry, which is a good thing to grow a community, I think it is a shame too. A CFML developer can blissfully develop code without ever understanding how it is their application works. On one side that's exactly what one would want to look for in a platform. From another perspective, when it comes to developer growth and incentive to grow, this may not be the best thing. Where is the incentive to learn how a war is deployed to a app server? How many CFML developers know what a context root is or how it might affect their application if the context root is not /. I am going to guess the average CFML developer may not even be familiar with what a many of the terms I just talked about are, and even the terms that sound familiar many may not truly understand how they fit together. Without dipping a little further into Java the typical CFML developer can not realize the true power of polyglot programming that can be leveraged on the Java platform. A superb example of someone that has found, for him, a great balance of polyglot programming is Andy Powell. His presentation at cf.O outlined how his projects leveraged Java (with Hibernate and Spring) and CFML. At Kroger we use Spring Security in all of our [new] CFML application as well as an ever growing library of Java classes that allow us to share IP with the Java side of the house. Another good example of polyglot programming, with an added bonus of a lower barrier to entry, would be cf_groovy, Barney Boisvert's project. I've not had the time to look into much yet but the few blog entries Barney has posted have been fascinating. If you are interested in learning more about Java and the JEE environment that most CFML engines run in but don't know where to start leave a comment/question. Let me know if you will be at cfUnited. If there is enough interest I will setup a late night pow-wow in the Lafayette room to introduce folks to Java/JEE.

* maybe .Net for those on BD.Net

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