commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] silly classes naming question
Date Thu, 13 Sep 2012 11:17:55 GMT
On Wed, Sep 12, 2012 at 06:04:51PM +0200, Luc Maisonobe wrote:
> Le 12/09/2012 16:32, Gilles Sadowski a écrit :
> > 
> > I think that "silly classes" should not be allowed in CM!
> 
> As all I am able to do is silly work, [...]
                            ^^^^^^^^^^
Didn't you mean "silly walk"? 8-P

> [...]
> > 
> > That seems safe. But I don't fully understand the issue...
> 
> Here is a really striped down version. Suppose we have a paremeterized
> interface:
>   interface TheInterface<T> { public void f(T t); }
> 
> Then I could write this:
> 
>   class MyClass {
>     public void f(A a) { ... }
>     public void f(B b) { ... }
>   }
> 
> But I could not write the following despite there are no type conflicts:
> 
>   class MyClass implements TheInterface<A>, TheInterface<B> {
>     public void f(A a) { ... }
>     public void f(B b) { ... }
>   }
> 
> The workaround I propose is to write this:
> 
>   class MyClass implements TheInterface<A> {
>     public void f(A a) { ... }
>     public void f(B b) { ... }
>   }

Yes, that's what I had understood.

> 
> I will do this with MyClass replaced by AbstractLeastSquaresOptimizer
> and TheInterface replaced by BaseAbstractMultivariateVectorOptimizer. So
> users will already be able to provide either a
> DifferentiableMultivariateVectorFunction or a
> MultivariateDifferentiableVectorFunction. This will help transition when
> 4.0 is out, and should not break compatibility between 3.0 and 3.1.

Unfortunately, it will not help when one needs to pass the optimizer's base
class. But as you said, we can do nothing about this Java type-erasure
"feature"... [This is an argument to hurry towards 4.0!]


Best regards,
Gilles

> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message