commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: [beanutils2] Assertions class vs. lang Validate
Date Mon, 03 Mar 2014 08:10:07 GMT
Hi André


2014-03-01 19:50 GMT+01:00 André Diermann <andre.diermann@gmail.com>:

> But will upgrading to 1.7 will solve the core "issue", that some features
> (in detail: Assertions, MethodUitl and TypeUtil) are copied subsets of
> already implemented features in other Commons projects?
>

The stuff that we have implemented in the Assertions class can be replaced
by the methods available in Objects from java 7. You're right about
MethodUtil and TypeUtil.


>
> From what I can see commons.lang3 is already referenced by BU2 (although
> it's currently only used by TestBean).
>

Yes, but a test dependency doesn't get pulled in a user declares a
dependency to BU2. It's just that we don't want that users have lang in
their class path just because we need two or three methods here and there.


>
>
>
>
> 2014-03-01 18:33 GMT+01:00 Benedikt Ritter <britter@apache.org>:
>
> > I don't like the idea of creating some kind of component hierarchy, where
> > components higher up may depend on lower levels libs. This should be
> > decided for every individual case.
> >
> > In the case of BU2 I'd say it's better to change the language level
> > requirement to 1.7. We could use Objects.notNull.
> > Other benefits include the new ReflectiveOperationException root
> exception
> > [1] which was introduced in Java 7 and the multi catch blocks. This would
> > make the exception handling and wrapping code much more clearer.
> >
> > Benedikt
> >
> > [1]
> >
> >
> http://docs.oracle.com/javase/7/docs/api/java/lang/ReflectiveOperationException.html
> >
> >
> > 2014-03-01 17:50 GMT+01:00 André Diermann <andre.diermann@gmail.com>:
> >
> > > Simon, that makes totally sense to me :) ..that's why I also often
> > struggle
> > > to use StringUtils for instance... but it starts with only one method
> and
> > > after some time I find myself in having copied a lot of methods.
> > >
> > > That's why I like Gary's idea too. Regarding BU2, MethodUtil and
> TypeUtil
> > > are also subsets from their lang pendants. So, when extending BU2 more
> > and
> > > more to BU's feature set, there might be even more copied methods...
> > >
> > > But I am not so deep in BU2's component architecture like you guys, so
> to
> > > keep it lightweight is fine for more :) I was only wondering why it was
> > not
> > > reused.
> > >
> > > Thank you.
> > >
> > >
> > > 2014-03-01 17:32 GMT+01:00 Gary Gregory <garydgregory@gmail.com>:
> > >
> > > > My preference would be for components like [io] and [lang] to be
> reused
> > > > from other components as a dependency in order to avoid this kind of
> > > > duplication.
> > > >
> > > > Gary
> > > >
> > > >
> > > > On Sat, Mar 1, 2014 at 11:27 AM, André Diermann <
> > > andre.diermann@gmail.com
> > > > >wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I noticed that the majority (all?) functionality of the Assertions
> > > class
> > > > is
> > > > > already covert by commons-lang Validate [1].
> > > > >
> > > > > For instance Assertions.checkNotNull() is an equivalent to
> > > > > Validate.notNull().
> > > > >
> > > > > Is there a reason for this?
> > > > >
> > > > > Regards,
> > > > > André
> > > > >
> > > > > [1]
> > > > >
> > > > >
> > > >
> > >
> >
> http://commons.apache.org/proper/commons-lang/javadocs/api-release/index.html
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > > > Java Persistence with Hibernate, Second Edition<
> > > > http://www.manning.com/bauer3/>
> > > > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > > Spring Batch in Action <http://www.manning.com/templier/>
> > > > Blog: http://garygregory.wordpress.com
> > > > Home: http://garygregory.com/
> > > > Tweet! http://twitter.com/GaryGregory
> > > >
> > >
> >
> >
> >
> > --
> > http://people.apache.org/~britter/
> > http://www.systemoutprintln.de/
> > http://twitter.com/BenediktRitter
> > http://github.com/britter
> >
>



-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message