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

Why use PublisherBoxBase as a base class instead of directly using PublisherBox? #253

Open
sinno93 opened this issue Aug 3, 2024 · 0 comments

Comments

@sinno93
Copy link

sinno93 commented Aug 3, 2024

Hello,I have been studying the implementation of AnyPublisher in the Combine framework and noticed that the implementation uses an abstract base class PublisherBoxBase and a concrete subclass PublisherBox. I am curious about the design decision behind this approach.

My question is:

1.	What is the advantage of having PublisherBoxBase as an abstract base class instead of directly implementing everything in PublisherBox?
2.	Is there a specific design pattern or principle that this approach is adhering to?

I appreciate any insights or explanations you can provide. Thank you!
related code:

internal class PublisherBoxBase<Output, Failure: Error>: Publisher {

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

No branches or pull requests

1 participant