Weitere ähnliche Inhalte Ähnlich wie CBDW2014 - Railo 5.0 and Beyond (20) Mehr von Ortus Solutions, Corp (20) Kürzlich hochgeladen (20) CBDW2014 - Railo 5.0 and Beyond2. © 2014 – Rasia Ltd.
Rasia Ltd.?
• Railo Technologies biggest contributor for
Railo 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 other
engines
• We want to make sure Railo Server survives
the next 10 years as promised
3. © 2014 – Rasia Ltd.
Rasia Ltd.?
• Rasia Ltd. was founded with in the mean
time 18 developers
• Rasia Ltd. develops tools and applications
with and for Railo
• Railo Technologies will still remain the main
contributor to Railo Server
4. © 2014 – Rasia Ltd.
At a glance
• Railo 4.2 – Recap
• Railo 5.0 – The future of CFML
• Rasia Tools – Be Productive!
– ICF
– Speed Booster
7. © 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") { … }
8. © 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();
9. © 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
10. Function
Every
Map
Reduce
Some
Each
© 2014 – Rasia Ltd.
Railo 4.2 – New functionality
Type
Array Collection List Struct Query
• All above except *reduce support the
argument "parallel" and "maxThreads"
11. Type Condition returning true
Queries record count = 0
Arrays arrayLen = 0
Structs key count = 0
Strings empty string
© 2014 – Rasia Ltd.
Railo 4.2 – New functionality
• New member function isEmpty()
• "".isEmpty(), [].isEmpty(), {}.isEmpty()
• Function len() now supports all types
12. © 2014 – Rasia Ltd.
Railo 4.2 – New functionality
• CFHTTP contains a new key in the result
called cookie
• CFFILE and CFDIRECTORY allow you to
create the directory if it does not exist
• getCanonicalPath()
– Converts
c:thisis/a/path....susipeter
into
c:thisissusipeter
14. © 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
16. © 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
17. © 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?
18. © 2014 – Rasia Ltd.
Railo 4.2 – New concepts
• Application.cfc allows you to define
standard values for ANY attribute
– Influence display of CFDUMP
– Influence mailservers or database defaults
19. © 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
20. © 2014 – Rasia Ltd.
HTTP - Webservices
• HTTP Webservices
– Very lightweight
– Very fast
– Railo specific ATM
– Autodetection of Railo HTTP Webservices
22. © 2014 – Rasia Ltd.
Railo 5.0
What is the focus?
• Performance
• Stability
• Language improvements
• Ease of use
24. © 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
25. © 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
26. © 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
27. © 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
28. © 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 version
dtf=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
29. © 2014 – Rasia Ltd.
Railo 5.0 – Architectural changes
• OSGi in Railo 5.0
– New set of functions
// load a class in a specific version
dtf=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
30. © 2014 – Rasia Ltd.
JSR 223
• Wikipedia says: "JSR 223 is a framework for
embedding 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
31. © 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
33. © 2014 – Rasia Ltd.
Railo 5.0 – Syntax Changes
• Introduction of Lambda functions
– Shorhand notation for closures
– Check out the example
• Further operators & operator
overloading
• Architectural changes
• Syntax changes
• Component enhancements
• Java interaction
• Improved extendibility
34. © 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
35. © 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
36. © 2014 – Rasia Ltd.
Syntax changes
• New type of variable declaration
var qry, susi, peter
or
local.qry, local.susi, local.peter
Is equal to:
var qry = null;
var susi = null;
var peter = null;
or
var qry = ""
var susi = ""
var peter = ""
• Architectural changes
• Syntax changes
• Component enhancements
• Java interaction
• Improved extendibility
37. © 2014 – Rasia Ltd.
Syntax changes
• New type of variable declaration
var 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
38. © 2014 – Rasia Ltd.
Inline components
• Now it is possible to define helper
components within one line:
// Closure components
oMyComponent = component {
function getData() {
}
};
oMyComponent.getData();
• Architectural changes
• Syntax changes
• Component enhancements
• Java interaction
• Improved extendibility
40. © 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
41. © 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 is
defined
• MyComponent::myStaticFunction();
• Architectural changes
• Syntax changes
• Component enhancements
• Java interaction
• Improved extendibility
42. © 2014 – Rasia Ltd.
Component enhancements
• Abstract and final components and
functions
– 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
43. © 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
44. © 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
45. © 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
47. © 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
48. © 2014 – Rasia Ltd.
Scripting support JSR 223
• Allows executing any script type inside
a cfscript type
– Groovy
– Scala
– Javascript
– Python
– Ruby, etc.
• Architectural changes
• Syntax changes
• Component enhancements
• Java interaction
• Improved extendibility
50. © 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
52. © 2014 – Rasia Ltd.
Applications – Problem
• Every application collects data from
external resources
• Depending on cache settings, data is
constantly requested or not
• There is no real overview of what data
a server requests from any external
resources
53. © 2014 – Rasia Ltd.
Possible solution
• Idea for a tool:
– When enabled, checks all external
resources, whether the data has changed
since 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
54. © 2014 – Rasia Ltd.
Possible solution
• Analyzing data (eg. Queries)
– Get the input parameters (SQL,
Datasource, Session, Application etc.)
determine entry hHash
– Analyze the result (determine
dependency & resulthash)
– Store the change interval and the
metadata
56. © 2014 – Rasia Ltd.
Rasia – Booster
• Caching of
– Queries
– Functions
– Includes
– HTTP calls
– Files, Directories
– Web Service Calls
– Etc.
57. © 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!!!
58. © 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 for
Railo 5.x
• But why not…
59. © 2014 – Rasia Ltd.
Rasia – Tools
• Make Boost available for ANY JVM
application?
– Groovy
– Native Java app
– ColdFusion
63. © 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
64. © 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.
65. © 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
70. © 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