Skip to content

chore: remove the AbstractSimpleModel - #2874

Open
rsynek wants to merge 1 commit into
TimefoldAI:mainfrom
rsynek:chore/remove-abstract-simple-model
Open

rsynek wants to merge 1 commit into
TimefoldAI:mainfrom
rsynek:chore/remove-abstract-simple-model

Conversation

@rsynek

@rsynek rsynek commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #2509.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The public API removal of AbstractSimpleModel lacks a justified java.class.removed exception in service/definition/src/build/revapi-differences.json.

1 open issue
What changed in this PR

Removes AbstractSimpleModel from the service API, taking the removal option proposed in #2509.

Changes:

  • Removes the base class and its special handling in Quarkus discovery.
  • Updates Java and Kotlin examples to implement the service interfaces directly.
  • Adds migration guidance and updates override documentation.
File Description
service/​quarkus/​deployment/​src/​main/​java/​ai/​timefold/​solver/​service/​quarkus/​deployment/​TimefoldModelsProcessor.java Removes base-class filtering and score fallback.
service/​definition/​src/​main/​java/​ai/​timefold/​solver/​service/​definition/​api/​AbstractSimpleModel.java Deletes the simplified model base class.
docs/​src/​modules/​ROOT/​pages/​upgrading-timefold-solver/​upgrade-to-latest.adoc Adds migration instructions.
docs/​src/​modules/​ROOT/​pages/​running-timefold-solver/​service/​model-config-overrides.adoc Updates the explanation of trivial conversion.
docs/​src/​modules/​ROOT/​pages/​quickstart/​service/​getting-started.adoc Uses explicit interfaces and score properties.
docs/​src/​modules/​ROOT/​pages/​domain-modeling/​modeling-planning-problems.adoc Removes examples using the deleted class.

Review effort: Balanced

- `ModelConvertor` and `ModelConvertorBase` moved to `ai.timefold.solver.service.definition.api.conversion`.
- Demo data types moved to the preview API in `ai.timefold.solver.service.definition.preview.api.demo`.
- `UserModel` was removed without a replacement.
- `AbstractSimpleModel` was removed without a replacement.
This requires a custom `ModelConvertor`.
If your `SolverModel` also serves as `ModelInput` and `ModelOutput`, for example because you extend `AbstractSimpleModel`, the framework uses a trivial `ModelConvertor` by default, which ignores `modelConfig` entirely.
If your `SolverModel` also serves as `ModelInput` and `ModelOutput`, by implementing all these interfaces, the framework uses a trivial `ModelConvertor` by default, which ignores `modelConfig` entirely.
With only the trivial convertor in place, constraint weight overrides submitted in a request are silently dropped: the request succeeds, but the override never reaches the solver.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem still exists if a user implement all the three interfaces. I am thinking of dropping the generated trivial convertor that hides it and let the user always implement the conversion.

A bit more boilerplate code, but no surprises.

@rsynek
rsynek force-pushed the chore/remove-abstract-simple-model branch from 927eda6 to e2d5306 Compare December 4, 2026 16:00

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Consider removing the AbstractSimpleModel

2 participants