-
Dec 9th, 2008, 11:40 AM
#1
Spring MVC Flex integration
I'm looking for some advice from anyone with experience integrating Flex into an existing j2ee project.
We have a jboss/hibernate/spring-mvc project and so far we've been able to get away with ajax in providing most of our RIA functionality.
Unfortunately new requests from our customers are pushing our javascript coding abilities to the limit so we've decided to use flex for some of the rich content requested.
I'm looking for some advice in how to best go about integrating flex into an already mature j2ee project.
I have seen plenty of guides online that usually start with a brand new project and go from there, but almost none telling you how to best integrate it with an existing project.
So i would like some advice from anyone who has done this before and learned a few things in the process.
Any and all suggestions are welcomed. I realize that the question is very broad and generic but we're looking for advice in all fronts, from code structuring and ant build integration, to integration with spring mvc and authentication.
We're obviously looking for a 'minimally invasive' approach but any advice you can share is appreciated.
thanks
-
Dec 9th, 2008, 10:33 PM
#2
Hi,
We have used flex in our existing project,
We have used flex charting to generate good looking reports, ofcourse the backend is spring .
we have used granite data services that enables AMF communication between the swf file that gets generated and the server side java objects (spring objects).
granite is open source,
I dont know what you are actually looking for? whether to replace the html code in the ui with flex generated swf.

Sami
-
Dec 14th, 2008, 02:09 PM
#3
There are way too many ways to answer this question. graniteDS and blazeDS both provide the ability to expose your service layer to flex via AMF so that you can call methods remotely directly from flex. GraniteDS is hibernate aware and won't trigger lazy loading of every property in your objects when they are serialized over to flex. There is similar functionality available via 3rd party projects for blazeDS, which is the official adobe AMF package for java. Alternatively, you can use SOAP directly from flex and access your service layer via a SOAP wrapper. Finally, it is relatively easy to use javascript in the page containing your flex applet in order to communicate to your app server via http/json. Assessing the best solution for you is impossible without more knowledge of your requirements.
To the previous poster, I'm curious about your experience with granite and hibernate. I spent some time investigating granite vs blaze, and I was a little concerned about the apparent lack of community surrounding granite, though hibernate-awareness is a very compelling reason to use it compared to blaze. Did you run into any difficulties when using granite? I eventually abandoned flex due to search engine indexability and a requirement for easy deep linking and browser navigation button support. All of that is (more or less) doable within flex, but not without jumping through hoops that look to be as bad or worse than getting rich functionality out of javascript+html, so I went with the tried and true. Finding experienced developers is also a whole lot easier on the html+javascript side.
-
Dec 17th, 2008, 11:24 AM
#4
Sorry for the not replying sooner guys but i was away for a few days.
Sami thank you very much for the link to granite. I managed to integrate it in our existing project and tested exposing some of our EJBs through AMF. It works great.
Basically our front end right now is just JSPs.
We need to use flex in a few places to enable some advanced functionality (mostly involving drawing on the screen which is quite difficult to do with javascript, and also a few graphs and charts)
But basically the rest of our front end is going to remain the way it is because it would be too much work to convert the whole thing to flex, and we don't really need/want to.
So I was just going to embed the compiled .SWFs in our jsps.
Right now i'm trying to figure what the best way to structure everything is.
Since only a few pages will have flex components, i wasn't sure if i should make every component its own flex app, or if i should just have one flex app that's basically just a loader and it loads the correct component based on the jsp it's on.
Or if there is a third better option to do this.
Also after looking at the mxmlc ant task it seems i need to always put the name of the swf output file in the build file. I'm trying to avoid having to modify the build file each time i add a new flex component to one of the JSPs.
Any advice?
-
Dec 17th, 2008, 01:13 PM
#5
I suspect that having a single app that reconfigures itself based on which page it is being displayed in is just adding unnecessary complexity to your app. It isn't that much overhead on the developer side to have a different flex app for each page component and will simplify each app. If there is lots of code to share between them, you can provide a library that is loaded by multiple apps.
I can't help you with your ant task, I'm afraid, though if each flex component is a separate flex app, it makes sense to me to have to modify your build environment to accommodate a new project, so I'm not sure what the problem is. I can't see how you might add a new java library build target without providing a build target and a name for the resulting jar file, for example. There are likely some tricks you can play that will extract a name from a directory or properties file, if you really want to consider the build.xml file to be inviolable.
-
Dec 17th, 2008, 01:49 PM
#6
Well modifying the build file is not that big of a deal really.
I was just trying to avoid it, and see if people have a better way of doing it. Just trying to make things as easy as possible for our designers...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules