SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2007
    Posts
    1,398
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Could Flex replace JSP?

    Day by day, I'm getting to know more about Flex and who ever knew that "Spring Framework" is working on Flex integeration.

    http://static.springframework.org/sp...reference.html

    Seriously, the integration is a beauty. In Flex, by coding
    Code:
         <mx:RemoteObject id="ro"
                 destination="guestListService"
                 endpoint="/myProject/spring/messagebroker/amf"
                 result="resultHandler(event)"
                 fault="faultHandler(event)"/>
    you now have guestListService spring bean inside the Flex! that easy. And calling it is dummy proof.

    Code:
    <mx:Button label="Get Guest List" click="ro.getGuestList()"/>
    You can guess that it's RPC to the Spring Bean through HTTP/S. Anyways, I'm beginning to swade that Flex has a good chance of dominating JSP down the road and Java will only be used as a service provider engine. Do you guys agree? No doubt that Flex can give better RIA vs html/javascript/css. Anyways, Flex is awesome!

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unofrutantelly flex is much slower than javascript+html+css on client side and not to mention even the developer side (just try to use Flex in eclipse, and do a compilation of a medium size project with many libraries, it gets slower and slower and consumes a lot of RAM).

    Development in Flex looks nice (when we speak only of code), but it is still not mature enough, one have to look for some frameworks to use it better and not to reinvent the weel.

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2007
    Posts
    1,398
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Flex has been around since 2004. I would say if you compare traditional javascript/html then Flex is much faster due to asyncronous http requests. Also, the request result sent to the Flex is much smaller because it's in binary and not in String. So, for AJAX calls you get either JSON/XML as a string, parse the string, edit the html. Where flex is sending the data as binary, can bind directly to the view code. Meaning no need to parse and edit.

    As far as compilation, one can say the same thing w/ Java. The more code you add it'll be slower and requires more memory. So, for me I settle w/ dual xeon w/ 4 gig. Developer machine should be very powerful from the start.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well yeah, I agree that developer machine should be powerful, but my employer doesn't know that (I use laptop with 2GB RAM, Pentium M 2.13GHz single core).

    But as for compilation I don't agree, Flex compiler seams to load everything to memory, and libraries that should help in decreasing compilation time as well as memory usage are doing just the opposite. It is a known problem with flex, workaround is to have the sources of libraries and compile them with the main project. Not to mention the lack of incremental compilation.

    In the project I worked at, whenever I changed a file it was doing compilation for 1min - 1min 30s (and the size of eclipse at the end of day was sometimes > 1.2GB). Because of that I had to disable auto compilation. Nothing like this happened when I'm doing Java development.

    I probably need to wait for Flex 4, maybe it will be mature enough then.

  5. #5
    SitePoint Member
    Join Date
    May 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    flex replacing jsp?? i don't think so, flex is minly for cross platform RIA applications and JSP is for common web pages...

  6. #6
    SitePoint Wizard
    Join Date
    Apr 2007
    Posts
    1,398
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Isn't that what we all aim for? cross platform RIA applications sounds great to me! JSP is more than capable of creating RIA. The main secret recipe would be AJAX/CSS. The hardest part to do this in JSP is that you need to ensure compatibility among browsers and I assure you, this is harder than coding in flex. Where in flex, there is 0 compatibility issue and who doesn't have flash plugin installed on their browser?

  7. #7
    SiteP0int Weazle hooknc's Avatar
    Join Date
    Dec 2004
    Location
    Socialist Republic of Boulder
    Posts
    937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm personally not a fan of RIA.

    Don't get me wrong, I think in some situations RIA is the right solution. However, it is also my opinion that in most cases a typical page by page web app (with no or minimal JavaScript) will work just as well as a RIA.

    I do have to agree using something like flex would be 100&#37; better then using JavaScript. I feel as though trying to program with JavaScript has got to be one of the biggest jokes ever. Who would subject themselves to a programming environment that isn't well document (across browser nuisances), is constantly changing (due to new browser environments), and forces a developer to add logic to deal with different running environments in the code? I know that the JavaScript libraries are attempting to minimize all the fuss, but what a stressful way to make a living. How long must it take to perform a full acceptance test across all the browsers (IE 6, 7, 8, Firefox 1, 2, 3, Safari X, x, x, Opera, Chrome, etc...)?

    Again, don't get me wrong, I think JavaScript in small doses is appropriate, but to build an RIA with JavaScrpit... I know apps have been written, but at what cost?
    baby steps... baby steps...

  8. #8
    SitePoint Wizard
    Join Date
    Apr 2007
    Posts
    1,398
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That's a good point about JavaScript. One open source framework called jQuery is created just for that purpose (multi-browser compatible javascript library). If I ever create RIA w/ JSP than jQuery is on top of my list.

    Just in case anyone is interested, check out this book
    http://www.amazon.com/Flex-Spring-Ex...2937881&sr=8-1
    It will open eyes for any Java Web Developers.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •