NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
don't mix responsibilities (Score:1)
Hi Ovid,
Your example doesn't sound right to me. The job of a server is to serve requests; the job of an ORM is to give access to some persistence methods; merging both responsibilities into a single class, be it through inheritance or through roles, is confusing. I would rather have a ServerInfo class that keeps the persistent data, and a Server class that deals with requests, with a "has-a" relationship between them (and then it doesn't matter through which mechanism such classes are composed).
Besides, I agree that instances of DBIx::Class have too many methods, but that's not a consequence of using inheritance, it's a consequence of the particular DBIx::Class design, which is another mix of responsabilities : datasources and resultsets are merged into one single concept.
Reply to This