The most common way would be to put all items into a group. Furthermore, there is a statement receivedCommand, so, 2 rules instead of 8 rules:
rule "LR Ceiling light"
when
Item S_LR_Ceiling_D_E1 received command or
Item S_LR_Ceiling_D_E2 received command
then
S_LR_LIGHT_Ceiling_S.sendCommand(receivedCommand)
end
rule "DR Ceiling light"
when
Item S_DR_Ceiling_D_E1 received command or
Item S_DR_Ceiling_D_E2 received command
then
S_DR_LIGHT_DiningTable1_S.sendCommand(receivedCommand)
end
With a group, as said before, you could reduce this to one rule, but I doubt it would be less code.
If there are much more switches and actuators - let’s say about 10 switches - one could get information about the last updated item (of the group, containing all switches) and then build the name for the actuator, which has to be updated.
I did use the method Item.sendCommand(State) as this is more reliable when using vars. See sendCommand() Documentation - #9 by rlkoshak for details.