[#proposal] OSGi Annotations and Configuration

17 views
Skip to first unread message

Lars Kiesow

unread,
Oct 2, 2020, 2:01:18 PM10/2/20
to d...@opencast.org
Hi everyone,
I hereby #propose that for all new code added to opencast

- OSGi annotations should be used instead of XML files for specifying
components and dependencies.

Reason: This is far less error prone. Even on today's Review Friday,
we had problems with the XML files again. No wonder if you write
these manually.


- @Activate and @Modified should be used for reading and updating
configuration instead of implementing a Managed Service.

Reason: Managed services are usually unnecessary and often make
runtime updates to services problematic (see webinar below)

If there is a reason to go against these rules, it must be clearly
stated on a pull request.

OSGi component annotation example:

https://github.com/opencast/opencast/blob/bfa6c9c3fcab12d17cf0b474416545a42b34a789/modules/hello-world-impl/src/main/java/org/opencastproject/helloworld/impl/HelloWorldServiceImpl.java#L33-L39


If you want to know more about the service configuration and see
annotations in action, watch the “Opencast OSGI Configuration“ webinar:

https://video.ethz.ch/events/opencast/webinars/7261ea70-ce36-4e17-8634-963966311028.html

This proposal passes on Wednesday evening if no one objects.

Best regards,
Lars

Greg Logan

unread,
Oct 2, 2020, 2:06:33 PM10/2/20
to d...@opencast.org
+1

G

--
To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@opencast.org.

Maximiliano Lira Del Canto

unread,
Oct 2, 2020, 2:31:33 PM10/2/20
to d...@opencast.org
+1
--
Maximiliano Lira Del Canto
Telematikingenieur
Handynummer: +49 163 863 00 86
Köln, Deutschland.

Lars Kiesow

unread,
Oct 2, 2020, 3:45:08 PM10/2/20
to d...@opencast.org
To give you an example of how this would look like, I've created a pull
request which switches both the annotations and the configuration
handling in the silence detection module:

https://github.com/opencast/opencast/pull/1901

–Lars

Matthias Neugebauer

unread,
Oct 5, 2020, 10:12:31 AM10/5/20
to Opencast Development, Lars Kiesow
+1

Julian Kniephoff

unread,
Oct 6, 2020, 1:45:17 AM10/6/20
to d...@opencast.org
+1
--

ELAN e.V.
Karlstr. 23
26123 Oldenburg
Amtsgericht Oldenburg
VR 200644

Geschäftsführer: Dr. Norbert Kleinefeld
Vorstand:
- Prof. Dr. Thomas Hanschke (Vorsitzender)
- Prof. Dr. Knut Baumann
- Prof. Dr. Oliver Bott
- Isabel Müskens
- Dr. Marion Rieken

Katrin Ihler

unread,
Oct 7, 2020, 9:47:40 AM10/7/20
to d...@opencast.org
+1
--
ELAN e.V.
Heger-Tor-Wall 12
D-49074 Osnabrück
https://elan-ev.de

Lars Kiesow

unread,
Oct 8, 2020, 12:17:48 PM10/8/20
to d...@opencast.org
No objections -> this proposal has passed.
–Lars

On Fri, 2 Oct 2020 20:01:13 +0200
Reply all
Reply to author
Forward
0 new messages