vendredi 24 avril 2015

Understanding Java singleton Design pattern

During reading the Spring Framework's documentation I came across the following:

Spring’s concept of a singleton bean differs from the Singleton pattern as defined in the Gang of Four (GoF) patterns book. The GoF Singleton hard-codes the scope of an object such that one and only one instance of a particular class is created per ClassLoader. The scope of the Spring singleton is best described as per container and per bean.

I don't understand why per ClassLoader? Why don;t per the entire application or in the Context they are considered to be the same things?

Aucun commentaire:

Enregistrer un commentaire