Saturday, November 3, 2012

bridge pattern



  • bridge pattern

The bridge pattern is a design pattern used in software engineering which is meant to "decouple an abstraction from its implementation so that the two can vary independently
The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes
http://en.wikipedia.org/wiki/Bridge_pattern


  • Usages 


  1. when you want to avoid permanent binding between abstraction and its implementation
  2. when you want to let abstractions and their implementations be extensible by subclassing
  3. changes in the implementation of abstractions should have no impact on clients so that client codes should not be recompiled
  4. mostly used in drivers like database drivers

Factory Pattern


  • Define an interface for creating object.But let subclasses decide which class to instantiate




  • Bir factory şablonu, kendisine verilen parametre ve değerlere göre mümkün olan birkaç sınıftan istediğimizi oluşturur ve bize döndürür. Genellikle geriye döndürülen tüm sınıflar ortak bir ebeveyn sınıfından yada arayüzünden oluşturulmuştur.
http://members.comu.edu.tr/msahin/courses/ust_duzey_files/patterns/factory.pdf