pekko icon indicating copy to clipboard operation
pekko copied to clipboard

=str Make SubFlow and SubSource a final class.

Open He-Pin opened this issue 2 years ago • 7 comments

Motivation:

Those two class should be final.

Update: I still think those classes should be marked final and was marked as final in Akka since 2.7.0 and no one complain. Who will extends those two classes outside of pekko ?

He-Pin avatar Sep 02 '23 13:09 He-Pin

Motivation:

Those two class should be final.

What's the reasoning behind them needing to be final, there may be some rare usecase to subclass it

mdedetrich avatar Sep 02 '23 13:09 mdedetrich

Motivation:

Those two class should be final.

What's the reasoning behind them needing to be final, there may be some rare usecase to subclass it

Forbidden user extension and final class sometimes faster too.

He-Pin avatar Sep 02 '23 14:09 He-Pin

I'm -1 on this

  • breaks bin compatibility
  • no proven perf gain
  • what's wrong with letting users extend classes?

pjfanning avatar Sep 02 '23 16:09 pjfanning

MiMA check can be fixed.

Extends this class will not work as no extension point, they are not marked because of a out of sight, not because of it was right.

+1 for this;

  1. introduce this will not break any real thing, who will do that.
  2. I was there, who wanted to extends this classes.
  3. prevent future user error.

He-Pin avatar Sep 02 '23 18:09 He-Pin

+1 When I really inherit this class, I should want to override something, except for direct use of delegate, what can I do?

If we don't know if it can be inherited, we should close it. Although it is possible to lose flexibility, but this is potential flexibility, but also we avoid potential dangers.

jxnu-liguobin avatar Sep 03 '23 06:09 jxnu-liguobin

Unlike Akka we follow semver which means we can only change this in 2.0.x.

Also I doubt this has any actual impact as JVM will make it effectively final as long as no one subclasses it.

mdedetrich avatar Jan 13 '24 08:01 mdedetrich

Ok, let's schedule it to 2.0.x, at least I think no one will be affected.

He-Pin avatar Jan 13 '24 09:01 He-Pin