I used to do a lot of this back when I wasn't as clear on why Actions
shouldn't contain actual code (this started when I was using a custom
framework my company build that had examples that didn't make it clear
you shouldn't do this).
One Action instantiating another I think is sometimes not a bad idea
even today... why incur the overhead of rerunning the request processing
cycle again?
That being said, I absolutely echo what everyone else said... moving it
to another class is the first, best solution.
Frank
a k wrote:
In the process of writing an Action class, I realized that it needs
some application functionality (not general utility kinda
functionality) that is already part of a method in a different Action
class.
So, Action MyAction1 needs to access method myMethod2 in Action
MyAction2. Here are the options that I could think of:
1. Instantiate the MyAction2 class manually and access the myMethod2.
2. Create a Helper class and move the funcationality there so that
both the classes could use it.
I cannot put this in a separate parent class and extend MyAction1 and
MyAction2 from it because I already have another Action class that all
Actions extend from and I would like to adhere to it...if possible.
What is a better way in this scenario? In particular, is it bad to
manually instantiate Action classes?
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]