CopperOnion
まもなく First Release らしいです。
現在でも SVN 経由でコードは取得できます。
このフレームーワークのDumbRecordにちょっと興味をひかれました。
こんな部分があります。
(CopperOnion\co_libs\common\capecode\helpers\DumbRecord.php
private function mirrorDataObject( $dataObject ))
try
{
if( !$this->isTable( $this->getTableName( $dataObject ) ) )
if( $this->createTable( $dataObject ) )
$this->logDebug( 'Error Creating Table '.$this->getTableName( $dataObject ) );
$this->createColumns( $dataObject );
return true;
}
そして、createTable では、
return $this->execute( "CREATE TABLE $table ($query)" );
としています。
テーブルがなければ、フレームワークが自分でDBテーブルを作ってしまいます。
作者のブログによると、
CopperOnion uses the idea of DumbRecord, a kind of reverse implementation of ActiveRecord. Instead of jumping into your database to design your tables CopperOnion lets you just write your code. DumbRecord then creates the tables and columns for you as they are needed.
「まずはデータベースありき」ではなく、まずは「コードありき」ということだそうです。ソースコードが主導権を握るフレームワーク、という発想も面白いと思います。
"データベース"か"他のリソース"かを意識しないでプログラミングできるようになるような時代が来るでしょうか……。
ラベル:フレームワーク




