Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Calling controller from controller
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nando  
View profile  
 More options Apr 9 2012, 12:37 pm
From: Nando <d.na...@gmail.com>
Date: Mon, 9 Apr 2012 18:37:15 +0200
Local: Mon, Apr 9 2012 12:37 pm
Subject: Re: [framework-one] Calling controller from controller

Thanks very much for this comprehensive reply, Sean. It's inspired me to
look deeper into cfmljure and clojure.

On Sat, Apr 7, 2012 at 3:37 AM, Sean Corfield <seancorfi...@gmail.com>wrote:

> On Fri, Apr 6, 2012 at 3:08 AM, Nando <d.na...@gmail.com> wrote:
> > That sounds very interesting. What about sql type? Is that handled
> > automagically by the Clojure JDBC library?

> Sort of. The underlying JDBC driver actually verifies / coerces the
> types to some degree but you can't pass a string ("123") where an
> integer is expected. Luckily Railo actually keeps numbers as numbers
> and dates as dates (instead of converting back and forth to strings
> like ACF does) so interop between Railo and Clojure is seamless and
> when you pass data down to the JDBC layer, it's already the right
> type. It does mean that you need to be a bit more careful about types
> in your own code, e.g., calling val() on form & URL variables that are
> supposed to be numeric and parseDateTime() or similar for dates, but
> that's just good practice anyway - and should make your code run
> faster.

> > The only way I can think to deal with sql type if the approach you
> describe
> > were implemented in CF would be some sort of hungarian notation

> Ugh! Horrible idea. Having worked with the Clojure wrapper around
> JDBC, I actually find CFML's cfqueryparam stuff to be horribly bulky
> and redundant - the driver knows what types the columns are so a
> simple parameterized SQL statement should not need any additional type
> information. Here's a typical SQL query:

> variables.orm.createIterator(
>                                name = "user",
>                                sql = "SELECT * FROM user WHERE siteId = ?
> AND username LIKE ?",
>                                params = [ siteId, pattern ]
>                        );

> That calls orm.execute( sql, params ) - which drops down thru Clojure
> to a PreparedStatement in Java - and returns a sequence of maps (think
> array of structs in CFML). The name parameter specifies what bean type
> to use (i.e,. which CFC to instantiate) and that is initialized with
> the sequence and marked as an iterator. Standard methods hasMore() and
> getNext() implement the iterator pattern. The getters return
> data[currentRow][colName]. Setter update the dirty struct. Calling
> save() performs an update based on the dirty struct.

> There is no code generation here, BTW.
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/

> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)

> --
> FW/1 on RIAForge: http://fw1.riaforge.org/

> FW/1 on github: http://github.com/seancorfield/fw1

> FW/1 on Google Groups: http://groups.google.com/group/framework-one

--
Nando Breiter

*Aria Media
via Rompada 40
6987 Caslano
Switzerland
*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.