Thanks,
Pramod
Ananth Chellathurai [Walk on software]
Thanks,
Pramod
ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Thanks,
Pramod
Thanks,
Pramod
Thanks,
Pramod
Thanks,
Pramod
Thanks,
Pramod
Thanks,
Pramod
Thanks,
Pramod
pramod talekar wrote:Hello,
I'm working on Struts.
I went through the existing code written by my team and they have written many static methods in the action class.
So is it a right thing to mention such things in the action class apart from 'execute()' method, also the execute method is also containing business logic.
Also, should an action class have only one method i.e. execute ? not even a static block ?
The code is working fine. But is it a right design approach ?
Please advise.
-Varun -
(My Blog) - Online Certifications - Webner Solutions
Threading Model
Struts 1 Actions are singletons therefore they must be thread-safe because only one instance of a class handles all the requests for that Action. The singleton strategy restricts to Struts 1 Actions and requires extra care to make the action resources thread safe or synchronized while developing an application.
Struts 2 doesn't have thread-safety issues as Action objects are instantiated for each request. A servlet container generates many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|