OpenEMS/openems

Java package/bnd-bundle naming scheme

markusr opened this issue · 1 comments

Is there any naming pattern for the bnd-bundles and java-packages?

E.g. Kaco has the following bnd-bundles

io.openems.edge.kaco.blueplanet.hybrid10
io.openems.edge.pvinverter.kaco.blueplanet
io.openems.edge.batteryinverter.kaco.blueplanetgridsave

Janitza has 1 bnd-bundle io.openems.edge.meter.janitza and the following packages:

io.openems.edge.meter.janitza.umg511
io.openems.edge.meter.janitza.umg604
io.openems.edge.meter.janitza.umg96rme

but Schneider has 1 bnd-bundle io.openems.edge.meter.schneider.acti9.smartlink and the same java package name.

Wouldn't it be better to only have 1 bnd-bundle per vendor following a defined pattern.

My Proposal is io.openems.edge.<vendor>.<product_or_seriesname>

Example:
io.openems.edge.kaco bnd with packages

io.openems.edge.kaco.blueplanethybrid10tl3
io.openems.edge.kaco.blueplanetpv
io.openems.edge.kaco.blueplanetgridsave

io.openems.edge.janitza bnd with packages

io.openems.edge.janitza.umg511
io.openems.edge.janitza.umg604
io.openems.edge.janitza.umg96rme

io.openems.edge.schneider bnd with packages

io.openems.edge.schneider.acti9smartlink

(This issue came up because we are implementing another Schneider smart meter and I don't know how to name it.)

Hi. Such a general question might fit better in the OpenEMS Community: https://community.openems.io/

No, there is no generalized naming scheme for bundles (yet). Often we decide to group bundles by their technology and main 'nature' - e.g. /io.openems.edge.kaco.blueplanet.hybrid10 uses a proprietary TCP protocol and couples ESS, Meter, Charger, etc, whereas io.openems.edge.pvinverter.kaco.blueplanet uses Modbus. This keeps bundle dependencies more transparent and implementations can be easier identified (e.g. "What are supported meters?").

Due to the nature of OSGi this is not really a technical dept, because dependencies are defined per Java Package and not per Bundle/directory name, so refactoring is not a big issue. But I agree with you, that the proposed structure is feasible and while implementing new devices, we should slowly approach that target.

So yes: if you implement another Schneider device (and I believe more Schneider devices will be coming soon...) and it uses Modbus, I suggest you rename the existing bundle the way you suggested and put your new package in there.

Thanks & Regards,
Stefan