/// returns the factory that corresponds to the given model protected static UMLFactory getFactory(UMLModel model) { UMLFactory instance = null; instances.TryGetValue(model, out instance); return(instance); }
private static void addFactory(UMLModel model, UMLFactory factory) { if (!instances.ContainsKey(model)) { instances.Add(model, factory); } }
/// returns the singleton instance of the factory public static UMLFactory getInstance(UMLModel model) { UMLFactory instance = getFactory(model); if (instance == null) { instance = model.factory; } return(instance); }
public UMLFactory(UMLModel model) { this.model = model; UMLFactory.addFactory(model, this); }