I do apologize if my post came out too strong.  I'm trying not to live in a sandbox 
and do
have my ears and eyes open to other things but getServlet() method was abused and used 
in
wrong circumstances by a lot of people.  Substituting it by other things allows some 
people
to continue bad behaviours.  After switching to a different architecture (one 
dispatcher
servlet -> worker classes) I became a happier person.

You seem like you know what you're doing with sharing the servlets' methods around and
that's great.  I personally don't do that but I'm not stopping you.  And you're right, 
I
shouldn't say that your architecture is flawed.  I haven't seen it.  If you care to 
share it
(privately if you want) I'd be more than happy to take a look.

I wish you happinness :-)

dave.


Ernie Varitimos wrote:

> I disagree that accessing servlets through the servlet context is a flawed 
>architecture.
> And you are wrong when you discount my assertion that the servlet context was not
> designed to group and/or share servlet resources. That is one of the principal 
>reasons
> why it was created.
>
> There are of course, precautions that one should employ to guard against undesirable
> behaviors such as dynamic reloading. This can be managed using a number of techniques
> that I have iterated in other posts. In fact, I've created several high volume sites
> that use the servlet context to store references to sessions, object pools and other
> servlets, in single as well as multi-homed environments. It has proven to be 
>effective,
> extensible and easy to maintain.
>
> I have yet to hear a reasonable, comprehensive explanation of why this is a flawed
> architecture and what are the superior alternatives. I know there are many 
>alternatives,
> but I have not yet heard why this technique is inferior. There are several reasons 
>why
> using the servlet context is perfectly acceptable in terms of reuse, collaboration 
>and
> delegation (I find inheritance less desirable). I have also espoused out-of-the-box
> means of servlet collaboration, such as using the JSDT to distribute sessions and 
>other
> objects across JVMs, or using reflection in concert with hidden html fields. But I
> digress.
>
> It's amazing to me that there are so many developers and some architects that live
> within the sandbox of knowledge they find in a few popular books or articles, as if
> these references represent the preferred ways of designing a servlet based 
>architecture.
> Or they are so hung up on objectifying everything (OO elitists) at the expense of
> creating less readable and thus less maintainable code.
>
> -ernie
>
> David Mossakowski wrote:
>
> > getAttribute() in ServletContext is to share objects across servlets.  It does 
>allow
> > you to share the servlets themselves but that doesn't mean that this was the reason
> > for this facility.  It is a side effect.  One way to disable putting servlets in
> > ServletContext is to have GenericServlet NOT extend Object, the other is to not
> > allow putting Objects in ServletContext.  Let's not do either :-)
> >
> > I agree with others saying that if you need to call a method of one servlet from
> > another then your architecture is flawed.
> >
> > d.
> >
> > Ernie Varitimos wrote:
> >
> > > It is simply not true that "the servlet model was not meant for such access".
> > > Otherwise the team at JavaSoft would not have provided the getAttribute() and
> > > setAttribute() methods in the ServletContext. They simply wanted to provide an
> > > architecture that made it easy to separate one servlet based application from
> > > another, yet still provide a means for servlets to communicate with one another.
> > >
> > > -ernie
> > >
> > > "Subrahmanyam A.V.B." wrote:
> > >
> > > > This has been discussed several times. Refer to the archives. FYI, the
> > > > servlet model is not meant for such access.
> > > >
> > > > Subrahmanyam
> > > >
> > > > arun prakash wrote:
> > > > >
> > > > > Hi !!,
> > > > >
> > > > >    I need some help out from u guys. How can i call a
> > > > > specific servlet method from another servlet. Any
> > > > > suggestion will be extremely helpful and a code would
> > > > > be the best way to help me out.
> > > > >
> > > > > Thanks in advance.
> > > > > arun prakash
> > > > >
> > > > > __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Talk to your friends online with Yahoo! Messenger.
> > > > > http://im.yahoo.com
> > > > >
> > > > > ___________________________________________________________________________
> > > > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > > > > of the message "signoff SERVLET-INTEREST".
> > > > >
> > > > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> > > >
> > > > --
> > > > ----------------------------------------------------------
> > > > Letting U=Universal, and given God=U and Unreason=U,
> > > >         Unreason=God                            --- Q.E.D.
> > > > Check me at http://www.Subrahmanyam.com
> > > > ----------------------------------------------------------
> > > >
> > > > ___________________________________________________________________________
> > > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > > > of the message "signoff SERVLET-INTEREST".
> > > >
> > > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> > --
> > David Mossakowski              [EMAIL PROTECTED]
> > Programmer                           212.310.7275
> > Instinet Corporation
> >
> > "I don't sit idly by, I'm planning a big surprise"
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--
David Mossakowski              [EMAIL PROTECTED]
Programmer                           212.310.7275
Instinet Corporation

"I don't sit idly by, I'm planning a big surprise"

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to