2010-11-01から1ヶ月間の記事一覧

Allegro設計続き

名前付けとか散々悩んで、とりあえず「まあこれでいいか」レベルにまで考えた。 allegro\data 主にデータ層。Repositoryは本来models\Repositoryなどとするべきなのだろうが、そうするとmodels以下には他に何もない状態になるしどうせRepositoryにはCRUD処理…

Allegroという名のライブラリ

ゲーム用フレームワークにはあるみたいだがPHP+MVCなフレームワークにはないのでとりあえず仮称。文句が来たら考える。多分音楽用語で固める。 今のところデータ部分(モデル - インフラあたり)の仕様考え中 /* * allegro * allegro\data * allegro\data\Data…

前のやり方がダサいのでもう少し

こうする。 class Repository{ override protected void connect(){ if(!externalConnection){ connection = getConnection(); connection.connect(); } } override protected void disconnect(){ if(!externalConnection){ connection.disconnect(); } } } …

モデルの中でのデータベース

たとえばモデル(リポジトリとかテーブルモジュールとか)を構築したらデータベースを勝手に開くとする。 //UI void save_proc(){ var productRepository = new ProductRepository(); productRepository.save(product); } //repository class ProductRepositor…