Need help to better understand Typescript, IoC, Hexagonal architecture
Grégory "Alasha" HOARAU
Posted on May 20, 2019
Hello,
I’m new to the Typescript world and I’m trying to learn some techniques.
Let’s imagine that I want to implement a Logger in my application with Winston. Later, I want to use Bunyan instead of Winston. Problem: All files that use the old Logger should be updated.
Note: It seems that Winston and Bunyan use the same functions. Let’s assume that this is not the case.
Should I create an interface (ILogger), then classes for each implementation (LoggerImplWinston and LoggerImplBunyan)? Any other options for you?
At the same time, I am also trying to use the Inversion of Control (Inversify) and Hexagonal architecture (Interfaces, application, domain, infrastructures) …
Thus, I’m french, so keep things as simple as possible
Thank you in advance.
Posted on May 20, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 8, 2024
November 8, 2024
November 2, 2024