It seems like there are a lot of issues with this, and a lot of complementary methods and classes to consider. I only wanted this to modify as part of a junit patch I'm working on, so I'll just modify the existing GWTRunnerGenerator to put the user.agent property into the generated GWTRunner class, and we can save this design/debate for another day.
Thanks, John LaBanca [email protected] On Fri, Aug 7, 2009 at 11:07 AM, Bruce Johnson <[email protected]> wrote: > Let me play devil's advocate, at least against the idea of returning the > string directly. I fear that making this value easily accessible will > encourage people to write conditional tests all over the place, which is > brittle (i.e. because we're very subtly locked into particular user.agent > values) and less optimal (because it isn't clear that the resulting patterns > will optimize well). I guarantee you people will create maps of (user agent > string key) => (functor), which will thoroughly default compiler > optimizations. > Can you talk a bit more about the motivation, so we could consider > alternatives? > > > On Fri, Aug 7, 2009 at 10:50 AM, Ray Ryan <[email protected]> wrote: > >> I say where's the unit test? >> >> >> On Fri, Aug 7, 2009 at 7:14 AM, <[email protected]> wrote: >> >>> >>> On 2009/08/07 13:56:08, jlabanca wrote: >>> >>> >>> So there's one problem here: The GWT class is in the Core module, which >>> doesn't (and shouldn't) depend upon the UserAgent module. I think that >>> to get this right, we'll need to do one of the following things: >>> - Add this code to some class in User. Not my favorite option. >>> - Add a new UserAgent module that lives in its own package, so that we >>> can add UserAgent-related stuff to a class there. Perhaps >>> com.google.gwt.ua.UserAgent? >>> - I kind of like this option, because (a) it gets UserAgent out of the >>> user packgage, where it never should have been in the first place, and >>> (b) it gives me a place to put other UserAgent-related methods I need to >>> add. >>> >>> What say you? >>> >>> http://gwt-code-reviews.appspot.com/57804 >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
