Skip to content

This Todo List project was created to demonstrate dependency injection and POO in Go.

License

Notifications You must be signed in to change notification settings

gomessguii/todo-list-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

todo-list-go

This Todo List project was created to demonstrate dependency injection and POO in Go.

It's built using a package definition based on the "package by resource" from Clean Architecture (Robert C. Martin), where each package defines a resource (or domain) of the system and contain all the code related to that, including controllers, the domain itself, repositories and anything exclusive to that package.

This package definition allows us to avoid the global "utils" package that is not very clear and highly coupled, since is used abroad the whole system. Also let us start coding from the most important part of the system, the domain and its tests, before developing the rest of the code.

Besides this architecture allowing the development of each package separately, it also brings a "disavantage": if the complete interface perhaps change the signature of a method, it must be changed in all interfaces using that method. It's not that much trouble because when changing an interface signature, the classes using it will need refactoring anyway, the difference is that in this new dynamic, the project error will be on the dependency injection instead of the implementation. You just have to get used to changing more than one interface, if they change (they shouldn't unless strictly necessary).

Class Diagram

Implementations hidden and diagram simplified for clearance.

About

This Todo List project was created to demonstrate dependency injection and POO in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages