cbdw2014 - railo 5.0 and beyond
DESCRIPTION
Gert will be sharing about the exciting future of Railo including what we have to look forward to in Railo 5. Railo is an open source CFML engine and if you're using it you'll want to come see what's in store. But even if you're not a Railo user, you'll still want to see what great innovations are happening over in Switzerland that are driving the CFML community forward and keeping us relevant.TRANSCRIPT
Railo 4.2, 5.0 and beyond
Gert Franz, CTORasia Ltd.
© 2014 – Rasia Ltd.
Rasia Ltd.?
• Railo Technologies biggest contributor forRailo Server
• Invested over 4M US$ over 8 years• New commercial branch/spin off necessary• We need a new entity in order to develop
different products for Railo and/or for otherengines
• We want to make sure Railo Server survivesthe next 10 years as promised
© 2014 – Rasia Ltd.
Rasia Ltd.?
• Rasia Ltd. was founded with in the meantime 18 developers
• Rasia Ltd. develops tools and applicationswith and for Railo
• Railo Technologies will still remain the maincontributor to Railo Server
© 2014 – Rasia Ltd.
At a glance
• Railo 4.2 – Recap• Railo 5.0 – The future of CFML• Rasia Tools – Be Productive!
– ICF– Speed Booster
Railo 4.2
Releasedat cf.objective()
Compatibility –Language & Syntax
Railo 4.2
© 2014 – Rasia Ltd.
Railo 4.2 – Language & Syntax
• New tag notation in cfscript• Before:• <cfloop from="1" to="10" index="i">• Became• loop from="1" to="10" index="i" { … }• Now becomes:• cfloop(from:1, to:10, index:"i") { … }
© 2014 – Rasia Ltd.
Railo 4.2 – Language & Syntax
• Member functions on literals:– [1,2,3,4].each( function() {} );– {key:value}.keyExists(…);– query(col:[1,2,3,4]).addRow(1);– "This is a string".len()– "susi,peter,john,doe".listToArray();
© 2014 – Rasia Ltd.
Railo 4.2 – Language & Syntax
• Subscript Operator – Use a String like an Array– Instead of:
mid("susi“, 3, 1)– You can now write:
susi[3]
Better performance and shorter syntax
© 2014 – Rasia Ltd.
Railo 4.2 – New functionality
• All above except *reduce support the argument "parallel" and "maxThreads"
Type
Function
Array Collection List Struct QueryEvery
Map
Reduce
Some
Each
© 2014 – Rasia Ltd.
Railo 4.2 – New functionality
• New member function isEmpty()
• "".isEmpty(), [].isEmpty(), {}.isEmpty()• Function len() now supports all types
Type Condition returning trueQueries record count = 0Arrays arrayLen = 0Structs key count = 0Strings empty string
© 2014 – Rasia Ltd.
Railo 4.2 – New functionality
• CFHTTP contains a new key in the resultcalled cookie
• CFFILE and CFDIRECTORY allow you tocreate the directory if it does not exist
• getCanonicalPath()– Converts
c:\this\is/a/path\..\..\susi\peterintoc:\this\is\susi\peter
Administrator Changes
Railo 4.2
© 2014 – Rasia Ltd.
Railo 4.2 – Administrator improvements
• Disabling Type checking• Lots of settings move to the
Application.cfc• Hints for the usage of these settings• Export page• New logging page
New Concepts
Railo 4.2
© 2014 – Rasia Ltd.
Railo 4.2 – New concepts
• Application.cfc– Can be used for almost EVERY setting
possible in the Railo Web Administrator– Generate export for an Application.cfc in
the administrator
© 2014 – Rasia Ltd.
Railo 4.2 – New concepts
• Problem– How do you differenciate settings
between environment & test?– How do you influence the standard
behaviour?– Ever forgotten to use the attribute
addtoken?
© 2014 – Rasia Ltd.
Railo 4.2 – New concepts
• Application.cfc allows you to definestandard values for ANY attribute– Influence display of CFDUMP– Influence mailservers or database defaults
© 2014 – Rasia Ltd.
Railo 4.2 – New concepts
• Current implementation supports SOAP– International Standard– Transport protocol, very flexible– supported by all programming languages
• BUT– Bloated XML format– Takes lots of time for conversion & serialization
© 2014 – Rasia Ltd.
HTTP - Webservices
• HTTP Webservices– Very lightweight– Very fast– Railo specific ATM
– Autodetection of Railo HTTP Webservices
The future of CFML
Railo 5.0
© 2014 – Rasia Ltd.
Railo 5.0
What is the focus?• Performance• Stability• Language improvements• Ease of use
Architecturalchanges
Railo 5.0 – Main features
© 2014 – Rasia Ltd.
Railo 5.0
• Current problem– An application needs a JAR file, but the
JAR file collides with an existing one– Updating JAR libaries– No way to manage jar libaries
programmatically
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• Solution: OSGi– Open Service Gateway initiative (2000)– A framework that manages libraries
(bundles and versions)– Allows you to load libraries in different
versions, all at the same time
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• OSGi in Railo 5.0– COMPLETE rewrite of the architecture– Enterprise market requirement– Everything in Railo 5.0 is OSGi
• Core• Extensions• JAR files
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• OSGi in Railo 5.0– Better stability– Higher performance– All libraries used by Railo are bundles– Possible to load/unload and start/stop
any library at any time
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• OSGi in Railo 5.0– New set of functions that allow you to the power of this
new functionality
// load a class in a specific versiondtf=javaLoad(bundle:"org-joda-time", version:"2.1.0", class:"org.joda.time.format.DateTimeFormat“
);
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• OSGi in Railo 5.0– New set of functions// load a class in a specific versiondtf=javaLoad(bundle:"org-joda-time", version:"2.1.0", class:"org.joda.time.format.DateTimeFormat“
);or
oJavaClass = createJavaProxy(className, jarFile, OSGi bundle, version of the OSGi bundle);
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
JSR 223
• Wikipedia says: "JSR 223 is a framework forembedding scripts into Java source code"
• Oracle already included Javascript as of Java 6
• Can be called from the command line like:>jrunscript something.js
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
JSR 223
• Why not be able to call:>jrunscript –f cfml commandbox/Bootstrap.cfm
Or>jrunscript –f cfml
cfml>fileCopy(source, destination)cfml>
• Might have a bigger impact on CommandBox
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
Syntax changes
Railo 5.0 – Main features
© 2014 – Rasia Ltd.
Railo 5.0 – Syntax Changes
• Introduction of Lambda functions– Shorhand notation for closures– Check out the example
• Further operators & operatoroverloading
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Syntax Changes
• New accessors for component members• Try this:
component {this.displayName = "myCmpn";private this.version = "1.0";static {
private static.susi = 1;}
}• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Syntax changes
• Component iterators:– By implementing the methods:
• _hasNext(), _next(), _reset()
– You now can do:
oObjList = new someObjList("customers");for(oCustomer in oCustomerList) {
oCustomer.raiseInvoice();}
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Syntax changes
• New type of variable declarationvar qry, susi, peterorlocal.qry, local.susi, local.peter
Is equal to:var qry = null;var susi = null;var peter = null;
orvar qry = ""var susi = ""var peter = ""
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Syntax changes
• New type of variable declarationvar susi=4, var peter = 6, var qry = 7;
Or of course:
local.susi=4, local.peter = 6, local.qry = 7;
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Inline components
• Now it is possible to define helpercomponents within one line:
// Closure componentsoMyComponent = component {
function getData() {
}};
oMyComponent.getData();
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
Componentenhancements
Railo 5.0 – Main features
© 2014 – Rasia Ltd.
Component enhancements
• Current problem– creating components either as singletons
or transients– No way for transients to store global data
valid for all instances of the component
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Component enhancements
• New keyword: static– Allows you to define
• a static constructor• static data, shared amongst ALL instances of
the SAME component• Static functions
– For static functions a new operator isdefined
• MyComponent::myStaticFunction();• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Component enhancements
• Abstract and final components andfunctions– Abstract components & functions have to
be inherited– Much better to use than interfaces– Final components & functions can not be
inherited
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Component enhancements
• Inline components– Usable for very simple components– Saves file operations– Increase in performance– Allows definition of multiple components
in ONE cfc
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Component casters
• Existing ones– _toString()– _toNumeric()– _toDateTime()– _toBoolean()
• New ones– _toStruct()– _toArray()– _toQuery()– _toJSON()
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Component enhancements
• Operators– _compare(obj): number– _contains(obj): boolean
• Allows you to do:oObj = new someObj();oObj2 = new someOtherObj();if (oObj gt oObj2) {}
Or
oObj.append(); // for arrays• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
Java interaction
Railo 5.0 – Main features
© 2014 – Rasia Ltd.
Java enhancements
• component extendsjava="java.io.file"• cfscript language="java"• call Railo directly from java• Interaction with java code• Drop Java Reflection
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
© 2014 – Rasia Ltd.
Scripting support JSR 223
• Allows executing any script type insidea cfscript type– Groovy– Scala– Javascript– Python– Ruby, etc.
• Architectural changes• Syntax changes• Component enhancements• Java interaction• Improved extendibility
Improvedextendibility
Railo 5.0 – Main features
© 2014 – Rasia Ltd.
Improved extendibility
• New way to write extensions– Convention based– Auto deployment possible
• You simply drop files into a certain folder– Manifest file
• Contains metadata of an autodeploy extension• Dependencies between extensions• Preconditions (e.g. requires Railo 5.0)
Railo 5 will do the rest…• Architectural changes• Syntax changes• Java interaction• Component enhancements• Improved extendibility
Be producive!
Rasia Tools
© 2014 – Rasia Ltd.
Applications – Problem
• Every application collects data fromexternal resources
• Depending on cache settings, data isconstantly requested or not
• There is no real overview of what dataa server requests from any externalresources
© 2014 – Rasia Ltd.
Possible solution
• Idea for a tool:– When enabled, checks all external
resources, whether the data has changedsince the last access
– Determines dependencies (session, application, independent)
– Displays potential cache candidates– Allow the user to select which candidate
data to cache and for how long
© 2014 – Rasia Ltd.
Possible solution
• Analyzing data (eg. Queries)– Get the input parameters (SQL,
Datasource, Session, Application etc.) determine entry hHash
– Analyze the result (determinedependency & resulthash)
– Store the change interval and themetadata
Say "hello" to
Booster
Rasia Tools
© 2014 – Rasia Ltd.
Rasia – Booster
• Caching of – Queries– Functions– Includes– HTTP calls– Files, Directories– Web Service Calls– Etc.
© 2014 – Rasia Ltd.
Rasia – Booster
• Apply rules– At the moment makes use of
cachedWithin="smart"– If there is a rule for this inputHash, apply
the rule according to the selection– Store statistics– Activate boost!!!
© 2014 – Rasia Ltd.
Rasia – Boost UI
• Implemented as a Railo Admin plugin• Offers overview for Entries, Rules• Several Statistics and time estimates
• Rasia Boost is available of course forRailo 5.x
• But why not…
© 2014 – Rasia Ltd.
Rasia – Tools
• Make Boost available for ANY JVM application?– Groovy– Native Java app– ColdFusion
© 2014 – Rasia Ltd.
JVM - Boost
© 2014 – Rasia Ltd.
JVM - Boost
First project along the way:
Say "hello" to
ICF
Rasia Tools
© 2014 – Rasia Ltd.
Rasia – ICF
• Railo > 3.0 allows you to use different kinds of Cache providers– Local or remote– Clustered or not
• ACF is only able to talk to EHCache– Local– and with a tougher configuration remote
© 2014 – Rasia Ltd.
Rasia – ICF
• ICF allows you to use– Infinispan– With ColdFusion 9, 10 and 11– By using the usual functions
• CacheGet()• CachePut()• CacheDelete(), etc.
© 2014 – Rasia Ltd.
Rasia – ICF
• We created an Installer for ACF• Allows you to install Extensions just like
the extension provider in Railo• Will be released as a separate product
© 2014 – Rasia Ltd.
Installer
© 2014 – Rasia Ltd.
Installer
© 2014 – Rasia Ltd.
Installer
© 2014 – Rasia Ltd.
Installer
© 2014 – Rasia Ltd.
Questions?
• http://www.getrailo.org• http://www.getrailo.com• http://groups.google.com/group/railo• https://github.com/getrailo/railo• http://issues.jboss.org/jira/browse/RAILO• www.rasia.info