-
Notifications
You must be signed in to change notification settings - Fork 172
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
Remove BaseRequest #1260
Remove BaseRequest #1260
Conversation
None of its subclasses use the visitor pattern after the listener migration. So we don't actually need this class anymore.
Now that some requests don't even have parent classes, we can only use the class name to check if it's a request or not.
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.
So they all uses the same @document
and all define run
yet we do not want a common ancestor? This change doesn't make sense.
What is the drawback of keeping BaseRequest
?
Since each request is invoked individually, it doesn't matter if they have a And IMO having the same
I think it gives an false-impression that those requests have as strong commonality as those inherit from Since @vinistock and I are re-thinking the structure of our requests & listeners (e.g. #1247), I think keeping this false-impression will reduce the outcome of it. What's the benefit of keeping it? |
The benefit of the super class defining an abstract I think that instead of removing the
This means each subclass of Then, each subclass of Removing the commonality between request will make it easier for requests to stray out of the blessed path and will create a forest of somewhat identical implementations that will make it harder to maintain over the long term. Keeping this superclass, forces us to provide a clean and common implementation. It also enforces a convergent design where contributors external to your team understand how (or are forced to) provide an implementation following your philosophy. One more change that could be done in parallel is adding a |
This is indeed what I want to do with changes like this and #1247. FWIW, we do plan to introduce a parent request class to better capture the commonality between them. And IMO removing this thin layer and not too helpful abstraction will help us come up with a better design later, either in #1247 or in a follow up PR. |
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.
Okay, we talked IRL about this and we're going to accept this change as this as long as the BaseRequest
concept comes back in #1247.
Motivation
When pairing with @vinistock, we found that after the listener pattern migration, none of the
BaseRequest
descendents use the visitor pattern anymore. So now its only usage is to define the@document
ivar, which is a wasteful reason to have a class.Implementation
BaseRequest
classAutomated Tests
Manual Tests