[Catalyst] ActiveRecord for Perl
Perrin Harkins
perrin at elem.com
Tue May 22 15:38:41 GMT 2007
On 5/22/07, mreece at vinq.com <mreece at vinq.com> wrote:
> one thing i really like about AR is the association proxies, where
> relationships themselves are objects you can call methods (ie, find) on
>
> class User < ActiveRecord::Base
> has_many :items
> end
> class Item < ActiveRecord::Base
> belongs_to :user
> end
>
> items = user.items
> item = user.items.find(params[:id])
> new_item = user.items.create!(params[:item])
The functionality you're describing is available in all of the ORMs,
including Class::DBI. I don't know if any of them chose to model the
relationship as a separate object though. I can't really see the
appeal myself, but to each their own. Maybe the RDBO object manager
class is more your style.
- Perrin
More information about the Catalyst
mailing list