Forums Register Login

Thinking wild

+Pie Number of slices to send: Send
Just thinking wild ...

Can we call interface as a super-type of types (classes) that, in turn refers to behavior (objects)?

Actually, this makes understanding patterns a little simpler, probably.

For example, Abstract Factory becomes, two interfaces, AbstractFactory and AbstractProduct.

AbstractFactory = {ConcreteFactory1, ConcreteFactory2, ...,ConcreteFactoryM}
AbstractProduct = {ConcreteProduct1, ConcreteProduct2,....,ConcreteProductN}

The matrix of objects it can create would be M x N, whereas the implementation classes would be only M + N. This makes sense only when M + N > 3 though (both M, N are natural numbers).

I guess, this way, we can explain some of the GoF descriptions of AF pattern.

Any comment?

- P Das
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 671 times.
Similar Threads
What is the difference between AbstractFactory and Factory pattern
composition - cohesion relationship
another design question on 'program to interfaces' or not
difference between factory pattern , abstract factory pattern and command pattern
Search Algorithm again
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:19:25.