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

Fill in the details

Describe the architectural challenge or software problem you need to solve.

Specify the programming language, framework, or technology stack involved.

Provide relevant code snippets, class diagrams, or architectural details of the current system.

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

  1. Fill in the fields above. Required ones are marked with *.
  2. Check the prompt preview: your answers appear highlighted in place.
  3. Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
See all Software Development & Coding prompts