Pattern
< SOFTWARE DEVELOPMENT
< developer.net
Bu makalemizde ,NET Framework 2,0’la beraber C# diline ve CLR’ye eklenmiş olan generics (genellemeler) lerden bahsetmek istiyorum. Genellemeleri kullanarak parametre olarak farklı tipleri kabul edebilen ve bunlarla çalışabilen metotlar, sınıflar yazabiliriz. C#’daki genellemeler C++’da yer alan templates (şablonlar) konusuyla benzerlikler gösteriyor. Genellemelere C++ şablonlarının C# uyarlanmış kullanışlı, güvenli yapılarak olarak bakabiliriz.
In computer programming , lazy initialization is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed. This is typically accomplished by maintaining a flag indicating whether the process has taken place. Each time the desired object is summoned, the flag is tested. If it is ready, it is returned. If not, it is initialized on the spot.
Singleton deseni ile başladığım "design pattern" yazı dizisine "Abstract Factory" deseni ile devam ediyoruz. Bu yazıda "Creational" desenler grubunun en önemli ve en sık kullanılan deseni olan Abstract Factory(Soyut Fabrika) tasarım deseninin C# ile ne şekilde uygulandığını bir örnek üzerinden göstereceğim. İlk yazımda da bahsettiğim gibi "Creational" grubundaki desenler bir yada daha çok nesnenin çeşitli şekillerde oluşturulması ile ilgili desenlerdir.
The factory method pattern is a creational design pattern used in software development to encapsulate the process of creating the objects. Concerns: Which object needs to be created. Managing the life time of the object. Managing the build-up and tear down concerns of the object.
The abstract factory pattern is a software creational design pattern that provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes. [ 1 ] In normal usage, the client software creates a concrete implementation of the abstract factory and then uses the generic interfaces to create the concrete objects that are part of the theme. The client does not know (or care) which concrete objects it gets from each of these internal factories, since it uses only the generic interfaces of their products. [ 1 ] This pattern separates the details of implementation of a set of objects from their general usage and relies on object composition, as object creation is implemented in methods exposed in the factory interface. [ 2 ] An example of this would be an abstract factory class DocumentCreator that provides interfaces to create a number of products (e.g. createLetter() and createResume() ).
Design Patterns for C# and Visual C# C# Design Patterns illustrates twenty-three classic Gang of Four (GoF) design patterns—as well as the patterns which grew from them—as they are used in the C# language on the .NET framework. These design patterns are standards; but, their implementations can vary with the object-oriented language.