jeudi 23 juin 2016

Please identify the design patterns used here [on hold]

I have some code and I wish to identify design pattern(s) being used here. Here is the code:

class A{
public:
    A(){};
    void Foo();
};


class B{
public:
    static X func1(){}
    static X func2(){}
    static X func3(){}
    static X func4(){}
private:
    B(){}
};


class C{
public:
    C(){}
    virtual void Goo(){}
};


class D : public C{
public:
    D(X &x){}
    void Moo(){}
};


D* d;

A::Foo(){
    B::func1();
    B::func2();
    B::func3();

    d = new D(B::func1());
};

so far i've identified that class B is a singleton class. Class C is a base class that uses the factory pattern with class D.

But does class A use a visitor pattern with class B and class D

Aucun commentaire:

Enregistrer un commentaire