Coffee Patterns is a Visual Studio Code extension that provides a collection of handy snippets for various design patterns in the world of software development. Whether you're a seasoned developer or just getting started, these snippets will help you implement common design patterns quickly and efficiently.
- Rich Collection: A comprehensive set of snippets covering popular design patterns.
- Easy to Use: Simple and intuitive code snippets for quick integration.
- Customizable: Each snippet is designed to be easily customizable according to your project's requirements.
- Open Visual Studio Code.
- Go to the Extensions view (
Ctrl+Shift+X
on Windows/Linux,Cmd+Shift+X
on macOS). - Search for "Coffee Patterns".
- Click Install to install the extension.
- Open a file in Visual Studio Code.
- Start typing
!
followed by the name of the desired design pattern. For example,!adapter
. - Select the desired snippet from the IntelliSense suggestions.
- Press
Enter
to insert the snippet. - Use the
Tab
key to navigate between placeholders. - Replace the placeholders with your own code.
- Factory Method
- Abstract Factory
- Builder (with and without Director)
- Singleton (simple and thread-safe)
- Prototype
- Adapter (through inheritance and object composition)
- Bridge
- Decorator
- Proxy
- Composite
- Facade
- Flyweight
- Chain of Responsibility
- Command
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
- Factory Method + Singleton
- Composite + Visitor
- Proxy + Observer
To use a specific design pattern, type !
and start typing the name of the design pattern. Select the desired snippet from the IntelliSense suggestions and press Enter
to insert the snippet. Use the Tab
key to navigate between placeholders and replace them with your own code.
To use a design pattern combination, type !blend
and start typing the name of one of the design patterns in the combination. Select the desired snippet from the IntelliSense suggestions and press Enter
to insert the snippet. Use the Tab
key to navigate between placeholders and replace them with your own code.
This extension is licensed under the MIT License.
If you'd like to contribute to Coffee Patterns, please follow our contribution guidelines.
We welcome your feedback! If you encounter any issues or have suggestions for improvement, please create an issue.
Before opening a new issue, please check if there's already an existing one. If not, use one of our forms to provide the necessary details:
- Special thanks to contributors who have helped make this extension better.