Dofactory.com
Dofactory.com
 Back to list
Views:   8.6K
Replies:  1
Archived

Are these 'Good Design Principles' of the Factory Method pattern?

Hello,

I am new to Design Patterns.  Looking at the example code in the Design Pattern Framework, my understanding of the Factory Method pattern is that it uses the following "good design principles":

  1) Favor composition over inheritance - private List<Page> _pages = new List<Page>();
  2) Programming to an interface - Document[] documents = new Document[2];
  3) Encapsulating changes - public abstract void CreatePages();
  4) Between 2 classes we have week relationship, i.e. loose coupling
  5) Using open/close principle - cannot change existing classes but we can add more variants, i.e. extensions

Are my conclusions correct? 
Are there additional good Design Principles in the Factory Method?

Thanks!



Efim Zabarsky, May 08, 2011
Reply 1
This may be too late but, yes all your undestandings are correct. However, #1 varies on case by case basis.
Siva M, May 22, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.