Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oussama-zbair/cross-language-pattern

Implementation of singleton, factory, design patterns in different languages.
https://github.com/oussama-zbair/cross-language-pattern

design-patterns

Last synced: about 1 month ago
JSON representation

Implementation of singleton, factory, design patterns in different languages.

Awesome Lists containing this project

README

        

In this repository, you will find examples of how to implement the singleton, factory, design patterns in five different programming languages: Java, C++, Python, Go, and Ruby. These design patterns are commonly used to ensure that a class has only one instance, provide a global point of access to that instance, and allow objects to publish changes to their state and for other objects to subscribe to be notified of these changes. We have implemented these patterns using the technique of "lazy initialization", which creates the instance only when it is needed, rather than at the time the class is defined. This can be useful if the instance is expensive to create, or if it is not used in every part of the application.