Experience Level: Beginner to Intermediate JavaScript
In this post – published Jan. 23 2018 – Thorsten Frommen from Human Made examines the relationship between the Separation of Concerns and Single Responsibility principles when mixing JavaScript event listeners with business logic.
Article:
Topics Covered:
- What event listeners are and how they work at a basic level
- Overview of the Single Responsibility principle with code examples
- Defining business logic and best practices for keeping it separated
- Best practices for separating JS event handling from business logic
Takeaways:
This article is maybe a little bit different from your run-of-the-mill JavaScript guide or tutorial in that it specifically focuses on foundational principles of object oriented programming. It’s also not WordPress-specific, though still very relevant.
Thorsten does a great job of explaining key aspects of the SOLID (Single Responsibility) and Separation of Concerns principles as they apply to coupling event handling with business logic. This article can be viewed as a great resource to those who aren’t yet set in their JavaScript-writing ways. 🙂