DEV Community

Selen Gora
Selen Gora

Posted on

2 1

Design Patterns in JavaScript

Just started course, Design Patterns in JavaScript on Udemy.

Here is summary from first section by @nesteruk from course.

Single Responsibility Principle

  • A class should only have one reason to change
  • Seperation of concerns -> different classes handling different, independet tasks/problems

Open-Closed Principle

  • Clases should open for extensions but closed for modification

Liskow Substition Principle

  • You should be able to substitute a base type for a subtype

Interface Segragation Principle

  • Don't put too much into an interface; split into separate interfaces
  • YAGNI - You Ain't Going to Need It

Dependency Inversion Principle

  • High-level modules should not depend upon low-level ones; use absractions

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay