Re: custom RequestContext?

"Joseph Panico" <[email protected]>
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
I think it would be a good idea to give users a hook to specify their own 
RequestContext implementation, regardless of the outcome of my Upload 
wants/needs. RequestContext plays a pretty central role and there is no way 
to anticipate all the odd things that developers might want tod do ;) One 
simple way to provide the hook is as a factory template method in the Engine 
interface, since that idiom is already present there.

>you expand on how RequestContext is failing you?

The current Upload implementation is fine for basic work, but it's quite 
"closed"-- not giving the developer any flexibility in carrying out the 
task. Specifically:

* The MultipartDecoder does the stream decoding "up-front" in the 
constructor, rather than lazily. I understand that this makes sense for the 
majority of cases. But I have "special needs" :) The decoding performed by 
the MultipartDecoder is actually quite processing intensive, as it scans the 
entire InputStream byte-by-byte so that it can find the boundaries. Even 
over a not so fast network connection I find that the upload process is 
bound not by the network but by the decoding. It slows down large uploads 
quite a lot. I would like the option to do the decoding myself, after the 
upload has completed, so that I can give the user some feedback that the 
file has been received and that "processing" (i.e. decoding) has begun. This 
also gives me an opportunity to optimize the decoding process in the case 
where the problem is favorably constrained, for instance there is only 1 
Part. In that case I can scan for the end boundary not from the head but 
from the tail.

* The upload implementation sends the upload stream to a temporary file, 
over which I have no control, and then offers me a InputStream. In order to 
get the file to where I want it, I now have to copy the file from it's 
temporary location. What I need to be able to do is specify to the upload 
implementation where to send the upload stream in the first place, so that I 
can avoid extra copying.

regards,

joe



Joseph Panico
[email protected]




>From: "Howard M. Lewis Ship" <[email protected]>
>To: "Joseph Panico" 
><[email protected]>,<[email protected]>
>Subject: Re: [Tapestry-developer] custom RequestContext?
>Date: Sun, 24 Nov 2002 11:54:42 -0500
>
>Sorry, no, there isn't a convienient way.  There should be, I guess. Could
>you expand on how RequestContext is failing you?
>
>----- Original Message -----
>From: "Joseph Panico" <[email protected]>
>To: <[email protected]>
>Sent: Sunday, November 24, 2002 11:04 AM
>Subject: [Tapestry-developer] custom RequestContext?
>
>
> > Is there a way to tell Tapestry to use my custom subclass of
>RequestContext?
> > The way Tapestry is handling file uploads is not quite suitable for my
> > application.
> >
> > Joseph Panico
> > [email protected]
> >
> >
> >
> > _________________________________________________________________
> > Protect your PC - get McAfee.com VirusScan Online
> > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Tapestry-developer mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/tapestry-developer
> >
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Tapestry-developer mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/tapestry-developer


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.