---
title: "Comment by Jesse Bellingham on \"URL Shortener using Clean Architecture\" | Hashnode"
description: "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 builde"
url: "https://hashnode.com/posts/url-shortener-using-clean-architecture/61d522f5220e98797766a15c/comment/61e540888a425719c1735e92"
---

[Discussion](https://hashnode.com/posts/url-shortener-using-clean-architecture/61d522f5220e98797766a15c)

Comment [URL Shortener using Clean Architecture](https://hashnode.com/posts/url-shortener-using-clean-architecture/61d522f5220e98797766a15c)

[Jesse Bellingham](https://hashnode.com/@jessebellingham)

[Jan 17, 2022](https://hashnode.com/posts/url-shortener-using-clean-architecture/61d522f5220e98797766a15c/comment/61e540888a425719c1735e92)

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?

[Vighnesh Kulkarni](https://hashnode.com/@vighneshk)

[Feb 12, 2022](https://hashnode.com/posts/url-shortener-using-clean-architecture/61d522f5220e98797766a15c/comment/61e540888a425719c1735e92#reply-62074870d59187113c4bf9b5)

Thank you Jesse! I've kept the validator function in a separate file because it uses a module called 'dns' from node which I had to import. So, I did not want the entity to directly depend upon any framework/library. Just separation of concerns.

Is the way you've got it here a common node pattern? ---> Actually the framework I've used is Express.js(Nodejs framework) and it doesn't follow any pattern/architecture. It's completely flexible. This is the first time I'm following any architecture and still exploring, so I might be wrong on some parts😅.

Sorry for a really late reply :(
