Skip to content
PromptLab by FEHMER TECH
ENDE
Coding

Apply Design Patterns

Choose and implement the right design pattern for your architecture challenge.

Prompt template

Recommend and implement appropriate design patterns for the following problem in [PROGRAMMING LANGUAGE]:

**Problem Description:** [DESCRIPTION OF ARCHITECTURE PROBLEM]
**Current Codebase:** [BRIEF DESCRIPTION]
**Desired Outcome:** [WHAT SHOULD BE IMPROVED]

**Please provide:**
1. **Pattern Recommendation:** Which design patterns solve this problem? Compare 2-3 options with pros and cons
2. **Detailed Implementation:** Complete code of the recommended pattern
3. **UML Description:** Class diagram in text form
4. **Before/After:** Comparison of code before and after pattern application
5. **SOLID Analysis:** How does the pattern improve SOLID principles?
6. **Test Strategy:** How is the pattern implementation tested?
7. **Anti-Patterns:** Common mistakes when applying the pattern

**Context:**
- Team size: [SIZE]
- Codebase age: [AGE]
- Team experience level: [LEVEL]

Replace placeholders in [square brackets]: [PROGRAMMING LANGUAGE][DESCRIPTION OF ARCHITECTURE PROBLEM][BRIEF DESCRIPTION][WHAT SHOULD BE IMPROVED][SIZE][AGE][LEVEL]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • Describe the concrete problem, not the desired pattern
  • Mention the team's experience level for appropriate complexity
  • Ask about pros and cons of different pattern alternatives
  • Request incremental refactoring guidance instead of big-bang rewrite

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #design-patterns #architecture #solid #oop

Last updated: