본문 바로가기

닷넷관련/디자인패턴

(7)
factory pattern c# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FactoryPatternSample { class Program { interface ILogger { void Log(string Message); } enum LoggerType { File, Database, EventViewer } class FileLogger : ILogger { public void Log(string Message) { Console.WriteLine("{0} - Logged in File.", Message); } } class DatabaseLog..
using .NET 4's Lazy<T> type - Singleton 패턴 Sixth version - using .NET 4's Lazy type If you're using .NET 4 (or higher), you can use the System.Lazy type to make the laziness really simple. All you need to do is pass a delegate to the constructor which calls the Singleton constructor - which is done most easily with a lambda expression. public sealed class Singleton { private static readonly Lazy lazy = new Lazy(() => new Singleton()); pu..
codeproject 의 디지인 패턴 design pattern 예제들 http://www.codeproject.com/KB/architecture/#Design+Patterns
c# 디자인 패턴 http://www.dofactory.com/Patterns/Patterns.aspx Design Pattern TutorialDesign patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.The Gang ..
추천할 만한 java design pattern 사이트 추천할 만한 java design pattern 사이트 http://www.oodesign.com/ Creational Design Patterns:Click to zoom Singleton - Ensure that only one instance of a class is created and Provide a global access point to the object. When to Use , Common Usage , Example: Lazy Singleton in Java, Example: Early Singleton in JavaClick to zoom Factory(Simplified version of Factory Method) - Creates objects without exposing..
Controller Patterns for ASP.NET http://www.developerfusion.com/article/9450/controller-patterns-for-aspnet/ This is the second in a series of three articles that looks at the built-in support for standard design patterns in ASP.NET, and how you can implement common patterns in your own applications. In our previous article, we saw ASP.NET automatically implements the Model-View-Presenter pattern when you use the built-in "code..
Observer Pattern in Asp.net observer 패턴이다. 옵져버 패턴은 이를 살펴보는것이 아니라... 변경된 것을 알려주고 이를 반영하는 것이다. 즉.... 살펴보는것이 아닌 알려주는 역할이라는 것을 숙지해야 한다. http://www.codeproject.com/KB/aspnet/observer-pattern-asp-net.aspx