Archive for the ‘Design Patterns’ Category

Using Enum To Implement Singleton Pattern

In the previous post Singleton Pattern: When and How to use it effectively, we have 4 ways to implement  Singleton Pattern. Today, I share with you another way to implement it with Enum. This way was provided by Joshua Bloch in his 2nd Effective Java book.

Continue Reading...

Singleton Pattern: When and How to use it effectively

With this post I will show you what it Singleton Pattern and how to use it  effectively.
First, consider definition for Singleton Patten:
The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it.
From this definition we can see the purpose of using this pattern:

It ensures we have at …

Continue Reading...

Design Patterns, lập trình viên cần phải biết.

Trong cty mình làm chỉ có 1 vài cá nhân chịu khó tìm hiểu vấn đề này còn lại hầu như không ai quan tâm và nhìn nó với ánh mắt chẳng ra gì. Thật đáng buồn!

Đang nghiền ngẫm thật kĩ các Design Patterns, lang thang trên google tìm được bài viết này, thấy cũng …

Continue Reading...