Re: Barracuda: case-insensitive event names?

Denny Chambers <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
If I understand correctly, Barracuda uses reflection to turn the URL 
into an event. For reflection to work, the class we need to be loaded 
using the correct case. This means Barracuda will need some sort of 
mapping function to map a case insensitive event name to a case 
sensitive one. I think some think something like this would be nice to 
have, since URL's in general are case insensitive. Maybe this could be 
configurable.

+1 for me

Jacob Kjome wrote:

>
> Hi Jeremy,
>
> I agree with you that the easiest way to do things would be to have 
> the user enter the base url for the webapp and just redirect them.  In 
> fact, this is a pretty standard thing to do.... and one that Enhydra 
> users are pretty familiar with because the Enhydra apps I've seen run 
> on a port other than 80, so they have a default page such as 
> index.html do a meta-refresh to the appropriate starting URL.  Using 
> the event model to direct unhandled events to a default page is a fine 
> idea and also makes it so you don't have to count on a separate static 
> file being written with the appropriate URL.
>
> The thing is, however, that after users know the page they want to go 
> to, they type it in on their own instead of going to another page a 
> clicking a link.  I can look into modifying Barracuda to handle this 
> behavior.  I just wanted to get a feel for the need out there.  looks 
> like Ron Alsobrook would also like to see this behavior.  I also 
> wanted to put this out there to see if anyone can come up with any 
> technical reasons *not* to do this.  That is, are there any 
> deleterious effects which would result from a change like this.  I 
> can't think of any, other than maybe extra processing time to do 
> String matching, but that could be minimized with proper coding technique.
>
> Any other gotcha's that anyone can think of?  Otherwise, I'll look 
> into this over the weekend.
>
> Jake
>
> At 11:27 PM 12/12/2002 -0700, you wrote:
>
>> I had a feeling it might have something to do with this.
>>
>> My opinion is that the event names should be "opaque"--the user may see
>> them, but they shouldn't necessarily be meaningful (i.e. part of a URL
>> that the user would actually type into the browser's address field). To
>> me, just the fact that they end in ".event" (by default) suggests that
>> they'd probably be unfamiliar to users.
>>
>> Typically, to get to your fictitious Web application, wouldn't it make
>> the most sense to allow the user to enter the URL
>> http://www.myhost.com/myapp ? I would expect a URL of this form to be
>> the entry point for the application (it's also less typing for the
>> user). This is actually pretty easy to do in Barracuda, especially if
>> the application has only one entry point. I just have a
>> DefaultEventGateway that redirects to the URL of the event that displays
>> the "main" application page. (The mechanism I use is a bit
>> oversimplified--it actually redirects any request that wasn't handled by
>> another event listener to the "main" event--but it illustrates that the
>> mechanism can work.)
>>
>> I'd imagine this mechanism could be extended to redirect various URLs to
>> various events, and I think that would be a more useful capability than
>> case-insensitive event names would be. This can certainly be implemented
>> with a DefaultEventGateway, but I wonder if there would be another, more
>> elegant way of doing this.
>>
>> Having said all that, it doesn't seem that implementing a
>> case-insensitive event name mechanism would introduce any real problems.
>> I'm not sure how the event name-to-class mapping is implemented
>> internally, but if it uses something like a HashMap, I would think this
>> would be easy enough to implement: Simply perform something like
>> toLowerCase() on a key before insertion or comparison. If the mapping
>> uses something like Class.forName(), then adding a HashMap to map the
>> toLowerCase() version of the event name to its "true" capitalization
>> should work well.
>>
>> Cheers,
>> Jeremy
>>
>> On Thu, 2002-12-12 at 22:09, Jacob Kjome wrote:
>>
>> > Hi Jeremy,
>> >
>> > Why you little.... I mean....  heh :-)
>> >
>> > It is just because if someone were to type the URL to some page, they
>> > really shouldn't have to care about the case-sensitivity of the event
>> > name.  If they know the name, they should be able to fire the event.
>> >
>> > For instance....
>> >
>> > http://www.myhost.com/myapp/MyBigLongEventName.event
>> >
>> > Now, besides the fact that I created a very cumbersome event name, a
>> > user would have difficulty with this since they would have to remember
>> > to use Java coding standards for classes when typing the name of the
>> > event.  Besides, that, they could miss the SHIFT key and get most of
>> > the case right, but one letter in lower case when it should have been
>> > in upper and now they get an "event not found" message.  Why not be
>> > able to do something like...
>> >
>> > http://www.myhost.com/myapp/mybiglongeventname.event
>> >
>> > or
>> >
>> > http://www.myhost.com/myapp/MyBigLongEventname.event
>> >
>> > or
>> >
>> > http://www.myhost.com/myapp/MyBiglongeventName.event
>> >
>> > etc....
>> >
>> > We all know what event they are trying to fire, don't we?  Why should
>> > we care that they typed it just so?  Does that make things more
>> > clear?  Now that it is clear, do you feel it is a valid point?  If it
>> > is a valid point, are there any gotcha's we might run into by allowing
>> > for this?
>> >
>> > Jake
>>
>> -- 
>>
>> Jeremy L. Rosenberger * [email protected]
>> http://www.frii.com/~jeremy/ <http://www.frii.com/%7Ejeremy/>
>>
>> _______________________________________________
>> Barracuda mailing list
>> [email protected]
>> http://www.enhydra.org/mailman/listinfo.cgi/barracuda
>> FAQ - http://www.jguru.com/faq/Barracuda
>

_______________________________________________
Barracuda mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/barracuda
FAQ - http://www.jguru.com/faq/Barracuda
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.