views:

33

answers:

1

I was watching subsonic's simple repository demo. I came to know that DB schema can be generated from code. I think of code generation as usually domain layer from database. Where is this useful?

A: 

The simple repository generates a database from DTO objects and in contrast if you use the ActiveRecord templates the data layer is generated from an existing db.

For small or new projects with little changes to the database the simple repository is fine but for a larger DB or if you start to migrate an existing project with a grown DB to subsonic you would probably be happier with ActiveRecord.

I would recommend using the ActiveRecord approach and additionally use the migration tool from subsonic 2 for further changes to the DB (it can be used independently from subsonic 2 since it's a standalone tool).

http://stackoverflow.com/questions/1069991/defining-subsonic-3-activerecord-migrations

SchlaWiener