The only danger of static methods is that you can't override them. BeanUtils first suffered from this fate and they then made an instance version (BeanUtils2). Just said plainly, you can't customize well using factory classes/methods.
On Wed, Aug 14, 2013 at 3:04 PM, Emmanuel Bourg <ebo...@apache.org> wrote: > Le 14/08/2013 17:39, Adrian Crum a écrit : > > Instead of >> >> int columnInt = record.getValueAsInt(1); >> >> the developer would use >> >> Integer columnInt = Util.convertTo(record.**getValue(1), Integer.class); >> > > +1 for the static method, that would allow the use of a static import and > a very concise syntax like: > > Integer columnInt = to(Integer.class, record.getValue(1)); > > > That being said, [convert] could offer several patterns to perform type > conversion, and the use of proxies could be one of them. > > > Emmanuel Bourg > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > dev-unsubscribe@commons.**apache.org<dev-unsubscr...@commons.apache.org> > For additional commands, e-mail: dev-h...@commons.apache.org > > -- Cheers, Paul