captaincodeman / clean-go Goto Github PK
View Code? Open in Web Editor NEWClean Architecture Example in Go
Clean Architecture Example in Go
I am trying to understand how to implement clean architecture.
Is there a chance that you add another domain example not just for Greeting domain?
Thanks
hello dear,
I have to say that this is great repository. But I am confused about the subject ?
why have you been passing Context through the services and repos ?
hello,
I haven't seen a request validation so which layer we should add validation logic?
thank you
Mirror Go example web application
Keep gin to show how web framework is replaceable
Thanks for this example, it's really great.
I would like to comment one thing though, namely the section about Dependency Injection.
You state that dependency injection is not always necessary, you even say one doesn't need it and say something about runtime performance costs.
The fact is though, that there are examples of dependency injection in this project as well, like the one here.
Dependency injection is almost always necessary to adhere the Dependency Inversion Principle which is one of the key pillars of Clean Architecture. It's the moment when you pass a set of dependencies from the outside to your object instead of creating them inside (thus avoiding hard coupling between them).
It is true that you can do dependency injection manually, but at certain level it can become cumbersome.
I believe you meant to say dependency injection containers (which would make perfect sense for most of this section).
I would also argue with the runtime performance hit point. Clearly dependency injection frameworks/containers always use some sort of hacky way to make DI user friendly, but that cost is usually paid at the very beginning of the application initialization and does not affect the runtime performance.
(I have to admit that I haven't worked much with Java or .NET, so I'm not familiar with their DIC solutions, but I'm pretty sure the situation is still much better than in case of script languages where initialization happens for each request and to make things faster production builds "compile" the container to avoid rebuilding the dependency tree for every request)
Wouldn't it make sense to move the domain package to engine/internal
?
When the go command sees an import of a package with internal in its path, it verifies that the package doing the import is within the tree rooted at the parent of the internal directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.