Other option would be to use free products like beanshell to give you access to the local variables - you could build facade class dynamically or just provide "transparency gateway" proxy. The fact that you are converting J2EE application indicates that amount of data is not significant, so the cost is not going to be an issue, and you can reuse proxy for subsequent calls.
In the end, it would be just a migration support excercise, as your current J2EE code will be changing so much, it would not make sense to keep the old one - Java interpreter is fine as long as it is not high call volume system.
HTH,
Anatole Tartakovsky
 
----- Original Message -----
From: Dave Wolf
Sent: Tuesday, January 24, 2006 8:59 AM
Subject: [flexcoders] Re: Java POJO/Action Script question

Ahh yes, the same J2EE struggles with property setting.  As Doug says
you do not want to be calling a million setters on a remote object.
You are better off refactoring this to either create a new Value
Object, or to treat your existing class itself as a value object. 

So rather then getting a remote reference to say UserProfileForm, then
calling a million getters and setters, I would create a POJO which
returns the UserProfileForm as a return type.  Then call all your
setters locally, and pass it back up to the server as the parameter to
another POJO method call.

The second option is to add a new Value Object property to the
UserProfileForm.  Again create the stub, call all the setters on the
local value object, then call one call on the UserProfileForm to
return this coarsly grained Value Object.

You need to keep network calls in mind in your architecture.  There is
a graveyard filled with failed J2EE projects who ignored the network
and the effects of not architecting around seriously reducing the
number and size of remote calls.

--
Dave Wolf
Cynergy Systems, Inc.
Macromedia Flex Alliance Partner
http://www.cynergysystems.com

Email:  [EMAIL PROTECTED]
Office: 866-CYNERGY


--- In [email protected], "douglowder" <[EMAIL PROTECTED]> wrote:
>
> Flex 1.5 does a pretty good job of automatically translating Java
> types to ActionScript, but only for members that are declared
> public, not private.  So, if you want to continue using your getter
> routines for private members in your existing classes, be prepared
> to make a lot of calls to your remote object.  You could also create
> a new "facade" Java class for mapping purposes, which would have
> public members for all the variables you want to expose to
> ActionScript, and have that class make all the calls to your
> existing class's getters to initialize those public members.  You
> can then refer to the variables by name (the same name as in the
> Java class) from within ActionScript.
>
> Another thing to keep in mind is that datagrids expect to be passed
> arrays (actually, anything that implements the DataProvider
> interface) of objects, not a single object.  If your Java calls are
> returning a single object instead of a list of objects, use
> mx.utils.ArrayUtil.toArray() on the result to convert it to an array
> in ActionScript.
>
> Doug
>
>
> --- In [email protected], "sshriyan27" <[EMAIL PROTECTED]>
> wrote:
> >
> > I'm new to Flex we're trying evaluate in our company whether we
> > should use FLEX or not. Right we have Java, Struts based
> application.
> >
> > I have a simple question, i have an Object and still strugling to
> > map that to an action script and datagrid.
> > How do i display values of UserProfileForm in datagrid, like in
> > Struts i used to do  CloserResultsForm.userProfileForm.firstname
> ();
> > Can some one explain this to me.
> > ** I can get the Single object to get displayed but not the
> > inhertited ones.
> >
> > public class CloserResultsForm implements Serializable{
> >       private UserProfileForm userProfileForm;
> > }
> >
> > public class UserProfileForm {
> >       private String username=null;
> >       private int userid;
> >       private String password=null;
> >       private String firstname=null;
> >       private String lastname=null;
> >       private String roleName=null;
> >      
> >     public UserProfileForm(){
> >          
> >     }
> >  .... // then getters and setters for the above
> > }
> >
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to