Model Creation Factory


  • As mentioned in Dev Doc Palette, the palette requires a model creation factory to support the creation tools. The factory's constructor requires the class to be created.
  • EMF provides factories to generate instances of elements.
  • EMF provides one factory per package.
  • Throughout our application, we frequently have to generate new instances of objects.


  • Central location to obtain new model element instances
  • static method to obtain new objects instantly
  • initializes model elements in a uniform fashion.
  • usage example:
OrFork newOrFork = (OrFork) ModelCreationFactory.getNewObject(getUrnspec(), OrFork.class);
  • requires an instance of a URNspec to be able to give an adequate id and unique name, if relevant.
  • Use this method for all model elements, except URNspec which has its own getNewURNspec()
  • Overloaded method has third argument for passing a type integer, to preset the type for stubs and components

-- Jason Kealey - 08 Jul 2005

Topic revision: r1 - 08 Jul 2005 - 13:37:43 - Jason Kealey
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback