Design patterns are very popular among the software developer. A design pattern is a well described solution to common software problem
Advantages of Software Design patterns :
- Using design patterns promotes reusability, that leads to more robust and highly maintainable code. It helps in reducing the total cost of ownership of the software product
- Since design patterns are already defined, it makes our code easy to understand and debug.
It leads to faster development and new members of the team to understand easily
JAVA Design patterns are divided into three categories
- Creational Design Patterns: provide solution to instantiate object in the best possible way in specific solutions.
- Structural Design Patterns : provide different way to create a class structure for example to using inheritance and composition to create a large object from small object
- Behavioral DesignPatterns : provide solution for the better interaction between objects and how to provide lose coupling and flexibility to extend easily.
Singleton Pattern
Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. It seems to be a very simple design pattern but when it comes to implementation, it comes with a lot of implementation concerns. The implementation of Singleton pattern has always been a controversial topic among developers. Check out Singleton Design Patternto learn about different ways to implement Singleton pattern and pros and cons of each of the method. This is one of the most discussed java design patterns.
Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. It seems to be a very simple design pattern but when it comes to implementation, it comes with a lot of implementation concerns. The implementation of Singleton pattern has always been a controversial topic among developers. Check out Singleton Design Patternto learn about different ways to implement Singleton pattern and pros and cons of each of the method. This is one of the most discussed java design patterns.
Well explained . Great article on singleton pattern . There is also good singleton pattern example visit Singleton class example
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete