From Passion to Profession
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use
  • Home
  • Notes
  • Projects
  • Resources
    • Discovery Log
    • Books I Read
    • Blogs I Visit
    • Tools I Use

Factory Method Design Pattern Example

6/29/2013

0 Comments

 

overview

A factory method is a method in a subclass that creates an object. Factory Method pattern defines a Creator interface with Factory Methods (“create” methods) that are implemented by sub-classes. According to Design Patterns by GoF, the intent of Factory Method is to,
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method (pattern) lets a class defer instantiation to subclasses.
Picture
source: GoF

Read More
0 Comments

Different Singleton Implementations

6/26/2013

0 Comments

 
‘Singleton’ is a fancy word for ‘global variable.’

​The intent of Singleton:
Ensure a class only has one instance, and provide a global point of access to it. - GOF
All singleton implementations offer NO public constructor but only private constructor to enforce non-instantiability. In Java, however, because a private constructor can still be accessed through a backdoor of using reflection, you want to add extra check in the private constructor to guard against reflection vulnerability (see examples below).


Read More
0 Comments

Abstract Factory Design Pattern Example

6/25/2013

5 Comments

 

overview

What is Abstract Factory pattern and what is it for? According to Design Patterns by GoF, the intent of Abstract Factory is to,
Provide an interface for creating families of related or dependent objects without specifying their concrete classes. 
Picture
source: GoF

Read More
5 Comments

Builder Design Pattern Example

6/23/2013

0 Comments

 

overview

What is Builder pattern and what is it for? According to Design Patterns by GoF, the intent of Builder is to,
Separate the construction of a complex object from its representation so that the same construction process can create different representations. 
Picture
source: GoF

Read More
0 Comments

    Categories

    All
    Algorithm
    Concurrency
    CQ
    Data Structure
    Design Pattern
    Developer Tool
    Dynamic Programming
    Entrepreneur
    Functional Programming
    IDE
    Java
    JMX
    Marketing
    Marklogic
    Memory
    OSGI
    Performance
    Product
    Product Management
    Security
    Services
    Sling
    Social Media Programming
    Software Development

    Feed Widget

    Archives

    May 2020
    March 2020
    April 2018
    March 2018
    February 2018
    December 2017
    March 2017
    November 2016
    June 2016
    May 2016
    April 2016
    October 2015
    September 2015
    August 2015
    September 2014
    July 2014
    June 2014
    May 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013

    RSS Feed

in loving memory of my mother  and my 4th aunt
Photos from net_efekt, schani, visnup, Dan Zen, gadl, bobbigmac, Susana López-Urrutia, jwalsh, Philippe Put, michael pollak, oskay, Creative Tools, Violentz, Kyknoord, mobilyazilar