Yes come to think of it, references could be a compile time thing, with just
the objects themselves having a runtime effect.

-----Original Message-----
From: Dave Derry [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 13, 2002 19:12
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: [FormBean] Question concerning memory / casting


Agree with your assesment re: 1 should be ProductFB prodFB =
(ProductFB)form;
As written I wouldn't expect to get much usefull info. ;-}

I don't understand why you think 2 would be more efficient tho'. In 1,
prodFB is merely an alias for form. I wouldn't expect any runtime
difference. But since 1 requires less typing, I would expect it to be more
development time efficient. ;-)


----- Original Message -----
From: "Andrew Hill" <[EMAIL PROTECTED]>


> Ummm. In (1) did you mean to say ProductFB prodFB = (ProductFB)form;
> ???
>
> If you did then I would have thought the second more runtime efficient (I
> could well be wrong of course. Will be intersting to see what others say),
> though I prefer the first as its easier to read, maintain, and write :-)
>
> -----Original Message-----
> From: Michael Delamere [mailto:[EMAIL PROTECTED]]
>
> Hi,
>
> Iīve noticed that some of the developers here (in my company) are
> programming in a style where Iīm not sure if its clean or maybe even not
> very good in performance.  I would like to address this issue, but as you
> know, itīs a bit impossible if you yourself do not know any better!
>
> Please donīt flame because of the fact that this isnīt 100% a struts
> specific question!
>
> Scenario:
>
> The are two ways of retrieving data out of my form bean:
>
> 1)
> ProductFB prodFB = new ProductFB();
> prodFB.getName();
> prodFB.getDescription();
> prodFB.getPrice();
> prodFB.getPackaging();
> prodFB.getAttributes();
>
> 2)
> ((ProductFB)form).getName();
> ((ProductFB)form).getDescription();
> ((ProductFB)form).getPrice();
> ((ProductFB)form).getPackaging();
> ((ProductFB)form).getAttributes();
>
>
> The latter is the one that I have seen being used in various classes now.
I
> personally donīt like this one and wanted to know if there are possibly
any
> other implication like memory or casting issues.
>
> Youīre help would be VERY appreciated!
>
> Thanks,
>
> Michael



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to