Factory pattern

can you explain me what means this architecture and how i can instanciate my object :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
classe A {
friend class B;
friend class C;

virtual int function1()=0;
virtual int function2()=0;

}
class D{

virtual int function3(A *a , x, y)=0;

}
class B: public D{
A * a;

int function3(A* a, x, y);

}
class C: public D{
A * a;
int function3(A *a , x, y);

}
Last edited on
You can create a B,C or D in the same way you'd normally create an object.

what does your thread title have to do with your question?
but i need to use A functions, and B,C functions too.

1
2
3
4
5
6
7
8
A *a ;

B b = new B();
b.function3(a, x, y);

C c = new C();
b.function3(a, x, y);

is this a correct implémentation ?
Topic archived. No new replies allowed.