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

Expand interface-driven datasource configs #39

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

mhsdef
Copy link
Contributor

@mhsdef mhsdef commented Sep 12, 2024

Why

It is not a silver bullet, but, programming to interfaces and favoring composition over inheritance can provide tighter abstractions, looser couplings, and useful flexibility.

See this (contrived) example of what that can mean in practice:

Inheritance embraced

vs

Composition, Interfaces

The wins there may look small but when multiplied over real world scenarios hundreds or thousands of times--I promise, they add up. The mental overhead wins and testability wins make it worth it in my experience.

How

We already had a HttpDatasourceConfig interface in the codebase. This PR attempts to shift some more core parts that direction, elevate a compositional approach, and lays some groundwork for additional explicit contracts (ie, interfaces, mostly, in PHP).

@mhsdef mhsdef self-assigned this Sep 12, 2024
@mhsdef mhsdef changed the title Try expanding interface-driven datasource configs (deux) Expanding interface-driven datasource configs Sep 12, 2024
@mhsdef mhsdef requested a review from chriszarate September 12, 2024 16:13
@mhsdef mhsdef changed the title Expanding interface-driven datasource configs Expand interface-driven datasource configs Sep 12, 2024
@mhsdef mhsdef merged commit 16e65e5 into trunk Sep 12, 2024
5 checks passed
@mhsdef mhsdef deleted the hewsut/try-some-more-branching branch September 12, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants