Allegro設計続き

名前付けとか散々悩んで、とりあえず「まあこれでいいか」レベルにまで考えた。

allegro\data

主にデータ層。Repositoryは本来models\Repositoryなどとするべきなのだろうが、そうするとmodels以下には他に何もない状態になるしどうせRepositoryにはCRUD処理を書く事になりDataSourceと激しく結びついてしまうので此処に置く事にする。
Queryはインターフェースだけのつもり。
allegro\data\ContextManager
allegro\data\Context
allegro\data\Repository
allegro\data\DataSource
allegro\data\Query
allegro\data\QueryParameter
allegro\data\QueryResult
allegro\data\EntityMetadata
allegro\data\FieldMetadata
allegro\data\MetadataFactory
allegro\data\Criteria

allegro\data\db

データ層のうち、RDBに特化するもの。基本的にはPDO使えば良いのでこれだけで足りると思うけど、sqlserverなど使うときはどうしよう。でもRepositoryからはRDBに特化したメソッドなどは使わない。特別なQueryを使うときはQueryかSelectQuery等のサブクラスを作って使う。
allegro\data\db\DbContext
allegro\data\db\DbDataSource
allegro\data\db\SelectQuery
allegro\data\db\InsertQuery
allegro\data\db\UpdateQuery
allegro\data\db\DeleteQuery
allegro\data\db\TextQuery

allegro\data\expression

Criteriaに使う式表現を此処にまとめる。多分"hoge.id = :id"見たいな奴ばかり。
allegro\data\expression\Expression
allegro\data\expression\RelationalExpression
allegro\data\expression\ComplexExpression
allegro\data\expression\TextExpression

allegro\util

変換系とか便利系は此処に置く。

allegro\annotation

annotation解析用。
allegro\annotation\Annotation
allegro\annotation\AnnotationReader

あとはフロントコントローラーまわり。
実装は何時頃できるんだろう。

クラス図

ASTAH(旧JUDE)で書いた。