Search Blog

Search duranek.blogspot.com

Monday, January 16, 2012

Facade Pattern ( Structural )

Facade Pattern ( One Of Structural Patterns ) 1) Simple interface to a larger body of code. Class Library. 2) Wrap a poorly designed collection of APIs with a single well-designed API. 3) Utility Class is a facade. 4) Calling a one function for a set of functions 5) JOptionPane.showMessageDialog() ornek bir facade. AWT ile bir suru sey yazacagina kolay bi sekilde hallediyorsun. Sık kullanılan, ve terzi usulu olmayan bir isi, yani almost her zaman aynı şekilde yapılan bir işi tek fonksiyona indirmek. 6) Facade aslinda bir obje, onu yaratip onun uzerinden is yapiyorsun. Yani bir singleton gibi, yok constructor private olacak, yok getInstance static olacak gibi kurallari yok. Bir mucize aramamak lazim. Zaten herkesin dogal olarak yaptigi utility fonksiyonlarini bir class ta toplarsan, ona facade deniyor. 7) Also Facade is not the only entry point to the sub-system but is a convenient point of communication to the subsystem and client can always have the direct access to the subsystem. 8) Facade ayni zamanda singleton olabilir, birden fazla yaratilmasina gerek yoksa, ama boyle bir sart yok.

No comments: