Showing posts with label coldfusion builder. Show all posts
Showing posts with label coldfusion builder. Show all posts

Wednesday, August 31, 2011

ColdSpring Setter Injection versus Constructor Arguments Snafu

I was troubleshooting an issue a colleague of mine was having the other day, where to his credit he was following best practices but it shot him in the foot. Wanted to mention it here quickly.

Most times when you are injecting a bean into another bean in ColdSpring you will use setter injections. They look like:

<bean id="bean1" class="com.nictunney.Bean1"/>

<bean id="bean2" class="com.nictunney.Bean2">
  <property name="Bean1">
    <ref bean="Bean1"/>
  </property>
</bean>

Bean2 defines a mutator (setter) method, setBean1(). ColdSpring will inject the Bean1 into Bean2 when Bean2 is created by explicitly calling Bean2.setBean1(bean1). This is a best practice when performing dependency injection to prevent circular dependencies.

So the problem we were encountering in code was that the Bean2 constructor was calling a method that relied on the Bean1 property, which was of course undefined during the instantiation. It took a little while to track this down as this was a Model-Glue subapplication with lots of other stuff that could have been creating the error.

So, the lesson learned is to remember how ColdSpring and DI works. ColdSpring is going to create an instance of a bean, call the bean's constructor and then perform any necessary setter injections. It all makes perfect sense, except when you least expect it ;)

The answer in this case was to determine if a circular dependency would occur, which in our case it wouldn't, and instead inject the dependent bean via a constructor argument like this:

<bean id="bean1" class="com.nictunney.Bean1"/>

<bean id="bean2" class="com.nictunney.Bean2">
  <constructor-arg name="bean1">
    <ref bean="Bean1" />
  </constructor-arg>
</bean>

In the constructor call setBean1(arguments.bean1).

Wednesday, August 24, 2011

Are you ColdFusion Curious?

There is always lots of buzz about Adobe ColdFusion across social networking channels from developers. Most of it is positive, but ColdFusion also takes some abuse from programmers who have not used it. This criticism then gets met with some pushback from well-meaning CF developers, which in turn makes the bulk of us look like rabid loyalists.

Unfortunately for those scouring for information on language pros or cons, many of the negative statements are misinformed, heresy, and some of it is just good-natured ribbing (which I encourage as I do the same). I'd like to challenge all of you who use a web development language like Ruby, PHP, C# and ASP to take a single hour and attend one of the Adobe ColdFusion Developer Week sessions and challenge yourself to check out CF and see just how productive it can be. Don't worry, I won't tell any of your friends you were there ;)

Wednesday, April 27, 2011

CF Builder Express Edition - Yeah, It's free!

Some big news from Adobe was released today: ColdFusion Builder will now have an express edition. What this means is that after your CFB trial expires, you will be able to continue using Builder save a few features that will be disabled. It is up to you to determine if those features are worth the $300 price tag.

Here are some of the features that will not be available in the free edition:

  • Code Assist for Extensions
  • Code Insight
  • Extension Callbacks
  • Connections to remote CF Servers
  • Quick Fix
  • Remote Project Debugging
  • Refactoring
  • ColdFusion Search
  • Code Formatting
  • FTP Support
  • Log Viewer
  • Local File Browser
  • Code Hyperlinks
  • Hover Help

For me, I use some of those features and the time savings is worth the $109 upgrade price. You'll have to make that decision for yourself, but regardless, CFB Express is still full featured.

Here is a link to all ColdFusion Builder 2 Features for comparison.

Sunday, July 12, 2009

My Adobe ColdFusion 9 and ColdFusion Builder Article is Live

I had the pleasure of writing an article to be released with the Public Beta of CF9 (Centaur) and CF Builder (Bolt). I decided to write about SOA and how CF9 and ColdFusion Builder change the way you currently develop your service tier. Hope you enjoy it!

Reinventing SOA in Adobe ColdFusion 9 beta and ColdFusion Builder Beta

Other great CF9 and CF Builder articles:

Introducing Adobe ColdFusion 9 Beta (by Ben Forta)
Introducing Adobe ColdFusion Builder Beta (by Ben Forta)
Introducing ORM in Adobe ColdFusion 9 Beta (by Mark Mandel)
Getting started with ColdFusion Builder Beta (by Simon Free)

Thank you Adobe

I've been an Adobe fan for years, first got started with Photoshop back in version 6 and I've seen it through CS4. I was pretty stoked a few years ago when another product I've been with forever was purchased by Adobe: ColdFusion. Being a CF Junkie since the Allaire days, seeing it through Macromedia and the Adobe acquisition, living through the yearly '<insert company here> is going to discontinue ColdFusion' threads and generally enjoying being a Team Macromedia member and now an Adobe Community Expert for ColdFusion, I'm happy to announce that public betas of both ColdFusion 9 and ColdFusion Builder are being launched right at this very minute.

There have been quite a few announcements of new features coming out in ColdFusion 9 (codenamed Centaur) so I'll just hit a few of the most exciting to me:
  1. CFaaS (ColdFusion as a Service) - ColdFusion core services are available via web services such as PDF document management, email, charting and image manipulation.
  2. Enhanced CFSCRIPT support - that's right! The tag functionality we have been been breaking out of script for is now available in cfscript! No more switching back and forth... use script when it makes sense for the entire process, not just bits and pieces.
  3. Implicit getters and setters - I just cannot say enough about this feature. Thanks Adobe!
  4. Lots of changes to CFCs - too many to list, just go check the docs.
  5. Caching improvements - granular control of objects and page fragments to disk or memory cache.
  6. Portlets - Government shops will love this one. You can now expose ColdFusion applications as portlets in leading JEE portals.
  7. Desktop server manager - AIR app lets you manage multiple servers from the same console (even supports clusters).
There are a few other features that are cool as well, go check them out (links at the bottom of the post).

Now to the second release of the night - I've seen quite a few ColdFusion IDEs - having worked in ColdFusion Studio, Homesite+, instructing in Dreamweaver and rocking the house in CF Eclipse, and now I'm proud to have gotten to take a sneak peek at ColdFusion Builder, the first code centric IDE for ColdFusion put out by the parent company since Homesite! I have to say, it's very cool and very handy. It is built on Eclipse, so one IDE to rule them all. Code generation has been moved out of Flex Builder (now Flash Builder) and integrated into CF Builder. You can connect to CF exposed services right from the IDE, generate AS3 code, start and stop servers and <drumroll>STEP DEBUG</drumroll>. CF Builder also provides code hinting and insight the likes of Flash Builder :). It even supports code refactoring, meaning updating a function name in a CFC will update all references to that function within your project!

I'm pretty excited about this release. I was glad to see the release provides more under the hood performance and functionality than widget-type tags. Go see for yourself:




Now the fun bits:
ColdFusion 9 Public Beta
ColdFusion Builder Public Beta

Developing Applications with ColdFusion 9
ColdFusion 9 CFML Reference
Installation Guide for ColdFusion Builder
Using Adobe ColdFusion Builder