I reproduced my version of Abstract Factory Pattern in Java. I know it's redundant but can I get critical comments about my code. Is it really the classic implementation of the pattern or not?/** The demonstration of Abstract Factory Pattern* * Here the 'DocumentFactory' creates documents of types * 'Resume' or 'Letter' which are concrete classes responsible to* create things like 'FancyResume' or 'CoverLetter'* * The example is inspired by Wikipedia documentation of Abstract* Factory.*/interface letter{    void print();}class CoverLetter implements letter{    @Override    public void print(){        System.out.println(Cover letter printed);    }}class FancyLetter implements letter{    @Override    public void print(){        System.out.println(Fancy letter printed);    }}interface resume{    void process();}class CorporateResume implements resume{    @Override    public void process(){        System.out.println(Corporate resume processed);    }}class FancyResume implements resume{    @Override    public void process(){        System.out.println(Fancy resume processed);    }}//Create 'Concrete' factories class LetterFactory{    public letter getLetter(String type){        switch(type){            case Fancy:                return new FancyLetter();            case Cover:                return new CoverLetter();        }        return null;    }}class ResumeFactory{    public resume getResume(String type){        switch(type){            case Fancy:                return new FancyResume();            case Corporate:                return new CorporateResume();        }        return null;    }}// create abstract factoryabstract class DocumentFactory{    abstract LetterFactory letterFactory();    abstract ResumeFactory resumeFactory();}class DocumentCreator extends DocumentFactory{    @Override    LetterFactory letterFactory(){        return new LetterFactory();    }    @Override    ResumeFactory resumeFactory(){        return new ResumeFactory();    }}class abstractfactory{    public static void main(String args[]){        DocumentCreator creator = new DocumentCreator();        // create a fancy letter        letter myLetter = creator.letterFactory().getLetter(Fancy);        myLetter.print();        // create a corporate resume        resume myResume = creator.resumeFactory().getResume(Corporate);        myResume.process();    }}
Abstract Factory Pattern in Java
java;abstract factory