Benefit of marking classes as final? #3434
Closed
gaborcsardi
started this conversation in
General
Replies: 1 comment 3 replies
-
Marking classes as The idea is that if you want to extend OpenTelemetry C++, you do it by implementing the public API interfaces, not by subclassing the SDK itself. This way, it’s clear how you can plug in your own logic, and we can keep improving the SDK without worrying about breaking user subclasses. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am wondering about the benefits of marking some classes
final
, e.g.Span
in the SDK.I am embedding opentelemetry-cpp into an R package, to bring OpenTelemetry to R. It is working great in general. Some things would be easier if I could subclass some of the SDK classes, though. E.g. I could work around #2667 easily. Especially if some
private
members could move toprotected
.So I am wondering why these classes are marked as
final
, and if that restricts creating opentelemetry-cpp wrappers in other languages. If that's a goal in opentelemetry-cpp at all.Beta Was this translation helpful? Give feedback.
All reactions