You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Genericize codegen seams; keep builder model processor-side (prep for #349) #369
Preparatory step for #349, before the model move lands.
Goal: simple-codegen must contain only framework-agnostic codegen — no builder vocabulary. Generation consumes only the generic base (GenerationTargetClassDto); the builder-domain layer stays processor-side.
Seam changes (interfaces to genericize first)
TypeMappingContext.resolveGeneratedType — currently Optional<ResolvedBuilder>; needs a neutral return (Optional<TypeName> or a generic generated-type ref). Design needed for what ResolvedBuilder.buildCall(...)/setterPrefix provide to callers (builder instantiation emission).
TypeName.resolvedBuilder field — neutral type + name.
BuilderInstantiation — generic instantiation-strategy vocabulary (ConstructorCall/StaticFactoryCall are generic-shaped; AnchorFactoryCall is builder-specific).
Builder-domain types stay processor-side (processor.model), never move to codegen: BuilderConfiguration, BuilderDefinitionDto, BuilderMethodDto, BuilderNestedTypeDto, BuilderToGenerationTypeMapper, ResolvedBuilder, BuilderInstantiation, GeneratedBuilders.
Preference order for modelling the split: separate type + mapping > composition > inheritance (last resort). Builder DTOs may freely use codegen vocabulary (TypeName, FieldDto, MethodDto) as field types or produce them at the boundary (BuilderToGenerationTypeMapper → GenerationTargetClassDto at finalization, as today). Where a builder type needs generic-shaped state, prefer holding it (BuilderDefinitionDto already holds/produces a GenerationTargetClassDto) over inheriting it — inheritance between the two model families only if neither mapping nor composition fits. (Extending a DTO to add a property remains a good pattern; this rule targets model-family hierarchies, not the extends mechanism.)
Genuine duplication only where codegen cannot see the other side (anti-corruption seam): the codegen.enums mirror of core.enums is the pattern — correct for the future repo split (#363).
Acceptance
simple-codegen/simple-codegen-roaster compile with zero *Builder* types and zero builder references.
Activity
model/analysis: move builder conventions out of genericized types (ja…
Genereralize codegen classes; keep builder model processor-side (#369) (