'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 :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
'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 :)