If this is the case, I would encourage the use of a fluent API, e.g.
*AssertJ's* assertions, to replace *Spring* core's capable Assert
<http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/Assert.html>
[1]
class.

Resorting back to the ugly and often brittle conditional blocks at the
beginning of methods, as in...

public <ReturnType> someMethod(Object someArgument) {

  if (*isNotValid*(argument)) {
    throw new IllegalArgumentException(String.format("[%s] argument is not
valid... ", argument));
  }

  ...
}

Would be quite disappointing and make the codebase more difficult to
read/maintain.  Often times, developer's "validation logic" is not even as
elegant as what I have demonstrated above, but even this small snippet is
cumbersome to repeat (defying DRY).

I also think duplicating the *Spring* Assert class in the Geode codebase
would not be a good option either.

My $0.02,

-John

[1] http://docs.spring.io/spring/docs/current/javadoc-
api/org/springframework/util/Assert.html


On Wed, Oct 5, 2016 at 4:45 PM, Jinmei Liao <jil...@pivotal.io> wrote:

> Is there a initiative to get spring-core dependency out of geode-core? The
> only places we are using spring-core classes in geode-core are those Assert
> statements like: Assert.isNull, Assert.notNull etc. Should we try to get
> rid of those?
>
> --
> Cheers
>
> Jinmei
>



-- 
-John
503-504-8657
john.blum10101 (skype)

Reply via email to