refactor: split team/player/message into impl/ and exception/ subpackages
Each domain now has:
- Top-level package: contracts (interfaces, entities, enums, values, events).
- exception/ subpackage: exception hierarchy.
- impl/ subpackage: implementations CR-Core ships by default, swappable by
a game plugin if needed.
Moved (FQN changes for consumers):
- fr.luc.crcore.team.TeamException (+ AlreadyExists, NotFound, Access)
→ fr.luc.crcore.team.exception.*
- fr.luc.crcore.team.TeamServiceImpl, BukkitEventFiringTeamServiceImpl,
InMemoryTeamRepository, SqliteTeamRepository
→ fr.luc.crcore.team.impl.*
- fr.luc.crcore.player.PlayerException, PlayerProfileNotFoundException
→ fr.luc.crcore.player.exception.*
- fr.luc.crcore.player.PlayerProfileServiceImpl,
BukkitEventFiringPlayerProfileServiceImpl,
InMemoryPlayerProfileRepository, SqlitePlayerProfileRepository
→ fr.luc.crcore.player.impl.*
- fr.luc.crcore.message.YamlMessagesService
→ fr.luc.crcore.message.impl.YamlMessagesService
Unchanged top-level packages: database/, command/, common/ (already small
and well-organized). Events stay where they were (already in event/
subpackages).
setup.md tree updated to reflect the new layout. decisions.md logs the
rationale (consumer-facing FQNs, separation between contract and impl).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -367,6 +367,40 @@ Format léger : une décision = un titre + contexte + choix + raison.
|
||||
bases existantes, ALTER TABLE manuel ou suppression du fichier
|
||||
(les bases d'event sont jetables).
|
||||
|
||||
## 2026-06-09 — Réorganisation packages : `impl/` et `exception/` séparés
|
||||
|
||||
- **Choix** : pour chaque domaine (`team`, `player`, `message`), les
|
||||
implémentations passent dans un sous-package `impl/` et les exceptions dans
|
||||
un sous-package `exception/`. Le top-level du package ne contient plus que
|
||||
les contrats publics (interfaces, entités, enums, values).
|
||||
- **Conséquences sur les FQN publics** (importer côté plugin de jeu si on les
|
||||
utilise) :
|
||||
- `fr.luc.crcore.team.TeamException` → `fr.luc.crcore.team.exception.TeamException`
|
||||
(et ses 3 sous-classes)
|
||||
- `fr.luc.crcore.team.TeamServiceImpl` → `fr.luc.crcore.team.impl.TeamServiceImpl`
|
||||
(idem `BukkitEventFiring*`, `InMemory*Repository`, `Sqlite*Repository`)
|
||||
- `fr.luc.crcore.player.PlayerException` → `fr.luc.crcore.player.exception.PlayerException`
|
||||
(et `PlayerProfileNotFoundException`)
|
||||
- `fr.luc.crcore.player.*Impl` / `*Repository` impl → `fr.luc.crcore.player.impl.*`
|
||||
- `fr.luc.crcore.message.YamlMessagesService` → `fr.luc.crcore.message.impl.YamlMessagesService`
|
||||
- **Inchangés** : tous les enums, entités, interfaces de service et de repo,
|
||||
ranking records, events (qui étaient déjà dans un sous-package
|
||||
{@code event/}).
|
||||
- **Raison** : lisibilité. Un dev qui ouvre `fr.luc.crcore.team/` voit
|
||||
immédiatement les contrats (Team, TeamService, TeamRepository, enums,
|
||||
events) sans se faire noyer par les impls. Pour overrider, il sait où
|
||||
chercher (`impl/`). Pour catch une exception, il sait où chercher
|
||||
(`exception/`).
|
||||
- **Convention top-level vs impl/** :
|
||||
- **Top-level** = ce qu'un consommateur doit connaître pour utiliser ou
|
||||
étendre l'API : interfaces, entités, enums, values, events.
|
||||
- **impl/** = ce que CR-Core fournit par défaut, qu'un game plugin peut
|
||||
swap. C'est aussi là que vivent les sous-classes utilisées en interne
|
||||
par le bootstrap (BukkitEventFiring*ServiceImpl, Sqlite*Repository).
|
||||
- **Pas appliqué à `database/`, `command/` et `common/`** : ces packages
|
||||
sont déjà petits et bien lisibles ; ajouter `impl/` à 3 fichiers serait
|
||||
cosmétique.
|
||||
|
||||
## 2026-06-09 — `MessagesService` : YAML externalisable, un seul fichier par plugin
|
||||
|
||||
- **Choix** : nouveau module `fr.luc.crcore.message` avec une interface
|
||||
|
||||
Reference in New Issue
Block a user