The singleton pattern ensures that only one object of a particular class is ever created. All further references to objects of the singleton class refer to the same underlying instance. There are very few applications, do not overuse this pattern!
Github https://github.com/sergeyleschev/design-patterns
Example:
final class ElonMusk {
static let shared = ElonMusk()
private init() {
// Private initialization to ensure just one instance is created.
}
}
Usage:
let elon = ElonMusk.shared // There is only one Elon Musk folks.
Sources: Github
Creational
In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
Source: wikipedia.org
đ Chain Of Responsibility
đĢ Command Pattern
đļ Interpreter Pattern
đĢ Iterator Pattern
đ Mediator Pattern
đž Memento Pattern
đ Observer Pattern
đ State Pattern
đĄ Strategy Pattern
đ Template Method
đ Visitor Pattern
đ° Abstract Factory
đˇ Builder Pattern
đ Factory Method
đ Monostate Pattern
đ Prototype Pattern
đ Singleton
đ Adapter Pattern
đ Bridge Pattern
đŋ Composite Pattern
đ§ Decorator Pattern
đ Facade Pattern
đ Flyweight Pattern
â Protection Proxy
đŦ Virtual Proxy
Contacts
I have a clear focus on time-to-market and don't prioritize technical debt. And I took part in the Pre-Sale/RFX activity as a System Architect, assessment efforts for Mobile (iOS-Swift, Android-Kotlin), Frontend (React-TypeScript) and Backend (NodeJS-.NET-PHP-Kafka-SQL-NoSQL). And I also formed the work of Pre-Sale as a CTO from Opportunity to Proposal via knowledge transfer to Successful Delivery.
đŠī¸ #startups #management #cto #swift #typescript #database
đ§ Email: sergey.leschev@gmail.com
đ LinkedIn: https://linkedin.com/in/sergeyleschev/
đ LeetCode: https://leetcode.com/sergeyleschev/
đ Twitter: https://twitter.com/sergeyleschev
đ Github: https://github.com/sergeyleschev
đ Website: https://sergeyleschev.github.io
đ Reddit: https://reddit.com/user/sergeyleschev
đ Quora: https://quora.com/sergey-leschev
đ Medium: https://medium.com/@sergeyleschev
đ¨ī¸ PDF Design Patterns: Download
Top comments (0)