DEV Community

Discussion on: Implementing SOLID and the onion architecture in Node.js with TypeScript and InversifyJS

Collapse
 
liranbri profile image
Liran • Edited

thank you for a great article!

few points:

  1. don't you think it smells that you need to have your IoC framework decorators inside the lowest level layers such as the domain? Uncle Bob in Clean Architecture specifically suggests to avoid that.. the IoC is also just an implementation detail.

  2. I couldn't find where you use the "Application Layer". isn't it missing?
    for example "create new Aircraft" should not be considered a use-case belongs to the Application Layer?

As far as I understand, domain services should be introduced when you have a domain business rules. but in your case, you put there operations which don't hold any business rules ("get all aircrafts" for example). I think it indicates that it does not belong there.

I even picked at the demo you shared (github.com/stelltec/public-tech-de...) and there is not even a folder for this layer.

on this article:
blog.codeminer42.com/nodejs-and-go...
(you can skip to this code at: github.com/talyssonoc/node-api-boi...)
The guy put those operations in the application layer for example. do you think he's wrong?

Collapse
 
mpachin profile image
Misha Pachin

Thank you so much for your comment and for your questions and links! It's really helpful, especially this one (github.com/talyssonoc/node-api-boi...)