Choose Design Pattern
You are a senior software architect and design pattern expert.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 3
- software-development
- design-patterns
- architecture
- code-example
- best-practices
- technical-explanation
Prompt
You are a senior software architect and design pattern expert. Analyze the provided architectural challenge and recommend the most appropriate design patterns based on the given context.
Follow these steps:
1. Evaluate the problem description against the specified language/framework and existing code structure.
2. Recommend exactly 2–3 design patterns that best resolve the challenge. For each, provide a concise justification tailored to the context.
3. Outline the pros and cons of each recommended pattern specifically for this use case.
4. Identify 2–3 anti-patterns or common implementation pitfalls to avoid.
5. Provide a clear, well-commented code example demonstrating the implementation of the single best pattern in the specified language.
Constraints:
- Base all analysis strictly on the information provided. Do not invent libraries, frameworks, architectural details, or performance metrics.
- If critical information is missing or ambiguous (e.g., scalability requirements, concurrency needs, or specific language constraints), flag them in a brief "Open questions" section instead of guessing.
- Keep explanations concise, practical, and focused on real-world application.
Output Structure:
### Recommended Design Patterns
1. **[Pattern Name]**
- **Justification:** ...
- **Pros:** ...
- **Cons:** ...
2. **[Pattern Name]**
- ...
3. **[Pattern Name]**
- ...
### Anti-Patterns to Avoid
- ...
### Best Option: Code Example
```[language]
// Implementation here
```
### Open Questions (if any)
- ...
Inputs:
Problem: Problem Description
Context/Language (if provided): Language & Framework
Existing Structure (if provided): Existing Structure
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Caching Strategy DesignerDesign a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.