Blog

Luis Majano

November 08, 2010

Spread the word


Share your thoughts

After much hard work and testing we have now reached our first release candidate for our ColdBox 3.0.0 series, Release Candidate 1. It has been a year now since this release has been under development, testing and now we are almost there. This release brings the latest stability possible for the platform as all tickets are closed for the 3.0.0 release and hints of our last big framework decoupling, WireBox. The next release will be WireBox 1.0 and shortly after we will do our final 3.0.0 release. Before upgrading we always recommend looking at our compatibility guide and also our what's new guide that includes everything new in the 3.0.0 Platform.

WireBox is a lightweight standalone dependency injection and AOP framework based on conventions and CFML dynamic goodness. It is the culmination of years of reliability within ColdBox and soon it will be available for all to benefit from. In the next coming days I will be releasing the object binding DSL, configuration and capabilities. It is pretty much what has been in ColdBox since version 2.6 but now with some extra goodness. We have been inspired by Google Guice, pico container and of course Spring, but leveraging what CFML does best, productivity without the cost of simplicity.

So let's get an overview of the major aspects of this release and where you can get it:

Sample Applications Thanks to Curt Gratz and the Computer Know How crew, all sample applications have been update to 3.0.0 standards and several new sample apps have been added to the mix. We have now over 25 full blow sample applications in our bundle release where you can learn from and even use for your apps. So Kudos to Curt and Crew for all the great support and help.

Stability & Performance Bug Fixes Thanks to the thousands of users around the world who have contributed their time to testing, load testing and performance tuning this core is the fastest release we have seen in our 3.0.0 milestones and the most stable. All open tickets that we had initially created for the 3.0.0 platform have been closed.

IOC Updates The entire IOC architecture has been rewritten for ColdBox 3.0.0. So now the IOC plugin can talk to any object factory that implements our adapter interface. We have updated it to work with ColdSpring, ColdSpring2, LightWire and WireBox or your very own object factory. You can also now declare parent factories for the main factory of your application, if your adapter supports it. The IOC plugin will create the parent factory for you and wire it to the main one for you. Cool huh?

// CFC declaration
//IOC Integration
ioc = {
    framework         = "coldspring",
    reload                 = true,
    objectCaching     = true,
    definitionFile  = "config/coldspring.xml.cfm",
    parentFactory     = {
        framework = "coldspring",
        definitionFile = "config/parent.xml.cfm"
    }
};

// Custom factory
ioc = {
    // the framework is the type of the adapter to use.
    framework         = "com.model.MyBeanFactory",
    reload                 = true,
    objectCaching     = true,
    definitionFile  = "config/coldspring.xml.cfm"
};

The plugin has also been updated on how it does object caching and metadata caching for ioc objects so now it can create a buffer layer between your IoC factory and CacheBox for added performance. You can also from the configuration decide if you want the factory reloading on each request, which is great for development.

Implicit View Rendering You can now render views without the need of creating events for them. If you are building a prototype or migrating from legacy code into the framework, this will be a great asset. So let's say you want to execute the event: site.contact which should map thanks to our conventions to a site.cfc event handler and a contact() method. However, if they do not exist, the framework will look for a view called: views/site/contact.cfm and if it finds it, it will execute it! This means that just by dropping views in the views folder convention they become virtual events.

Module Enhancements You can now define an implicit defaultLayout element in the layoutSettings element of the configuration file. Very handy to save on typing!

layoutSettings = { 	defaultLayout = "MyLayout.cfm" }; 

Modules can also now have host global overrides for layouts and views. What this means is that before if you wanted to override a layout or view in a module from the parent application you had to do the following:

/layouts/modules/{moduleName}/myLayout.cfm /views/modules/{moduleName}/myView.cfm

Which affects only a specific layout or view, but what if you want to affect by default a common layout or view for several modules? Enter common module view/layout overrrides:

/layouts/modules/myLayout.cfm /views/modules/myView.cfm

This means that the /modules/myLayout.cfm will be used for all modules if a specifc module override is not found. Great to have commonality on overrides that spans accross modules.

RESTful extension detection Our ColdBox 3.0.0 series has one of the best supports for RESTful web services than any other release. With extension detection we are complete now. The SES interceptor now by default does URL extension detection via the incoming routed URL. You can turn on/off by using the new setExtensionDetection() method from your Routes.cfm template. So if an incoming URL is:

http://myapp.com/users/john.xml or http://myapp.com/users/john.json 

The interceptor will see that an extension is requested and actually create a request collection variable for you called format with the value of the extension: format=xml, format=json. The interceptor also allows for you to setup the valid extensions it should recognize. By default the interceptor recognizes the following extension list: xml, json, jsont, html, htm, rss. You can change this list by using the new method: setValidExtensions() on your Routes.cfm template.

// auto detect extensions, you don't have to do this as the default is true.
setExtensionDetection(true);

// Set xml and json as the only valid extensions for routing.
setValidExtensions("xml,json,jsont");

This is great for RESTful webservices as now your resources can have valid transformation extensions.

Unit-Integration Testing Enhancements We have updated our bases test cases to support two new methods:

  • getMockDatasource() - to retrieve mocked datasource bean objects
  • getMockConfigBean() - to retrieve a mocked configuration bean object with mock data structures
  • getMockPlugin() - to construct and return a mocked capable custom or core plugin object

Request Context Updates The way the request context was being created has been optimized and considerable speed increase was seen in our generation tests. We have also added the following new method:

  • isAjax() - Which allows you to distinguish between Ajax and non Ajax requests.

We have also added an interception point to the request context called: onRequestCapture(). This is a great interception point that will allow you to manipulate the incoming request collection before flash RAM is inflated, debug detections, event detection and most importantly event caching detection. From this interception point you can add a user's locale to the request collection on a cached event so now the cached event's entry will depend on the user's locale. You can also add in a user's jsession ID or unique identifier to allow event caching to now transcend the global space to the ANY space.

onRequestCapture(event, interceptData){
  //let's add the user's locale to the event caching mix
  event.setValue("userLocal", getFWLocale() );
}

So now that you got a look at the good stuff, let's look at the nitty gritty:

Ticket # Summary
866 Refactor Utilities plugin into more granular existing plugins, removing unused methods.(Compatibility)
931 ioc adapters finalization for common ioc factories
987 Ability to declare implicit default layout configurations for modules
997 automatic extension detection via incoming URI extension
1060 Update cache flash scope to use a setting with the name of the cache to use, else use default cache name
1073 The method lookupQuiet was not found in component coldbox.system.cache.archive.MTCacheManager.
1076 On some occassions the IDs of the rc/prc panels are colliding and not opening/closing the right row.
1079 populateFromQueryWithPrefix
1080 Modules not inheriting parent layouts/views correctly in discover algorithms
1083 new unit testing method: getMockPlugin() that gives you a plugin instance already mocked up and ready for usage or testing
1084 new requestcontext method isAjax(), tries to read the xmlhttp request header and determine if request is ajax based
1085 handler service not treating cached handlers right, so recreates them.
1086 updated approach to retrieve model objects from cache services
1087 bug on interceptorSettings for CFC configuration, the value should be customInterceptionPoints and not customInterceptors
1089 implicit view rendering with no event needed. If event does not exist but view does, then view gets dispatched
1090 Updated the AntiSamy XSS project to latest version of 1.4.1
1096 when using modulesAutoReload the module service was not clearing the setting but actually replacing, causing reference issues on startups
1097 Unecessary key iterations on configuration settings when creating request context
1098 Module common view-layout conventions so host can override view-layouts for all modules by Kalen Gibbons
1100 ioc plugin completely revamped for 3.0.0 for usage of adapters and deprecation of antiquated code (COMPATIBILITY)
1101 ioc plugin now supports parent factories on declared factories in the coldbox configuration
1102 ses new method: setValidExtensions(list) gives you the ability to set a list of extensions the interceptor will auto detect for you and place in the format variable in the request collection. This goes hand in hand with the setExtensionDetection() method.
1103 antisamy updated so you can define a custom policy file in your application settings: AntiSamy_Custom_Policy
1104 throw an invalid event exception when a non-valid or non-loaded module is detected for firing
1105 setNextEvent should support from ssl to non-ssl URL conversions
1107 New Interception point: onRequestCapture
1110 new base test helper: getMockDatasource() to return mocked datasource bean objects
1111 new base test helper: getMockConfigBean() so you can create a mocked configuraiton bean easily
1113 stringbuffer missing javacast on init() so the buffer number 16 was being inited
1114 json conversion not handling null values when encoding

Add Your Comment

Recent Entries

Into the Box 2024: Your Gateway to the Future of Tech!

Into the Box 2024: Your Gateway to the Future of Tech!

Are you ready to advance your coding skills? The future of Modern Web Development awaits at Into the Box 2024, and we're thrilled to announce that due to high demand, we're extending our Early Bird pricing for an additional week!

Maria Jose Herrera
Maria Jose Herrera
April 26, 2024
Hackers demand a ransom to restore data from my ColdFusion web applications!

Hackers demand a ransom to restore data from my ColdFusion web applications!

Hackers demand a ransom to restore data from my ColdFusion web applications!

Unfortunately, we often hear this message from clients who thought it would never happen to them... until it did. Some believed they could delay the expense of Implementing ColdFusion security best practices for one year, while others were tempted to put it off for just a few months. However, in today's rapidly evolving digital landscape, the security of web applications, including ColdFusio...

Cristobal Escobar
Cristobal Escobar
April 16, 2024
Ortus March Newsletter

Ortus March Newsletter

Welcome to Ortus Solutions’ monthly roundup, where we're thrilled to showcase cutting-edge advancements, product updates, and exciting events! Join us as we delve into the latest innovations shaping the future of technology.

Maria Jose Herrera
Maria Jose Herrera
April 01, 2024