Why does isPluginExt take a name only, not also a type?

Looking at the samplePlugin code, for a plugin to work on a given layer, it looks for a name: match, but I can think of plenty of use cases where the name: may change often, but the type: stays the same, and furthermore it means that there’s one more thing to remember to tweak if one tries to reuse the code in a different model, or we have to adopt a repetitious naming convention such as prefixing node names with a type abbreviation.

So, why was this design decision made for isPluginExt(), and is there any way to test for type: instead?


If using the plugin factory, then unfortunate, no way to test for type. The plugin registry can be used to register the plugin type and the creator. Then you can use the registry to look up the plugin based on type.