-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
概要
現在、AttributeManager や LevelManager などのマネージャークラスに SQL クエリが直接記述されています(密結合)。これを Repository
パターンを用いて分離し、ビジネスロジックとデータ永続化処理の責務を明確に切り分けます。
期待される変更
- Repositoryクラスの作成: com.lunar_prototype.deepwither.repository パッケージを新設し、各マネージャーに対応するリポジトリ(例: PlayerAttributeRepository)を作成する。
- 抽象化APIの活用: 新しく実装した IDatabaseManager (DW.db()) の execute や querySingle を使用し、ボイラープレートコード(try-catch, Connection管理)を排除する。
- Managerの軽量化: マネージャーはリポジトリを呼び出すだけにし、データの保存方法(SQLite/MySQL)を意識しないようにする。
実装イメージ (LevelManager)
1 // Manager側
2 public void save(UUID uuid) {
3 PlayerLevelData data = dataMap.get(uuid);
4 repository.save(uuid, data); // 1行で完結
5 }
やることリスト
- AttributeManager -> AttributeRepository
- LevelManager -> LevelRepository
- SkilltreeManager -> SkilltreeRepository
- ClanManager -> ClanRepository
Reactions are currently unavailable