-
Notifications
You must be signed in to change notification settings - Fork 454
Open
Labels
Milestone
Description
Goal
Integrate critter-core into morphia-core to provide a modern Mapper architecture using bytecode generation, replacing legacy reflection-based implementation. Users get a config-driven choice between mappers with automatic fallback.
Implementation Phases
- [100%] Phase 1: Extract Mapper interface and add config option #4184
- [100%] Phase 2: VarHandle accessor generator #4185
- [50%] Phase 3: Convert Kotlin to Java #4195
- [0%] Phase 4: Move critter-core into morphia-core #4186
- [0%] Phase 5: CritterMapper implementation #4187
- [0%] Phase 6: Wire CritterMapper into MorphiaDatastore #4188
- [0%] Phase 7: Test infrastructure and CI matrix #4189
- [0%] Phase 8: Cleanup and documentation #4190
Planning Document
Full implementation plan with code samples, file references, verification steps, and risk mitigation:
docs/critter-integration-plan.md
Design Decisions
| Decision | Choice |
|---|---|
| Generation strategy | Hybrid: check classpath for pre-generated models (critter-maven AOT) → runtime generation (Gizmo + VarHandle) → reflection fallback |
| Runtime accessors | VarHandle-based — no synthetic __read/__write methods needed at runtime |
| Language | Convert to Java — convert critter Kotlin source before moving into morphia-core |
| Mapper interface | @MorphiaInternal only — not exposed on any public API |
| Fallback granularity | Entity-type level — all-or-nothing per type |
copy() semantics |
Share immutable CritterEntityModel references |
| Dependencies | Optional + fail-fast — Gizmo/ASM/ByteBuddy marked <optional>, clear error if missing when CRITTER selected |
| Classloader | Uses configured classloader as parent; build-time classes are permanent, runtime classes regenerated per JVM start |
| Module removal | Last step — only after full test matrix is green |
Reactions are currently unavailable