Hi,

after working for some time with OSGi now I have a bunch of questions that I couldn't find a satisfying answer for yet. Maybe some of you can help me to clarify those:

1) Why is OSGi using annotations as configuration objects?
It is really strange that within an @Activate method the annotation-config object is null but I still can call the methods defined on it.Wouldn't DTOs be the better choice? Maybe in combination with an annotation and annotation processor that assures the DTO consists only of primitives, arrays of primitives or other DTOs. Configuration values like "component.name" could be represented as values of a ConfigurationDTO containing a ComponentDTO which has a name variable.
2) Why are the OSGi DS annotations RetentionPolicy.CLASS?
Sometimes it would be nice to find the annotated methods/fields at runtime, e.g. at testing in a non-OSGi environment
3) Why are the OSGi DS annotations not inherited?
I know that there is a option in bnd for this, but I'm not sure if or when it is save to use this option, as I'm not really sure about the implications this might have.Are there any best practices/patterns for the cases where I have mutliple implementations of one service and all of them share code that should be called e.g. during activation or deactivation?

Any explanation is appreciated :)

Kind regards,
Thomas
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to