Clean and maintainable: design patterns help us write clean, robust and maintainable code.
Enhanced code reuse: patterns help you decouple dependencies and keep your code organized.
Being proactive about bug prevention: design patterns give clear expectations and enable us to review and reason about large quantities of code more easily.
Removes ambiguity: using the same patterns consistently removes ambiguity about code structure and behavior.
Essential for effective DevOps: code that applies well known and understandable patterns is easy to review.
Make details fall into place: design patterns help organize the code and make small implementation details fall into place more easily.
Creational Patterns
Object Pattern: Group data into objects with classes and member functions for instantiation and destruction.
Opaque Pattern: Keep implementation private and expose only a handle to the object with three different methods.
Singleton Pattern: Ensure a class has only one instance and provide global access to it.
Factory Pattern: Provide an interface for creating objects in a super class, allowing sub-classes to alter the type of objects that will be created.
Structural Patterns
Callback Pattern: Handles object-oriented callbacks bound to object instances, allowing callbacks to operate on specific instances.
Inheritance Pattern: Used for implementing inheritance relationships between objects and components in a C program to create a hierarchy of objects.
Virtual API Pattern: Implements virtual functions in C and makes handles to opaque objects "smart," providing polymorphism and allowing the same interface for several implementations.
Bridge Pattern: Builds upon the virtual API pattern to bridge two distinct hierarchies of objects, illustrated in Rust and C examples.
Behavioral Patterns
Return Value Pattern: Standardizes function handle return values for clear communication with caller.
Concurrency Patterns
Concurrency Introduction: Concurrency as a pattern for software development and when to consider it as a valuable tool.
Spinlock Pattern: Protects shared data from corruption by ensuring interrupt never runs when modifying it.
Semaphore Pattern: Outlines a pattern of signaling between interrupt handlers and application level threads for thread-aware synchronization.
Mutex Pattern: Prevents starvation by means of priority inheritance and is used for mutually exclusive access to a resource.