I come from a Fireworks background and know enough about
architecting databases to be dangerous. I've taken to learning Flex
2 via books, tutorials etc and understand most of the front-end
aspects of it. However, I now want to connect to a MySql Database
and can't believe how difficult/complicated it seems.
On the assumption that it is the easiest to learn, I've gone
with cfusion 8, installed it locally and have set up data sources
(to mysql on a different networked machine). As I understand it,
flex can talk directly to cfusion which then talks to mysql -- fair
enough. To do so flex essentially uses an ActionScript class to
talk to a coldfusion component, right? Thus what the Flex wizards
do is create and/or relate to each other these .as and .cfc files
(same as if I created a cfc in say Dreamweaver)?
Now, are these wizard relations "strongly typed"? And
shouldn't the cfc's be saved to the CF server root? Also, the
wizard created cfcs seem to have the sql code right in them --
which I've read/been told is a security issue (i.e. use stored
I've just installed Flex 3 and spend the day trying to ensure
set up etc -- but I've read about Flex DataServices, Blaze,
LiveCycle and RDS (plus the Flex Coldfusion extensions). Frankly I
don't know if I have one or more of these installed or which ones
the wizards use or how to differentiate between them etc etc.
Is there any site/guide/tutorial that starts at a really
intro/installation level where I can at least get a foundation to
work from? I don't mind bludgeoning my way through but without some
sort of guide I fear my learning curve is problematic.
At the moment I'm thinking of learning how to create my
entire site in non-Flash/Flex cfcs in dreamweaver first. This way
too, much of my business rules/logic can be in the "model/dbase".
Presumably that will allow me to create the cfusion to dbase
connectivity, after which I can use the flex wizard to build the as
class from cfc right? But even then, IMHO the connectivity to Flex
seems difficult (error handlers, Remote Objects etc) and lengthy.
But am I missing some part of the puzzle? Thanks in advance
for any feedback
Yeah, that is the problem with "Flex"ibility, there are too
damn many choices.
Your best bet is hit google for some examples and decide
which seems best for you.
In my opinion, the simplest setup is to have your server
respond with XML, use HTTPService in flex, with resultFormat="e4x".
This is because you can solve the problem in pieces:
* Build your server side functionality to take a request,
query the db (use a stored proc if you like), and return XML.
* hit your server url with a request from a browser, and see
* Build the Flex UI using hard coded XML(referenced in a
variable), using the same format as you see in the browser.
* Use HTTPService to hit the server url with the same
querystring you used in the browser
* then replace the hard coded xml with the results from the
The benefit of this approach is you can make each part work,
without having to have the whole thing work. If you go this way, I
have some sample code.
But this just one of many possible approaches. Maybe instead
of a platform named "Flex", we need a platform named "DoThis"!