On 2/15/07, <b class="gmail_sendername">Boris Unckel</b> <<a href="mailto:boris.unckel.mlg@gmx.net">boris.unckel.mlg@gmx.net</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
just one thing:<br>Could you explain what happens if two or more classes/jars provide the<br>service?<br>If more than one class/jar provides the service, which one is taken?<br>Which one has to be taken by the factory?<br>
</blockquote></div><br>The Service API allows you to enumerate all options. SLF4J has a choice,<br><br>#1: Accept the first JAR, report warning that you have others - this is pretty much the same behavior as we have today - the difference is that with the static binding method you will be unaware that you have deployed several implementations and you'll just get what came first in the classpath. Here we can at least issue a warning where we can not today.
<br><br>#2: Allow some sort of precedence to be assigned. You might always prefer the stderr logger in the case where multiple implementations are present. The idea being is someone deployed an imlpementation wrote to a network and one that wrote to a file they really might not be sure what they are doing and stderr might be the best bet to inform them of the configuration error - and again, the message can be very explicit - "hey, you deployed these specific loggers, here is what to do"
<br clear="all"><br>#3: You could allow a property to select one if multiple are present. Sort of like #2 but the precedence can be influenced by a system property. I'm not a huge fan of this one either.<br><br><br>--
<br><br>- Eric