When speaking about factory, we should refer to the visualizer.itemsFactory method. It is the main responsible of instantiating all Visualizer artifacts (node, links, groups, decorators, controllers, knobs and default renderers).
This method return an instance of IFactory class. This class provides a factory method interface to each of the subclasses. In this class we find the addOrReplaceClassReference method that represents the factory method.
It maps a class reference to a referenceID. If the referenceID already exists in the factory, its referenced class will be replaced by newClass. This method is useful to enable the generation of a new class reference instance or to replace an existing one.
The basic idea so is that all items classes are uncoupled from the client.
One example of malipulating factory is using custom Knobs. we can use a custom knob like follows:
Here is an example showing how user can change the default behavior of the anchor knob ( the ports where links are connected ).
To do that, user have to create his own CustomAnchorKnob and then refer to it using the statement :