On Thu, Mar 18, 2010 at 12:32 PM, BobV <b...@google.com> wrote:

> > Depending on the string name of an enum looks suboptimal.
>
> What are you referring to?
>
>
A deferred binding option is a selection from an enum.  Normally the name of
an enum is not significant.  It's only used in debuggers and for binding
identifiers to the chosen enum.

Thus, globbing on the name of a deferred binding property looks like doing
this in Java to me:

  enum Locale { EN_UK, EN_US, ES_AR, ES_ES }

  boolean useit(Locale locale) {
    return locale.name().startsWith("EN_");
  }


It breaks down because the person writing the enums has to always write them
with a careful hierarchy represented in the names.  Instead of safari, g1,
nexus, and chrome, we have webkit.safari, webkit.chrome, webkit.android.g1,
webkit.android.nexus.  This is awkward when it works, but it completely
breaks down once there's another axis to classify the browsers with.  For
example, what's the glob that combines all mobile browsers?


Lex

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to