On 03/18/2011 05:20 PM, Manuel Collado wrote:
> El 18/03/2011 14:45, Hussein Shafie escribió:
>> On 03/18/2011 01:31 PM, Manuel Collado wrote:
>>> ...
>>> In brief, is it really necessary to invent always different names for
>>> commands in different configurations that may eventually be used at the
>>> same time?
>>
>> Yes, you should always use globally unique command names in your custom
>> configurations.
>>
>> Here at XMLmind, we do this by adding a short "XXX." prefix to the
>> actual name of the command. Doing the same in your custom configurations
>> is strongly recommended.
> 
> Is this limitation/recommendation documented somewhere?
> 
>>
>> Actual examples:
>> ---
>>    <command name="dita.editIndexTerm">
>>      <class>com.xmlmind.xmleditext.dita.EditIndexTerm</class>
>>    </command>
>>
>>    <command name="docb.editIndexTerm">
>>      <class>com.xmlmind.xmleditext.docbook.EditIndexTerm</class>
>>    </command>
>>
>>    <command name="db5.editIndexTerm">
>>      <class>com.xmlmind.xmleditext.docbook.EditIndexTerm</class>
>>    </command>
>> ---
>>
>> Of course, in the above examples, all the commands serve the same
>> purpose, but have different implementations (or db5.editIndexTerm, the
>> DocBook 5 instance will have a slightly different behavior from
>> docb.editIndexTerm, the DocBook 4 instance).
>> ...
>>> If what I describe is a possible bug,
>>
>> No, it's not a bug in XXE.
> 
> Well, not a bug. But IMHO a serious limitation. In the extreme case, one 
> should consult all XXE powerusers around the world before choosing a 
> command name prefix, to be sure there are no clashes.

This is not needed for the C language which does not support namespaces
despite the very large number of function libraries floating around the
world. Therefore I think this should not be a problem for XXE commands.



> 
> If the unique global namespace limitation persists, then I would 
> recommend, at least:
> 
> - Make it explicit somewhere in the documentation, and
> 
> - Issue a warning alert at startup or at document open if there are 
> actually duplicated command names.
> 
> Not a real solution, I think, but at least it would have saved me a full 
> work day of tests before realizing why activating the same option in the 
> current custom menu does different things at different times (I was 
> comparing a couple of alternate variants of a common base configuration).
> 
> Thanks for your quick answer.
> 

Sorry but this is not a bug, nor a limitation. It just work like this
and for now, this posed no problem whatsoever.

We of course agree to document the fact that XXE uses one global command
registry, just like it uses one global configuration registry, one
global image toolkit plug-in registry, one global XSL-FO processor
plug-in registry, etc.

 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to