So, I was looking for Node/Express best practices on YouTube and I came across this video by Dev Mastery where he explains the implementation of Comments Microservice using Clean Architecture. But since that microservice was huge, I wanted to build s...

Markdown supported · ⌘↵ to post
Jesse Bellingham
Consultant Developer @ Thoughtworks
Really nice article Vighnesh 🙌 super comprehensive. I have a question, and it may just be my lack of experience building with Node, but why do you use a builder function for the entity and have the validation be a separate function passed in? In .NET for example, the entity would be represented with a class (and optionally, interfaces), and if you were aiming for rich domain objects rather than anemic ones, you might have the validation be a part of the class's constructor.
Is the way you've got it here a common node pattern?