Leveraging ColdFusion's Java Foundation
īģŋ7/8/08
Types
? Types map to runtime classes
? Struct: java.util.Map: coldfusion.runtime.Struct
Leveraging ColdFusion's Java Foundation
? Array: java.util.List: coldfusion.runtime.Array
? Query: coldfusion.runtime.QueryVector
? List: java.lang.String
Elliott Sprehn
elliott@
? String: java.lang.String
? Number: java.lang.String, java.lang.Integer, java.lang.Double
? Component: coldfusion.runtime.TemplateProxy (more about this later)
? Java Object: coldfusion.runtime.java.JavaProxy
? Casting Handled by coldfusion.runtime.Cast
Structs (java.util.Map)
Specialized Structures
? Can use methods of Map
? TreeMap / LinkedHashMap
? get(key)
? put(key,value)
? putAll( struct )
? Same as structAppend() but without option to not replace
? containsKey( key )
? containsValue( value )
? DoesnĄ¯t work well on complex data types like CFCs
Note: these donĄ¯t enforce string keys!
? Preserve order of inserted keys
? IdentityHashMap
? Uses key identity instead of equality.
? Stack / Queue
? More complex data structures with better performance!
? Not Synchronized!!!
? Unpredictable behavior if methods used across threads.
? Need to use Collections.synchronizedMap() to fix this.
? Not always a good idea to sync it.
? Slower / Loses some methods that may be specific to type
1
7/8/08
How would we (re)implement the Struct type?
Lists (java.util.List)
? Can use methods of List
LetĄ¯s see the code!
StructDo() ?
?
?
?
?
?
?
get(key)
add(value)
addAll( array )
set( index, value )
contains( key )
indexOf( value )
? DoesnĄ¯t work well on complex data types like CFCs
Note: Indexes start at ZERO!
Reference Arrays
Queries (java.sql.ResultSet)
? By default arrays are copied on assignment
? Lots of hidden functions
? Java collection types are NOT copied!
? Improve performance
? Can use this to create an array collection that is passed
around and modified.
? Dangerous in non-trusted code... assumptions.
? What is there?
? java.util.LinkedList
? java.util.ArrayList
? java.util.Vector
? Only synchronized list available.
?
?
?
?
?
?
getColumn()
getString() / getDate() / getInt() ...
wasNull()
isBeforeFirst() / isBeforeLast()
isFirst() / isLast()
first() / last()
? Columns are their own data type!
? Usable like arrays
? bound to parent table
? Support isnĄ¯t totally complete...
? DoesnĄ¯t support a lot of methods
2
7/8/08
The toString() Method
Lets look at some code...
? Returns a joined representation of List and Map
? Awesome for cache keys
? Very very fast.
? Can also use serializeJSON() in CF8.
? CanĄ¯t use ToString() ColdFusion function because it expects
simple values.
? ToString(struct) ERROR!
? struct.toString() OK!
Note: Not useful for queries because output doesnĄ¯t contain column values.
Questions
?
3
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- what s new and changed in coldfusion 2018 release public
- adobe coldfusion 10 server lockdown guide
- practical usage of regular expressions an introduction to
- approaches to secure cfml code pete freitag coldfusion
- adobe coldfusion sfmfbtf
- leveraging coldfusion s java foundation
- performance whitepaper adobe
- creating your first coldfusion template
- file management search and replace keyboard shortcuts for
- cfml language reference for coldfusion express
Related searches
- best foundation for women over 60 2018
- best foundation for mature skin
- best foundation for older women
- cares foundation sacramento
- water foundation sacramento
- qatar foundation for education
- best foundation for senior women
- best foundation for women over 50
- best age defying foundation makeup
- water education foundation california
- best foundation for mature skin 2019
- colorado foundation for water education