Class DefaultNOFactory<NMR extends ObjectNamerOps<NMD>,NMD extends DefaultNamedObject<NMD>,OBJ extends NMD>

java.lang.Object
org.bzdev.obnaming.NamedObjectFactory<DefaultNOFactory<NMR,NMD,OBJ>,NMR,NMD,OBJ>
org.bzdev.obnaming.DefaultNOFactory<NMR,NMD,OBJ>
All Implemented Interfaces:
Cloneable

public abstract class DefaultNOFactory<NMR extends ObjectNamerOps<NMD>,NMD extends DefaultNamedObject<NMD>,OBJ extends NMD> extends NamedObjectFactory<DefaultNOFactory<NMR,NMD,OBJ>,NMR,NMD,OBJ>
Default implementation for a named object factory. The default implementation is a bare-bones implementation suitable for simple applications. The type parameter OBJ is class of the named object that the factory will create (if it is a concrete class) or a named object class whose instances will be configured. The named objects created will have DefaultNamedObject as a common superclass and DefaultObjectNamer as the corresponding object namer. This factory does not define any parameters and simply serves as a common base class for other factories.

As an example, to create an object namer, a named object, and a factory for the named object, one would define the following classes:


  abstract public class OurNamedObject
        extends DefaultNamedObject<OurNamedObject>
  {
       ...
       protected OurNamedObject(OurObjectNamer namer,
                                String name,
                                boolean intern)
       {
          super(namer, name, intern);
       }
  }

  public class OurObjectNamer
       extends DefaultObjectNamer<OurNamedObject>
  {
       ...
       public OurObjectNamer() {
           super(OurNamedObject.class);
       }
  }

  abstract public class OurObjectFactory<OBJ extends OurNamedObject>
       extends DefaultNOFactory<OurObjectNamer,OurNamedObject,OBJ>
  {
       ...
       protected OurObjectFactory(OurObjectNamer namer) {
          super(namer);
       }
  }
 
Additional code (indicated by an ellipsis) is, of course, necessary to do anything useful.
  • Constructor Details

    • DefaultNOFactory

      protected DefaultNOFactory(NMR namer)
      Constructor.
      Parameters:
      namer - the object namer associated with this factory