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

Builder and apply #36

Closed
JavierSegoviaCordoba opened this issue Dec 30, 2019 · 1 comment
Closed

Builder and apply #36

JavierSegoviaCordoba opened this issue Dec 30, 2019 · 1 comment

Comments

@JavierSegoviaCordoba
Copy link

I think that is interesting how you create the builder pattern for learning Kotlin DSL, but why just don't use apply? Maybe add the apply alternative should be great because it is available for all objects out of the box.

@dbacinski
Copy link
Owner

dbacinski commented Jan 21, 2020

I was thinking about it, but I am not sure if apply fulfills Builder definition:

The builder pattern is used to create complex objects with constituent parts that must be created in the same order or using a specific algorithm. An external class controls the construction algorithm.

To me, it looks like Kotlin DSL is much closer to this definition than apply.

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

2 participants