1 Reply Latest reply on Feb 5, 2008 11:08 PM by Ratsnackbar

    Newbie Conceptual Questions

    ProjectedSurplus Level 1
      I am working my way through The Essential Guide to Flex 2 with ActionScript 3.0 and have a couple of questions:

      1. When importing packages/classes what is the best way to organize them (in terms of file hierarchy and import defaults)? Specifically, assuming I installed flex builder 2 with all the defaults then it defaults to (I think) putting the "standard" packages into C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\lib where would best practices be to save new packages to? Also, is there a way/is it advisable to default import new packages when a new Flex Project is created?

      2. When creating a new Flex project it defaults to storing that in /MyDocuments. However, if I want to use ColdFusion 8 (running locally) do I need/advisable to create the project in c:ColdFusion/wwwroot ? (and hence inetpub on an IIS server eventually) FWIW this is what Dreamweaver seems to do but I am not an expert at that program either (Fireworks graphic artist learning programming atm).

      3. Apparently: "This new model [XML] is so prevalent that Macromedia stripped the capability of Flex and Flash to access a database directly. In its place are a number of class files that allow for the easy access of XML files." I understand the benefits of XML for say third party API's but for data from my own database surely it is not beneficial to interpose XML. Is this what RDS is/does? (i.e. an Adobe proprietary method of communicating to cfusion using AMF?????)

      4. If so, what is BlazeDS?

      Thanks in advance,
        • 1. Re: Newbie Conceptual Questions
          Ratsnackbar Level 2
          Note Sure I can help with question #1. Perhaps I do not understand what you are asking. I tend to use only the default packages for flex and if there is anything else I need I build it myself. At least for now while I am somewhat new to Flex.

          As for Question #2 the /myDocuments folder is used only for the Eclipse workspace where your project files are kept. These are the pre-compiled source files of your project. When you create your project you can also specify where Flex is going to publish your files too. Normally I have it publish directly to the projects folder in my web servers wwwroot so I do not have to bother copying the files to it afterwards to test. I would suggest this method as you can also specify the URL to test your files out of. That way when you build it will compile to your wwwroot/webfolder and launch directly out of there. If everything works and once your done with your project you can just FTP directly out of your test servers folder your compiled SWF is in.

          Question number 3 is more a matter of who Adobe's Audience is. Flex was never meant to be a Middleware Server. It was developed as a Presentation server to make it easier to build RIA's. This client side code would then make use of a Server Side Middleware server to process data, persist the data in a database or do something else with it like forward it to an E-Mail server (ect...). ColdFusion of course is the obvious choice of a MiddleWare server for many reasons but not the only choice. (There are those who must suffer inferior languages so that we who use ColdFusion have someone to laugh at. ;)

          ColdFusion only holds between .5 and 5% of the web middleware market depending on who you ask. It is more often found in Intranet's for Mega Corporations who do not flinch at it's price. As there is no real way to report on those numbers ColdFusion's marketshare could be much larger. Only Adobe knows but because they keep supporting it that's a good clue.

          A great majority of the Web is Stuck using PHP, ASP, Ect.... and the most common method of interchanging data between them is XML. Because of this Adobe (and most of your tutorials you will find.) tend to focus on the use of XML. XML has it's uses but using AMF is by far faster and in most cases I have found it is also much better. Because Adobe has control of ColdFusion it was an obvious choice to allow ColdFusion to interchange data with Flex over AMF. Macromedia had already build into ColdFusion, functionality to work with Flash so it was also not a difficult thing for them to do. Thus CF8 already has everything needed to talk to Flex Built in. Not so with PHP and other languages however there are many projects on the web to provide this functionality. For example there is now a connector for PHP to use AMF. (On a side note it is also now possible to run PHP code wrapped in CF code and I hear you can do the same now with Ruby. PHP is so Screwed.)

          RDS (Remote Development Server) was originally intended for ColdFusion Studio to be able to contact the ColdFusion Server and acquire information from it regarding things such as what databases were available and details of the tables within. It has grown to encompass much more then that. In the case of Flex it is what allows Flex Builder to talk to the ColdFusion server so that you can introspect the databases, CFC and other available resources. RDS is something only for developers and would be turned off in a Production environment (that's the short version.)

          There is a way to connect Flex directly to a MySQL server now apparently. I have not looked into it but I imagine it would only be useful in standalone applications. In most cases you will not want this. ColdFusion and other such server based Middle Ware is a far more efficient and secure way to connect to a database. When using ColdFusion the recommended way to talk to the server is over AMF3 using Flash Remoting/RemoteObjects if you do NOT need Push technology and Live Cycle Data Services (Formerly Flex Data Services) if you do. It's not only faster but allows for you to have Strongly Typed Objects sent from the ColdFusion server. (Another benefit is CF already has methods built in to allow you to talk to multiple different data sources. Not just database but Email servers, Other webservices, ftp, http, ldap servers, on and on and on........Can you tell I like CF8 yet?)

          Your answer to question #4 is that BlazeDS is Adobe's Open Source release of Live Cycle Data Services. If you are using ColdFusion 8 it has Live Cycle Data Services built into it however unless you hold a license you do not get Multi Threading with it and you are actually using a stripped down version. Either way I see no reason for using Blaze DS unless there is a significant update to it that makes it in some way better then what is built into CF. (Or perhaps cheaper then an Enterprise license of LCDS) If you were using something like Ruby for your MiddleWare then perhaps. (If you are using ASP just shoot yourself now and get it over with.)

          (I think this is mostly correct. If some [or all] of the details are wrong or way off please anyone feeling like correcting me do so. Except the part about ASP as you really don't want to have to admit that you use it. ;)