Tags » Design Pattern

Singleton Design Pattern

Singleton is a design pattern for object construction. It falls under the category of “creational” design patterns. As the name somewhat suggests, it enables us to have one and only one instance of a class. 767 more words

Design Patterns

Law Of Demeter

The Law of Demeter (LoD) in a design principle, presented in Northeastern University at the end of 1987. The LoD aims to reduce coupling between classes, it says, “a module should not know about the innards of the objects it manipulates” ( 823 more words


Design Pattern of the week: Builder

This unassuming design pattern is one of my favorites because it makes your code so compact and readable.

My intention here is just to give you a quick sense of how good this pattern is and how to write and use it.   263 more words

Arturo Falck

How to implement a Factory Pattern in java!

Factory pattern is one of the Creational Patterns . Factory is a name given to a piece of code that generates an object based on a given input or without any input. 264 more words


Rewriting the Event Manager

Since the beginning I was aware that one of the most critical and difficult part of the development of Wizards’ Duel would have been the… 729 more words


Learning Design Pattern From Unit Test Framework 4 (Template Method Pattern)

承接上一篇文章的Example 5,我們將在以下的範例將Test class用Macro來表示,畢竟每寫一個Test就要時做一個class也太麻煩了,而且每個test class都大同小異,用一個Macro來表示,可以讓User方便的撰寫Tests。 899 more words

Learning Design Pattern From Unit Test Framework 3 (Singleton Pattern)

再來我們要解決的是第一篇文章一開始提到的第1個問題:簡化Test的撰寫,讓User在撰寫Tests時可以自動把Tests register到CUnitTest這個class裡面。我們會透過一個很tricky的static private member vairable來達成這個任務。 438 more words