+ All Categories
Transcript
Page 1: CBDW2014 - Railo 5.0 and Beyond

Railo 4.2, 5.0 and beyond

Gert Franz, CTORasia Ltd.

Page 2: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 3: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 4: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

At a glance

• Railo 4.2 – Recap• Railo 5.0 – The future of CFML• Rasia Tools – Be Productive!

– ICF– Speed Booster

Page 5: CBDW2014 - Railo 5.0 and Beyond

Railo 4.2

Releasedat cf.objective()

Page 6: CBDW2014 - Railo 5.0 and Beyond

Compatibility –Language & Syntax

Railo 4.2

Page 7: CBDW2014 - Railo 5.0 and Beyond

© 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") { … }

Page 8: CBDW2014 - Railo 5.0 and Beyond

© 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();

Page 9: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 10: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 11: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 12: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 13: CBDW2014 - Railo 5.0 and Beyond

Administrator Changes

Railo 4.2

Page 14: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 15: CBDW2014 - Railo 5.0 and Beyond

New Concepts

Railo 4.2

Page 16: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 17: CBDW2014 - Railo 5.0 and Beyond

© 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?

Page 18: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 19: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 20: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

HTTP - Webservices

• HTTP Webservices– Very lightweight– Very fast– Railo specific ATM

– Autodetection of Railo HTTP Webservices

Page 21: CBDW2014 - Railo 5.0 and Beyond

The future of CFML

Railo 5.0

Page 22: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Railo 5.0

What is the focus?• Performance• Stability• Language improvements• Ease of use

Page 23: CBDW2014 - Railo 5.0 and Beyond

Architecturalchanges

Railo 5.0 – Main features

Page 24: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 25: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 26: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 27: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 28: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 29: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 30: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 31: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 32: CBDW2014 - Railo 5.0 and Beyond

Syntax changes

Railo 5.0 – Main features

Page 33: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 34: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 35: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 36: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 37: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 38: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 39: CBDW2014 - Railo 5.0 and Beyond

Componentenhancements

Railo 5.0 – Main features

Page 40: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 41: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 42: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 43: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 44: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 45: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 46: CBDW2014 - Railo 5.0 and Beyond

Java interaction

Railo 5.0 – Main features

Page 47: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 48: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 49: CBDW2014 - Railo 5.0 and Beyond

Improvedextendibility

Railo 5.0 – Main features

Page 50: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 51: CBDW2014 - Railo 5.0 and Beyond

Be producive!

Rasia Tools

Page 52: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 53: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 54: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 55: CBDW2014 - Railo 5.0 and Beyond

Say "hello" to

Booster

Rasia Tools

Page 56: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Rasia – Booster

• Caching of – Queries– Functions– Includes– HTTP calls– Files, Directories– Web Service Calls– Etc.

Page 57: CBDW2014 - Railo 5.0 and Beyond

© 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!!!

Page 58: CBDW2014 - Railo 5.0 and Beyond

© 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…

Page 59: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Rasia – Tools

• Make Boost available for ANY JVM application?– Groovy– Native Java app– ColdFusion

Page 60: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

JVM - Boost

Page 61: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

JVM - Boost

Page 62: CBDW2014 - Railo 5.0 and Beyond

First project along the way:

Say "hello" to

ICF

Rasia Tools

Page 63: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 64: CBDW2014 - Railo 5.0 and Beyond

© 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.

Page 65: CBDW2014 - Railo 5.0 and Beyond

© 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

Page 66: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Installer

Page 67: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Installer

Page 68: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Installer

Page 69: CBDW2014 - Railo 5.0 and Beyond

© 2014 – Rasia Ltd.

Installer

Page 70: CBDW2014 - Railo 5.0 and Beyond

© 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


Top Related