Skip to content
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

Middleware is uncountable #6033

Closed
wants to merge 1 commit into from
Closed

Conversation

l-vo
Copy link

@l-vo l-vo commented May 8, 2023

Q A
Type typo
Fixed issues

Summary

According to https://www.oxfordlearnersdictionaries.com/definition/english/middleware, middleware is uncountable.

src/Configuration.php Outdated Show resolved Hide resolved
src/Configuration.php Outdated Show resolved Hide resolved
@l-vo l-vo changed the base branch from 3.6.x to 3.7.x May 8, 2023 15:26
@l-vo l-vo force-pushed the middleware_is_uncountable branch from 419160b to 89e0ee7 Compare May 8, 2023 16:19
@l-vo l-vo force-pushed the middleware_is_uncountable branch from 89e0ee7 to d9d87c3 Compare May 8, 2023 16:21
@l-vo
Copy link
Author

l-vo commented May 8, 2023

@derrabus updated.

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecations have to be documented in the UPGRADE.md file.

Middlewares
-----------
Middleware
----------

A middleware sits in the middle between the wrapper components and the driver.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If middleware is not countable, is there something like a middleware? The way you use the term in the Configuration class now, middleware is the whole layer between the driver an the wrapper. I think, we need to find a different term for the thing that we create through implementing the Middleware interface.

@derrabus
Copy link
Member

derrabus commented May 8, 2023

Regarding the deprecation, I'm really wondering if it's worth it. While the current method naming pattern [gs]etMiddlewares() is grammatically incorrect as I've learned, changing it at this point only solves an academic/esthetic issue and generates avoidable busy work downstream.

Maybe it's enough to adjust the documentation only and keep the method names as they are?

Paging @morozov as he's the main author of the middleware system.

@l-vo
Copy link
Author

l-vo commented May 9, 2023

@derrabus I'm agree, but even if it's not a good Idea, this PR will keep a trace of this discussion 👍

@morozov
Copy link
Member

morozov commented May 9, 2023

I don't think this change provides any value while at the same it clearly causes damage. The definition from the dictionary focuses on the middleware being a layer (a collective notion) while in this specific design, middleware is an interface and its specific implementations, so they are countable.

The existing code operates both the specific instances of middleware and their collections, so using the same single tense for both might become confusing and impractical at some point.

Natural languages evolve and adjust to their actual usage, they are not set in stone. Here are the examples of using "middlewares" in the open-source code.

@l-vo
Copy link
Author

l-vo commented May 9, 2023

@morozov it makes sense, thank you for your feedback 👌

@l-vo l-vo closed this May 9, 2023
@l-vo l-vo deleted the middleware_is_uncountable branch May 9, 2023 19:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants