Front-end Engineering Lab
PatternsArchitecture Patterns

Architecture Patterns

Essential design patterns for front-end - Strategy, Factory, Singleton, Observer, Mediator, Proxy, and React-specific patterns

Architecture Patterns

Design patterns are reusable solutions to common problems in software development. This section covers essential patterns for front-end, organized by categories.

📚 Pattern Categories

🏗️ Structure and Creation

How we organize and create objects:

🔄 Behavior

How system parts communicate:

⚛️ React/Component Design

Patterns specific to React components:

🔌 Extensibility

Patterns for extensible systems:

🎯 When to Use Each Pattern

Strategy Pattern

  • Form validation
  • Cache systems
  • Rendering strategies
  • Payment systems

Factory Pattern

  • Creating modals/toasts
  • API services
  • Validation systems
  • UI component variants

Singleton Pattern

  • Analytics services
  • Global configurations
  • API clients
  • Loggers

Adapter Pattern

  • Server schema normalization
  • API versioning
  • Third-party integrations
  • Data format conversion

Registry Pattern

  • Dynamic component rendering
  • Form builders
  • Plugin systems
  • Content management
  • Analytics services
  • Global configurations
  • API clients
  • Loggers

Observer Pattern

  • State Management (Redux, Zustand)
  • Event systems
  • Themes and configurations
  • Authentication

Mediator Pattern

  • Complex forms
  • Chat systems
  • Drag and drop
  • Dashboards

Proxy Pattern

  • Data validation
  • Observability (MobX)
  • Request caching
  • Lazy loading

📖 Additional Resources

🔗 Relationship with Other Patterns

Many patterns complement each other:

  • Strategy + Factory - Factory creates strategies
  • Observer + Mediator - Mediator uses Observer to notify
  • Proxy + Observer - Proxy detects changes, Observer notifies
  • Container/Presenter + Hooks - Hooks extract logic from Containers

Tip: Start simple. Don't force patterns where they're not needed. Use patterns when code becomes cleaner and more maintainable, not just because "it's a pattern".

On this page