26 Replies Latest reply on Jun 2, 2009 1:41 PM by Ansury

    Why Flex: What Flex can do, but HTML/AJAX can not?

    2009 Matt Level 1

      I want to understand the position of Flex in RIA competition. I used Flex because of AdvancedDataGrid and the Charts. It is impossible for HTML to do some thing like these.

       

      The Transition Effects are nice, but not important in enterprise environment. The initial loading time of Flex is much longer than that of HTML although Flex is more reponsive than HTML/AJAX after Flex is loaded.

       

      Any comments?

        • 1. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
          *Prashant Shelke* Level 4

          I would like to say only Flex is beyod AJAX You cannot give blame to initial loading time as there are lots of ways to make this less

          like using mouleLoader & much more..


          If you want to feel real power of Flex, go for OLAP dataGrid capabilities & CS in gumbo(Flex 4.0) Caching on a client side you can do efficiently with Flex instead of asking each & everything to Server.


          Here is few link list:

          http://www.inkriti.com/ideas/whitepaper_ajax_vs_flex

          http://www.adobe.com/newsletters/edge/february2008/articles/article4/index.html

          http://anthonyfranco.wordpress.com/2007/06/22/flex-and-ajax-friends-or-foes/

          http://ntt.cc/2008/02/12/flex-vs-ajax%E2%80%94both-have-their-pros-and-cons.html


          Thanks.

          1 person found this helpful
          • 2. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
            2009 Matt Level 1

            Caching data on client side is not a good approach unless the data can be pushed from server to client when the

            data is updated on the server side, like LCDS does. LCDS is expensive. I do not know other means to push data from server to Flex on

            client asynchronously. Am I missing something?

            • 3. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
              Michael Borbor Level 4

              BlazeDS contains a subset of features of LCDS and is for free. Caching data

              is used on regular Web Apps too, where info doesn't change too often, or in

              order to improve performance.

              • 4. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                JeffryHouser Level 4

                ColdFusion will do a server push to client.

                 

                I think WebORB Will do it too, as will GraniteDS ( http://www.graniteds.org/confluence/pages/viewpage.action?pageId=229378 ).

                 

                All with varying price points.

                 

                I don't think 'local client cache' should be pushed aside so quickly.  A lot of server-side session data can be moved to the client w/ Flex.  Wouldn't this be considered a form of caching?

                • 5. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                  2009 Matt Level 1

                  BlazeDS does not contain the subset of asynchronous push of LCDS.

                   

                  Let's say you are building a read-only web app to monitor Stock market. You want the server to push you the

                  data that are just changed (not the ones that are not changed) almost at real time.

                   

                  Using outdated data in client is not good.

                  • 6. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                    2009 Matt Level 1

                    Session data has to be in client side anyway. Session data should be small, most likely is just a session ID. Devpending on how you build your server,

                    most of the seesion data should be on server side.

                     

                    Client data should be transferred to client (pull or push) only when you need them. They should be cashed, but you need make sure thay are not outdated (server push is one way to do it).

                    • 7. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                      JeffryHouser Level 4

                      I'm confused as to what you think.  Does Session Data have to be on the server or the client; you say both things in your response.

                       

                      I would expect each session to have relatively small amount of session data, but if you have a larger user base, this can add up quite a bit of server memory.

                       

                      If the only session data you need to store is a sessionID, then it sounds to me like your application has no need for sessions at all.

                      • 8. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                        2009 Matt Level 1

                        Session ID is the only thing you need to pass between server and client. Server can get a spcific client data using sessionID. These data should be

                        saved on the server. Network is always more expensive than memory. You should avoid pass all the data displayed on the client back to sever and have

                        the server update them send back to client.

                        • 9. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                          JeffryHouser Level 4

                          With a rich client such as a Flex application, you shouldn't store any session data on the server.

                           

                          In the HTML world, every page request exists in isolation.  We "fix" this by adding cookies that relate to server side session data, however that is really just a big kludge to get around the limitations of the system.  Flex apps do not have that limitation.

                          • 10. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                            2009 Matt Level 1

                            I'm not talking about HTML based app. I'm talking about client-server application.

                             

                            How about CORBA based client-server application? EJB (Stateful Session Bean) based Java Swing application? Are you passing all the client data back to server?

                             

                            Is your server only a data resource (DB, LDAP, ...)? Can many clients access and update the same data record at same time?

                            • 11. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                              JeffryHouser Level 4

                              An HTML based app is a client server app; just w/ a inferior front end.

                               

                              With smart clients, the server is often relegated to a data store; with functionalty for maintaining that data.  The only data I would be passing back to the server is data that needs to be stored.

                              • 12. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                2009 Matt Level 1

                                " The only data I would be passing back to the server is data that needs to be stored."

                                 

                                How would your server know from which client the data is coming?

                                • 13. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                  Michael Borbor Level 4

                                  If it's secure data, first you'll user should authenticate, then you could use a singleton class to hold some properties in the client if you want to, but when you use CF for instance you use session variables, these variables are the one that keep your users log in, keep track of them, and allow to pass data to the server depending on your app architecture.

                                  • 14. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                    2009 Matt Level 1

                                    "hold some properties in the client"

                                     

                                    These properties are the additional data need to be sent to the server. In many case it is called "sessionID".

                                    • 15. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                      JeffryHouser Level 4

                                      Why would the server need to know which client the data is coming from?

                                       

                                      If the server is saving user specific data, that data being sent back to the server will most likely include a UserID or some other user identification field.  But, that can be very different than a SessionID, which ties the 'client' into some specific server variables in memory.

                                      • 16. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                        JeffryHouser Level 4

                                        Michael,

                                         

                                        My original claim was that when using a smart client (Such as a Flex application), there is no need for server side session data.

                                         

                                        The client should store all relevant session data and there is no need to use session data on the server.

                                         

                                        After server side verification, the client is perfectly capable of timing the session inactivity and forcing the user to log back in to continue to use the app.  I might say, the client is even more capable than the server in this regards; as the server is stuck waiting for the client to send a request before it can react.

                                         

                                        The other poster on the thread either doesn't understand or doesn't agree.  I haven't figured out which yet.

                                         

                                         

                                        I can envision exceptions to my no session data in the server and it hasn't come up in this thread one.  One might be in a situation where you are trying to re-using legacy code.  It is hardly ideal, but easy enough to imagine.

                                        A second exception may be a hybrid application that has to deal with different type of clients  Any REST API, such as the ones from Amazon.com or Google, are good examples of this.

                                        • 17. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                          2009 Matt Level 1

                                          UserID can be part of session ID. Depending on the server technology, there may be other information.

                                           

                                          Server needs to know from which client the request comes mainly because of security, not just session timing.

                                          Session time can be controlled by HTML/JavaScript as well.

                                           

                                          Almost all the clients (thin and rich) do some kind of input validations, but server should do both input validating and output sanitizing.

                                           

                                          There are some websites (e.g., cnn.com, not including online voting sections) do not need to know the clients, but many times the client information

                                          is avalible to the server.

                                           

                                          I want to reiterate my orginal title: Why Flex: What Flex can do, but HTML/AJAX can not?

                                          • 18. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                            Ansury Level 3

                                            2009 Matt wrote:

                                             

                                            BlazeDS does not contain the subset of asynchronous push of LCDS.

                                             

                                            Let's say you are building a read-only web app to monitor Stock market. You want the server to push you the

                                            data that are just changed (not the ones that are not changed) almost at real time.

                                             

                                            Using outdated data in client is not good.

                                             

                                            I think you are right about Blaze, but Granite can do a data push.

                                            • 19. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                              Ansury Level 3

                                               

                                              It's not always about what it can or can't do--a lot of this is about doing the same thing better.  And think about the origins of Ajax--it's basically a hack.  I know the same can be said about a lot of technologies (even the Internet itself), but why use something that is essentially a hack when you have technology that was engineered for the purpose you have in mind?  Building hacks and fixes upon more hacks and fixes is how we end up with a pile of junk at the end of the day in IT.  It's time to start calling things what they are, hacks, if they are that.

                                               

                                               

                                              Flex has better performance, if you make use of AMF.

                                               

                                              HTML and Ajax can't use AMF and has no counterpoint in this area. AMF is much faster than the crummy Ajax hack can muster (especially once you start throwing crap like Dojo into the mix).

                                               

                                              http://www.jamesward.com/blog/2007/12/12/blazebench-why-you-want-amf-and-blazeds/

                                               

                                              Check AMF times compared to JSON Ajax times, bandwidth.

                                               

                                               

                                              Flex doesn't care about the user's browser.  Sure, the HTML/Ajax hack has frameworks to help you deal with that, but do you really want to worry about upgrading that trash (or framework bugs) when a new version of IE, or Opera, or Firefox, or Chrome, or Safari, or even another browser comes out and breaks something?  A newer version of Flash won't break a Flex app.  Also, other than Chrome, other browser JavaScript implementations are slow, slow, slow.  The more complex your Ajax app gets, the slower it will become--that's lame.

                                               

                                               

                                              User experience. A well designed Flex UI is much nicer and easier to use than even the best "JavaScript/DHTML" hackfest.  Just look at these new Adobe forums--JavaScript out the wazoo and they suck on anything other than Google Chrome.   It's useful for marketing too--not just for commercial stuff, but marketing to upper management for enterprise applications.  Everyone that looks at a well designed Flex app will be blown away by it.  And then you get your pay raise.  (lol - assuming it works, too)

                                               

                                               

                                              Superior development experience and development time.  Using Flex Builder you can mock up an entire "seemingly functional" prototype application within a ridiculous amount of time.  You can even run it without a back end or a server of any kind, just a standalone Flash player or browser.  You also have the GUI design mode, that shows you exactly what the user is going to see in the browser--no matter what browser they have, no matter what their settings are, etc.  No more HTML crap to deal with or (God forbid) tehnologies like JSP to generate your dinosaur code.  Documentation goes from the kludge of junk out there for HTML/Ajax/JS/etc to the excellent and very Javadoc-like ASdoc.

                                               

                                              And no more choosing between the dozens of hacky and crummy Ajax "framework" patchworks out there, that are needed to workaround all the problems you'd run into without a framework.

                                               

                                               

                                              That's just what I can recall at the moment.  I will NEVER go back to that God-awful Ajax/HTML hackfest people are calling RIA development.  Sure, Flex has it's issues and downsides too, but they aren't usually major enough to be of concern, even in an enterprise environment.

                                               

                                               

                                              BTW - It's not really Flex vs. HTML/Ajax.

                                              It's more like Flex vs. HTML/DHTML and AMF vs. Ajax/JSON.  But, Flex can talk to Ajax too, and it can even be embedded in HTML.  Although personally I feel that's a bastardization of the technologies, sometimes I guess people have a need to do these things.

                                               

                                              • 20. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                Muzak Level 3
                                                I think you are right about Blaze, but Granite can do a data push

                                                 

                                                BlazeDS does do data push. It's slighlty different than LCDS though.

                                                http://sujitreddyg.wordpress.com/2008/02/04/blazeds-and-lcds-performace-difference/

                                                BlazeDS supports long-polling and streaming over HTTP to push data to the client but it manages this through the Servlet API, which has the restriction right now of mandating blocking IO.

                                                 

                                                LCDS provides support for the RTMPChannel (direct duplex socket connection between the client and server) as well as non-blocking long-polling and streaming support over HTTP that bypasses the Servlet API and its blocking IO limitation. All of these options in LCDS are built on top of the Java NIO APIs.

                                                 

                                                http://codeofdoom.com/wordpress/2009/01/29/blazeds-data-push-with-remote-objects/

                                                 

                                                And as Ansury implied, I think you're asking the wrong question: What Flex can do, but HTML/AJAX can not?

                                                But: How does Flex do things differently/better?

                                                Or even: Why is Flex better than...
                                                Which isn't necessarilly limited to what one can do that they other can't, which again brings me back to Ansury's reply in that having great tools at your disposal (Flex Builder, Debugging, Profiling, etc..) is (IMO) far more important.

                                                • 21. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                  Ansury Level 3

                                                  Ahhh!  How could I have forgotten the debugger?  And a profiler...haha I wonder what one of those for "Ajax" would look like--wait, maybe I don't want to know...

                                                  • 22. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                    2009 Matt Level 1

                                                    "What Flex can do, but HTML/AJAX can not?"

                                                     

                                                    This is a legitimate question to ask for a new technology. Here is the list I have to answer the question:


                                                    Flex supports datagrid that allows drag&drop of columns and multi-column sorting. HTML/AJAX does not support.

                                                    Flex supports many charts: pie, line, column, bar. HTML/AJAX does not.

                                                    Flex supports 3D drawing, animation, moive...

                                                     

                                                    The second question should be "What does Flex do better than HTML/AJAX?"

                                                     

                                                    My answer: It is easier to develop Flex app than HTML/AJAX because the Flex Builder supports debugger. FireBug (JavaScript debugger) only works for FireFox.

                                                    Flex has many built-in MXML components, which allows quick development.

                                                     

                                                    The third question is "What does HTML/AJAX do better than Flex?"

                                                     

                                                    My answer: The initial loading time of HTML based websites is much shorter than those of Flex.

                                                    Someone may think HTML's request-response is easier than event driven framework of Flex.

                                                     

                                                    The forth question is "What HTML/AJAX can do, but Flex can not?"

                                                     

                                                    My answer: Mobile applications. Flex can not run in mobile devices.

                                                     

                                                    You are welcome to add more answers to these questions.

                                                    • 23. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                      JZBAO Level 1

                                                      To build a lightweight, interactive, responsive, and nice UI website, Flex alone is not enough. You may need to use HTML, Flex, AJAX all together.

                                                       

                                                      Mobile market is huge and has lots of potentials. Flex must catch up in this area.

                                                       

                                                      Many times there are no simple answers for better or wrose technologies. I think standard is more important in the software "art" industry.

                                                      There are many open source Java frameworks come, mess up the Java community a little, and gone. Adobe should learn from this lesson.

                                                       

                                                      Why do I not see anyone successfully invent a three-string violin to make it easier to play and five-string violin to produce more beautiful sound?

                                                      • 24. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                        Ansury Level 3

                                                        2009 Matt wrote:

                                                         

                                                        The third question is "What does HTML/AJAX do better than Flex?"

                                                         

                                                        My answer: The initial loading time of HTML based websites is much shorter than those of Flex.

                                                        Someone may think HTML's request-response is easier than event driven framework of Flex.

                                                         

                                                         

                                                        Someone may think that if someone considers round-trip development easier than event-driven Flex, they are in the wrong industry and would be better off flipping burgers.

                                                         

                                                        Also, I've seen "HTML websites" run slow, buggy, and have long load times as well-- hell, just look at gmail.  JavaScript and Ajax out the wazoo, and often you can tell...

                                                         

                                                        But also more importantly with enterprise applications, which I think the OP was focusing on, load time is light years less important than in-use response time.  Flex's AMF beats all HTML/Ajax protocols in speed.  Enterprise apps are on internal intranets more often than not (rather than the slow Internet)--this would help Flex app download time (which also can be mitigated in other ways).  Users generally will accept that MS Project or Word will take a few seconds to load, and if they're going to be logged into an enterprise Flex app for an hour or whatever, they shouldn't think too much of that either.

                                                         

                                                        An "enterprise Ajax application" is just a fancy web page hack, one step above a dumb terminal, that makes a website imitate a rich client's behavior.  (And everyone I've heard discuss these say they quickly become a nightmare to work on.)  An enterprise Flex application is an actual rich client, with better access to the local CPU's processing power (not quite the same as a crummy JavaScript engine).  I will never call an "Ajax application" anything better than a fancy website.

                                                        • 25. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                          Muzak Level 3
                                                          To build a lightweight, interactive, responsive, and nice UI website, Flex alone is not enough. You may need to use HTML, Flex, AJAX all together.

                                                           

                                                          BS !!

                                                           

                                                          Mobile market is huge and has lots of potentials. Flex must catch up in this area.

                                                           

                                                          Not really. The flash player itself needs to catch up. Flash Lite (flash player for mobiles) only supports AS2, Flex is AS3 only.

                                                           

                                                          Why do I not see anyone successfully invent a three-string violin to make it easier to play and five-string violin to produce more beautiful sound?

                                                           

                                                          What has that got to do with anything? And what makes you think a 3-string violin is easier to play than a 4-string violin? Obviously, you don't play the violin

                                                           

                                                          Oh, by the way.. read this history part:

                                                          http://en.wikipedia.org/wiki/Violin

                                                          The oldest documented violin to have four strings, like the modern violin, is supposed to have been constructed in 1555 by Andrea Amati, but the date is doubtful. (Other violins, documented significantly earlier, only had three strings.)

                                                          And you want 5-strings? Here you go.

                                                          http://5stringviolins.com/

                                                           

                                                          Often helps to know what you're talking about before actually talking about it

                                                          • 26. Re: Why Flex: What Flex can do, but HTML/AJAX can not?
                                                            Ansury Level 3

                                                            Muzak wrote:

                                                            Why do I not see anyone successfully invent a three-string violin to make it easier to play and five-string violin to produce more beautiful sound?

                                                             

                                                            What has that got to do with anything? And what makes you think a 3-string violin is easier to play than a 4-string violin? Obviously, you don't play the violin

                                                             

                                                            I think he's saying, and I'd mostly agree, that in general "frameworks" that aim to "simplify" or "improve" flaws in some technology often don't accomplish those goals, or they create problems in other areas that prevent their permanent adoption and use.

                                                             

                                                            It's not something that's always true, but I would agree that craptastic junk like Hibernate or maybe even Ajax (or Ajax frameworks) itself may belong in the trash can of software history.  Humans tend to be conservative and afraid of change for a reason--skepticism of change and "improvements" is probably in our DNA.