-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: split controllers #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was exactly what I had in mind, just separating things by context. 👍
I added a comment for naming things, then I saw that the tests disappeared, I was expecting to find them separated in different test classes
src/facades/management.ts
Outdated
this.#inner = inner; | ||
} | ||
|
||
get assetController() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would drop the Controller
word from these getters, so then the expression to, e.g. create an asset would be:
management.asset.create(...)
.
Maybe also adding the s
could reflect the "rest resource" concept, becoming:
management.assets.create(...)
@ndr-brt do you feel like we should also split tests exactly like we did for the sub controllers? |
@OlfaBensoussia definitely! |
962554a
to
7cbf48e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
This PR attempts to resolve #42
When looking at this issue, I thought about two ways to address it.
The first is to do it through dependency injection. The idea was to create a global interface for controllers, and then inject controllers into the new management class. The second one is to simply get inspiration from the facade design pattern, and have one class that wraps all of the other controllers through a simplified interface where we create instances of these controller classes. I went for the latter and would like to hear your opinions @ndr-brt @fdionisi
How to test it
Approach
Open Questions and Pre-Merge TODOs
Learning