I've successfully integrated Flex with an EJB that exposed it's logic via the old Flash Remoting for Java. Simply referenced the Flash Remoting bean declarations and it worked like a bomb!
-----Original Message----- From: Steven Webster [mailto:[EMAIL PROTECTED] Sent: 10 February 2005 08:40 PM To: [email protected] Subject: RE: [flexcoders] any good examples out there for Flex & EJBs? Art, > any good examples out there on Flex & EJBs ( Enterprise Java > Beans ) integration? > > a link to source code & tutorial would be helpful. There is no need for a specific example of Flex and EJBs; let me explain: Assuming for now that your EJB architecture is one of Entity Beans (whether CMP or BMP, EJB 1.x or 2.x, it doesn't matter) and perhaps you have a Statless Session EJB as a facade pattern... I would strongly advocate that you provide a POJO business delegate class in front of your Stateless Session EJB, that presents a service interface to Flex, that has no knowledge of the underlying implementation of the services (ie that it is an EJB tier). Your plain old business delegate should "deal" in value objects/ transfer objects, that you likely have anyway as part of your EJB tier. Flex will then simply perform RemoteObject calls onto your POJO business delegate, and your business delegate will handle the interaction with your EJB tier. In "Reality J2EE - Architecting for Flash MX" which I wrote in 2002, I had an example (of an online banking app) with a Flash MX front end, and using Flash Remoting (which is the underlying technology in RemoteObject with Flex) to invoke a J2EE business tier that was built using CMP/CMR Entity Beans running in JBoss appserver. Though it is possible with Remoting to remote directly onto an EJB home interface, I showed how a much simpler/easier and arguably (if I'm arguing :) ) better practice was to front the EJB tier with a POJO business delegate. So that's my thinking -- present a POJO architecture on the server, and just stick with the regular patterns for RemoteObject invocation, passing of value objects over the wire, maintaining common object model of VOs/DTOs on the client and server, as is advocated by the Cairngorm microarchitecture, and as is discussed in "Developing Rich Clients with Macromedia Flex" (and the chapter we cover all this stuff in, is a free download from http://flexbook.iterationtwo.com/) Some links for you: Reality J2EE - Architecting for Flash MX http://www.amazon.com/exec/obidos/tg/detail/-/0321158849/qid=1108060782/sr=8 -1/ref=sr_8_xs_ap_i1_xgl14/102-4541727-7040959?v=glance&s=books&n=507846 Developing Rich Clients with Macromedia Flex http://www.amazon.com/exec/obidos/tg/detail/-/0321255666/qid=1108060843/sr=1 -1/ref=sr_1_1/102-4541727-7040959?v=glance&s=books Free Chapter (Chapter 20) http://www.theserverside.com/articles/article.tss?l=Flex Cairngorm http://www.richinternetapps.com/archives/000094.html I hope this helps ! Best, Steven -- Steven Webster Technical Director iteration::two This e-mail and any associated attachments transmitted with it may contain confidential information and must not be copied, or disclosed, or used by anyone other than the intended recipient(s). If you are not the intended recipient(s) please destroy this e-mail, and any copies of it, immediately. Please also note that while software systems have been used to try to ensure that this e-mail has been swept for viruses, iteration::two do not accept responsibility for any damage or loss caused in respect of any viruses transmitted by the e-mail. Please ensure your own checks are carried out before any attachments are opened. Yahoo! Groups Links

