express
express copied to clipboard
Clean architecture example
Copy of the PR for the master version. The goal is to add an example on how to use Express with the Clean Architecture approach
I'm getting an "Unexpected identifier" error up to Node v 6.17. Installing that version of node locally I'm not able to make tests run. Could someone help me? Or maybe we can publish the ES5 version that works fine and add a comment that tells users to use ES6 classes instead
Hi @dougwilson could you merge the pr? Or do you have other advice to improve the example? :)
Thanks for your work! I can't help but notice this example seems very similar to our mvc example, splitting the apps into sets of object operations by file and such. What are the differences this example does from the mvc one?
Thanks for your work! I can't help but notice this example seems very similar to our mvc example, splitting the apps into sets of object operations by file and such. What are the differences this example does from the mvc one?
Good question! When I was studying the clean architecture I made myself the same question. The answer is subtile. We can say that the Clean Architecture is a set of principles that you have to follow when you create the architecture. You can build really complex architectures like this (but I wanted to keep the example simple).
MVC (for some aspects) could be seen as a subset of Clean Architecture but the use of MVC doesn't guarantee the respect of all the Clean Architecture rules.
You can find more in this topic.
Hi @import-brain, sorry for the ping but I don't know how to progress with this PR. Do you think it could be merged or are required other approvals?
Hi @import-brain, sorry for the ping but I don't know how to progress with this PR. Do you think it could be merged or are required other approvals?
No worries :)! I do not have PR merge permissions on this repo. @dougwilson, what do you think?
Sorry about that, thanks for the ping! So I guess reading your response there, I'm just really confused. Does "Clean Architecture" mean something? Is there a link to where that is defined? I thought that was just a term you were using to describe your example and didn't mean anything further :)
Sorry about that, thanks for the ping! So I guess reading your response there, I'm just really confused. Does "Clean Architecture" mean something? Is there a link to where that is defined? I thought that was just a term you were using to describe your example and didn't mean anything further :)
Hi, sure! Clean Architecture is the name of the book by Robert C. Martin (the same author of the book Clean Code) and describes a set of rules and best practices to create scalable architectures. You can find the book on Amazon and by searching onine you can find other releated resources :)
Sorry about that, thanks for the ping! So I guess reading your response there, I'm just really confused. Does "Clean Architecture" mean something? Is there a link to where that is defined? I thought that was just a term you were using to describe your example and didn't mean anything further :)
Hi @dougwilson i think the main difference between this example and the mvc is the usage of that pattern, this example in my opinion is a pure backend microservice which expose some REST api (a crud in this case). The mvc example looks like server side rendering, it expose some url in GET and return an html template to render. Also if we watch in deep, in this pull request we can see an Object Oriented way (obviusly with common js compatibility 😃) but that is the idea behind it.
HI @dougwilson! Sorry for the ping XD. I would really appreciate a feedback on the PR if you have time. I have followed your advice. Now I think everything is correct :)
Hi @dougwilson :) I see that the RR is still pending. Would you consider merging it? :)
Hi @dougwilson, do you think is worth merging it? If not, I can just close the PR to keep the repo as clean as possible :)