skinny85 / jilt

Java annotation processor library for auto-generating Builder (including Staged Builder) pattern classes
Other
240 stars 12 forks source link

"Type-safe" is a confusing name #10

Closed vprudnikov closed 10 months ago

vprudnikov commented 10 months ago

Hi!

Could you please consider renaming a "type-safe" builder to something else like "step builder" or "fluent builder"? I'm asking about this since the "type-safe builder" is a bit confusing and usually means something different like https://kotlinlang.org/docs/type-safe-builders.html

More links:

So, while all the concepts may seem overlapping, "type-safe builder" is a broader term encompassing any builder pattern that uses the type system to enhance safety. In contrast "step builder" is a specific implementation style within the builder pattern.

skinny85 commented 10 months ago

Hi @vprudnikov, thanks for opening the issue. I agree that, judging from this Twitter thread (and the various documentation links contained in it), it seems like the community has settled on using "Staged" for the name of this concept.

I'll add BuilderStyle.STAGED as a synonym for BuilderStyle.TYPE_SAFE, and I'll update the docs to use the "Staged" vocabulary instead of "type safe".

vprudnikov commented 10 months ago

@skinny85 , thanks for the response! An answer given by ChatGPT: image

Although I admit that I maybe asked it a wrong question :)

skinny85 commented 10 months ago

@vprudnikov This is now done on the develop branch. You can see the updated documentation in the ReadMe file here.

If everything looks good, I'll include these changes in the next release, that will also contain fixes for #5 and #11.

vprudnikov commented 10 months ago

@skinny85 , looks great! Thanks!

skinny85 commented 10 months ago

This has been fixed in the latest Jilt release (1.4).

I'm closing this issue as "Resolved", please comment if you run into any more problems related to this area, and I'll reopen the issue.