Annotation Type FactoryMethodPattern


  • @Retention(RUNTIME)
    @Target(TYPE)
    @Documented
    @DesignPattern(type=CREATIONAL,
                   related={AbstractFactoryPattern.class,TemplateMethodPattern.class,PrototypePattern.class})
    public @interface FactoryMethodPattern
    Intent [GoF, pg 107]: Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

    This pattern refers to the GoF factory method, which differs greatly from the static factory method commonly found in the refactoring literature.

    Factory Method Structure

    Since:
    2010-08-09
    Author:
    Heinz Kabutz
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String comment  
      java.lang.Class[] participants  
    • Element Detail

      • participants

        java.lang.Class[] participants
        Default:
        {}
      • comment

        java.lang.String comment
        Default:
        ""