Replies: 2 comments 11 replies
-
I like this proposal.
It could even be considered to move the actual implementation to the |
Beta Was this translation helpful? Give feedback.
-
This does not add any real value to the spec. You can criticize the prior API name choices, but just replicating them under the current naming fashion does not add real value and only create confusion of why there are now 2+ ways to do a thing. So -1 from me. |
Beta Was this translation helpful? Give feedback.
-
FrameworkUtil
has currently some static method to get a Bundleosgi/org.osgi.framework/src/org/osgi/framework/FrameworkUtil.java
Line 210 in 743a80f
osgi/org.osgi.framework/src/org/osgi/framework/FrameworkUtil.java
Line 226 in 743a80f
and a Filter
osgi/org.osgi.framework/src/org/osgi/framework/FrameworkUtil.java
Line 84 in 743a80f
But from code point of view its rather bad to rely on static util class:
Instead of this, in recent java versions static interface methods have become quite popular as they are quite obvious to find, related to the objects return value and gives the reader a clear hint of the context, for example:
I think it would be good to adapt this for OSGi as well to have:
Filter.of(String)
Bundle.of(Class<?>)
Bundle.of(ClassLoader<?>)
these then can just delegate the the
FrameworkUtil
calls.For sure this is completely "non-functional" and only adds some kind of syntactic sugar but would make code using these much more readable and more align to modern code styles.
Beta Was this translation helpful? Give feedback.
All reactions