Sunday, December 11, 2016

JAVA Design Patterns

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
  1. Creational Design Patterns: provide solution to instantiate object in the best possible way in specific solutions.
  2. 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
  3. 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.

Related Posts:

  • Android2 Can we change application name in after deployment? Things That Cannot Change: The most obvious and visible of these is the “manifest package nam… Read More
  • Android Test2 Android Test 2 Questions Time limit: 00:24:49 1 points 1.  While developing Android applications, developers can test their a… Read More
  • Advance JAVA What is HashMap & Map ? Map is an Interface and HashMap is class Implements Map Map<K,V> is an interface, HashMap<K,V>&… Read More
  • Android Test1 1.  When contentProvider would be activated?   A )   using Intent   B )   using SQLite … Read More
  • Android What is Activity ? An activity is an application component that provides a screen with which users can interact in order to do something, What is … Read More

3 comments:

  1. Well explained . Great article on singleton pattern . There is also good singleton pattern example visit Singleton class example   

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete