DEV Community

Discussion on: Design Patterns: Abstract Factory

Collapse
 
zyabxwcd profile image
Akash • Edited

'I wouldn't want my VictorionChair to be directly coupled with VictorianTable or VictorianSofa.' could you elaborate on this more (with some example if possible)?
also while I was reading the article you embedded the link of, I had a question. why is the return type of createButton inside suppose WinFactory declared as Button instead WinButton, although that function returns an instance of WinButton but why use the interface as return type instead of the class of that particular family? I mean when and why will WinFactory ever create a Button of some other family instead of WinButton?
BTW great article :)