A while ago I wrote Do we really need dependency injection in Javascript? If you share the idea that you should use Dependency Injection in Javascript, you are welcome.

What does your Express app usually look like? Let’s take the most classic example — return a list of users.


Photo by Nathan Queloz on Unsplash

I assume that everyone knows about this very first principle in the SOLID abbreviation — Single Responsibility Principle(SRP).

Robert C. Martin expresses the principle as,

A class should have only one reason to change.

OR more detailed explanation

Gather together the things that change for the same reasons. …


Photo by Holger Link on Unsplash

This is the second part of the series “How MVC frameworks taught us bad habits.”

This time we will investigate why the default MVC Framework architecture does not always work well. We will trace the path of the application…


Let’s look back in the past and try to figure out how frameworks taught us not to notice the wrong things.

Bad habits

Intro

Let’s go back in 200X. It was a boom of MVC frameworks. Ruby on Rails, Django, ZendFramework, Spring, etc. Various frameworks in different programming languages created, copied, and improved various features.

Frameworks have taken a really huge step in web development. And they brought a lot of good things into…


Check reflection state in Typescript

The reflection we are used to.

Languages like C#, Java, PHP have a reflection mechanism.

Reflection is a feature in the Java programming language. It allows an executing Java program to examine or “introspect” upon itself, and manipulate internal properties of the program. …


As software developers, we deal with classes, interfaces, modules every day. But why do we need them? Yes, this is a stupid question — and you would probably say that they help simplify our programs. …


Come on, it is a frontend, we never used Dependency Injection

We are used to using DI in the backend. It has complex logic, the dependency tree is large, it’s likely that we can change some Logger / Caching / HttpClient library to another. What about the frontend… do we really need this?

DI decouples our code, making it easier to…


Is it worth using Apollo with Saga

Long-time ago there was a post — Apollo Client: GraphQL with React and Redux from Sashko Stubailo. He claimed Apollo gave us simple, transparent data flow. And yes… hard to disagree. Nowadays apollo provides super simple hooks

function Dogs({ onDogSelected }) {…


Problem

Let’s take a very common example when we have 1:M relation between 2 tables.

And we need to test updates. Let’s imagine how our test would look in the simplest version.

We need to seed some initial data - fixtures. So we can test updates of the existing post…


Problem

React effectively has dependency injection built-in. Dependencies are essentially injected via properties.

It’s possible to inject scalar data and functions, or services that will be responsible for logic that remains outside of the component.

Why this approach doesn’t work.

What if we need to access the history object or a backend / API object that…

Sergey Radzishevskii

Enjoy turning complex systems into intelligible architectures chilling in my garden.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store