• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

An integration with Flex question

 
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I'm developing an a web application that using xml's with xsl's files combined to produce web pages (ajax)

Is it possible to add/integrate Flex in such a system?

If the answer is yes, how can it be done? What are the first steps

Regards.

Daniel.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly is your goal for the pages, to output to HTML/CSS or a Flash application? Flex handle XML extremely well, but its predominately a front-end platform, rather than a middle tier for processing data.
 
Daniel Reznick
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to integrate the flash elements inside the jsp displayed pages

I'm not interested in using it as a processing data , but for visual purpose .

Right now we are using fusion charts swf files in our system...

And it will be great if it will be possible to integrate the Flex also....
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can create Flex widgets that read XML data, either from disk or from a backend Java server, and display beautiful charts/graphs. In fact, this is one of the most common uses of Flex.
 
Daniel Reznick
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Flex widgets are .swf files?

Can i create them some how by using java/ with the help of java?
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Flex can output to SWF (SWC as well), so once compiled they are quite similar to Flash-created SWFs. The difference is that it's a programming-oriented way to develop Flash applications, rather than a visual one, and is often done in Eclipse using the Flex Eclipse plugin.

The language is not the same, though, but most Java developers feel at home in ActionScript given the similar syntax.
 
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're better at ease with Actionscript since its a strongly typed language, just in case you were coming from a Java background.
 
Sai Hegde
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I think it's best use Flex for UI purposes and integrate them with server side logic through BlazeDS, Adobe LifeCycle DS or others. This reduces the size of your swf file greatly.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sai Hegde wrote:You're better at ease with Actionscript since its a strongly typed language, just in case you were coming from a Java background.



Well - ActionScript is really somewhere between the two. ActionScript allows you to access variables note defined for the type you have assigned it. e.g.:

will return the valuye of the property "a" of whatever type the object represents, or null if the property does not exist. So you can write ActionScript asd if it were weakly typed.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sai Hegde wrote:Also, I think it's best use Flex for UI purposes and integrate them with server side logic through BlazeDS, Adobe LifeCycle DS or others. This reduces the size of your swf file greatly.



Not sure I follow what you are saying here - how does BlazeDS or LCDS reduce the size of the SWF? The normal pattern for reducing download size is to break a single SWF in to components and load them on demand.
 
Sai Hegde
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My bad!!!
I meant to say do not process business logic on the client... I have come across many naive developers doing that.

 
Sai Hegde
security forum advocate
Posts: 236
1
Android Flex Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ActionScript allows you to access variables note defined for the type you have assigned it.



Yeah, just because you can, you should not be doing that. Using AS as a weakly typed language is a source of frustration for many developers (count me in it too ) with especially hard to track bugs.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To play devil's advocate a bit - why not? You write code to be more loosely coupled this way - which is a big reason why some people prefer weakly typed languages. Assuming good, test driven development practices, and a design that follows a well understood pattern, what do you have to fear?
 
author
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the original question... I suppose you have multiple options. I personally would create a "widget project" separately, as it's own project and development lifecycle. This would allow you to be able to add them to any page you are generating as a dependency somehow.

The other thing I think I hear you wondering about is if it's possible to use Java to actually build the component. To me this means using Java (or groovy ) to generate Flex MXML and Actionscript. Depending on the complexity of the component, I guess you could do that. HOWEVER, I fear it would be too messy coupling projects together when you can simply pull the flex component in as a "prebuilt dependency" (SWF, SWC) when generating the page.
 
Bj Allmon
author
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sai Hegde wrote:My bad!!!
I meant to say do not process business logic on the client... I have come across many naive developers doing that.



My two cents.. I feel that a "Rich Application" does care about business logic. If nothing beyond basic webapp capabilities is required for a project, Flex may not be the right choice. A plain old webapp framework should be considered instead to deliver everything the customer needs. However, if something more than just stuffing simple html forms and divs with data with the occasional AJAX call is required, then Flex is a viable option.

Flex has a place for business logic pertinent to the user's experience or the view. The concern should fall mainly in the way you design your Flex module. In the book, Flex on Java, we demonstrate using the MVP design pattern for keeping the code clean. This is a pretty clean design pattern common for stateful and rich applications.

Flex enables developers to build business objects that know how to manage state, communicate intelligently with a server-side, and provide captivating view components. All with unit tests.
 
Daniel Reznick
Ranch Hand
Posts: 50
jQuery Eclipse IDE Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was very enlightening discussion...

Thanks!

Daniel.
 
reply
    Bookmark Topic Watch Topic
  • New Topic