RFR: 8344942: Template-Based Testing Framework [v9]
Emanuel Peter
epeter at openjdk.org
Fri May 16 06:24:00 UTC 2025
On Fri, 16 May 2025 05:27:28 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> Next batch of comments. Will probably resume tomorrow :-)
>
>> > > @chhagedorn Ok, I tried my best with the `(Un)FilledTemplate` refactoring. I'm still not sure if I want to rename `FilledTemplate` to `RenderableTemplate`, it is not super satisfying for a beginner either. Naming is hard. If anybody else has a better idea than `(Un)FilledTemplate`, please let me know ;)
>> > > I think one can continue reviewing this now!
>> >
>> >
>> > I've just quickly skimmed through this hierarchy. `(Un)FilledTemplate` reminds me a bit of the builder pattern. What about renaming `UnFilledTemplate` to `TemplateBuilder` and `FilledTemplate` to just `Template`?
>>
>> @galderz Thanks for the comment!
>>
>> For me both `UnfilledTemplate` and `FilledTemplate` are Templates. The unfilled one has the arguments not yet applied, the filled one has the argument applied. Calling the `UnfilledTemplate` a `TemplateBuilder` seems a little odd, because it is basically already Template, it just has some holes that need to be filled with arguments. In that sense, it is really similar to what the Java String Template was supposed to be.
>
> Thanks for the clarification. Given that explanation `TemplateBuilder` is not right. What about `PartialTemplate` instead of `UnfilledTemplate`? It's a template that is not yet complete since it has holes that need to be filled in, so it sound like a partially built template, hence `PartialTemplate`. To me it sounds better than `UnfilledTemplate`. Then, I would just rename `FilledTemplate` to `Template` since it's a complete template with all it needs so I don't think there's a need to add `Filled` to it. And I don't think `CompleteTemplate` is a good name either. Simply `Template`.
@galderz Thanks for the reply :)
I think you missed my most recent refactoring, see https://github.com/openjdk/jdk/pull/24217#issuecomment-2882822708
I discussed it offline with @chhagedorn @mhaessig and @robcasloz and they all agreed to it already 😊
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24217#issuecomment-2885754054
More information about the hotspot-compiler-dev
mailing list