I've been following this conversation, and I'm wondering if we aren't making too many assumptions. Let me get really basic (If it's too basic, sorry!)
For all web applications you have a browser and a server that talk via the Internet. The web is a special case of Client - Server computing. Web Browser <--Internet--> Web Server This is great for static content like HTML, but what if you want to talk to a database? The answer is to extend the Web Server like this: Browser <--Internet--> Web Server <--> Application Server <--> Database The browser still talks to the web server, but sometimes the information from the browser is passed to the application server. And, the application server can talk to the database. ColdFusion is one type of application server which has some advantages for working with Flex. The browser has no way to connect to the database -- It can only talk to the Web Server. But, the Web Server can use the application server to get data from the database, and send it back to the browser. So, it seems like the browser can see the database! The only catch is that someone has to program the application server to do the work. This is all great, but there was a problem. Browsers were never designed for building rich user interfaces like the ones you see in desktop applications! Flex was born to solve this problem. (Flash) <-> Browser <--Internet--> Web Server <--> Application Server <--> Database Flex is a programming tool for creating a Flash movie that runs inside the browser. With this approach you can build much nicer applications that really make life easier for the user. One question you asked was why can't Flex talk to the database. Well, Flash can only talk to the browser (Remember Flex is only a development tool for creating Flash). And, the browser can only talk to a web server. So, nothing on the client side can talk directly to the database! You also asked why you need ColdFusion. Well, the application server CAN talk to the database, and ColdFusion is one type of application server. You don't have to use ColdFusion, but you do need some kind of application server. There are several ways Flex can talk with the web server to get data: - HTTP (This is just like a normal communication between the browser and server) - XML - Sending XML data back and forth - Web Services like SOAP - Remote Objects (AMF) ColdFusion and most other application servers can do all of these. But, I know all the options make it kind of confusing at first. One other thing. Nobody mentioned the Flex/ColdFusion Application wizard in FlexBuilder: http://www.adobe.com/devnet/coldfusion/articles/wizards.html You point the wizard to your database, and it creates an example application for you! Adobe set this up to show the best practices, so it can seem like a lot to do something simple. But, maybe it will help. Here's another article that covers a Flex/ColdFusion example: http://coldfusion.sys-con.com/node/256076 So, I hope this helps -- Good Luck! Clarke -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Laurence MacNeill Sent: Tuesday, April 07, 2009 3:36 AM To: [email protected] Subject: Re: [AFFUG Discuss] An example, perhaps? At 09:15 PM 4/6/2009, you wrote: >If I am understanding this discussion that you are trying to learn >Flex and CF at the same time is an accurate statement then I would >have to make the following recommendation. > >1. You should totally get involved with attending our monthly AFFUG meetings. >2. You might want to try this strictly in CF before trying to hook >into FLEX. Write your code in CF to where you are comfortable with >the functionality as you have describe so far. A returning >recordset with pagination and save, add function. >3. Get comfortable writing CFC's in CF and learn remote functions/methods >4. Search and or study how you can use web services, remote >procedure calls and http requests to interact with Flex. I do appreciate those suggestions, thanks. And I do have plans to attempt to make the next meeting on April 29th. But I definitely need to make some serious progress before then... I'm not sure I have the time to learn CF first... I didn't know learning CF would be required when I started learning Flex. (They really should list that as a pre-requisite on the Flex website, if it's truly that necessary.) I really have no desire to learn CF at all... I guess I've got to buy some CF books. Anyone have any good suggestions? Secondly -- you say that I can do this strictly in CF, yes? So why use Flex at all? I'm not trying to be a smart-ass here -- it just seems a bit redundant to me, to have the same functionality in both environments... I want to accomplish this task with little or no CF, really. I know that CF is needed to act as a "gateway" between my Flex app and the SQL database, fine -- but isn't there a "generic" or "automatic" way to just get CF to handle the requests from the Flex app? Do I really have to write everything in CF first, then "port" it to Flex? It still seems so overly complicated to me... Thirdly -- I definitely work best by example. Can anyone point me to some code that will do what I am trying to do in the example I posted above? The simple Flex app I mentioned that reads from my SQL table and allows me to display and edit it, one record at a time? Thanks, Laurence MacNeill Mableton, Georgia, USA ------------------------------------------------------------- To unsubscribe from this list, simply email the list with unsubscribe in the subject line For more info, see http://www.affug.com Archive @ http://www.mail-archive.com/discussion%40affug.com/ List hosted by http://www.fusionlink.com ------------------------------------------------------------- ------------------------------------------------------------- To unsubscribe from this list, simply email the list with unsubscribe in the subject line For more info, see http://www.affug.com Archive @ http://www.mail-archive.com/discussion%40affug.com/ List hosted by http://www.fusionlink.com -------------------------------------------------------------
