On Wed, March 9, 2005 3:02 pm, Shey Rab Pawo said:
> This is more, not less, code, is it not?   You have:
>
>    <setupItem setupClass="com.omnytex.setupexample.setups.SetupClass1"
>> setupMethod="setupMethod1" />
>
> which has to be used for all actions that use this, right?
>
> compared to:
>
>     SetupClass1.setupMethod1(request)

If you consider lines in an XML file to be code, then you might have a
point :)  But even then, the two lines convey the exact same information,
just a difference of a few characters... remember that, as shown here, the
second line requires an import as well.  So:

import com.omnytex.setupexample.setups.SetupClass1;
...
SetupClass1.setupMethod1(request);

That's 86 characters, whereas my approach is 97 characters.  11 characters
is, *technically* more code, but I think we're getting a hair too anal
here :)

And again, that's only if you consider lines in an XML file to be code. 
Consider that my approach doesn't require a recompile if I need to change
something, which is of course the attraction of ANY configuration file.

> This is also only achieved at the expense of reflection, etc.  I don't
> see the advantage at all so far.  I am probably missing the point.  I
> tend to think that Struts has about the right complications with the
> declarative options available.  More, I think, might not be good.  I
> probably am missing the point, however.

I concede the reflection point.  I've always tried to stay away from
reflection myself in the name of performance, but frankly reflection
performance isn't the problem it used to be.  And, remember that
reflection is used A LOT throughout Struts (how do you think ActionForms
get populated for example??), so what's a little more?  If it means I
don't have to recompile to change what setup functions get performed, its
worth it to me.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

>
>
>
> On Wed, 9 Mar 2005 14:29:08 -0500 (EST), Frank W. Zammetti
> <[EMAIL PROTECTED]> wrote:
>> Now, as you were saying, you could just use this class from the Actions
>> manually, that works fine, and plenty of people do that.  But, it's
>> extra
>> code, and redundant code if used in more than one Action, even if the
>> redundant code amounts to:
>>
>> SetupClass1.setupMethod1(request);
>>
>> (assuming its a static method).
>>
>> Instead, my proposal, and what I posted to Buzilla accomplishes this, is
>> to allow this:
>>
>> <action path="/page1" type="com.omnytex.setupexample.action.TestAction">
>>   <forward name="defaultForward" path="/result.jsp">
>>     <setupItem setupClass="com.omnytex.setupexample.setups.SetupClass1"
>> setupMethod="setupMethod1" />
>>     </forward>
>>   </action>
>>
>
> --
> No one ever went blind looking at the bright side of life.
>


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

Reply via email to