Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Class or Object composition ??

by bsb (Priest)
on Oct 03, 2006 at 23:21 UTC ( [id://576203]=note: print w/replies, xml ) Need Help??


in reply to Re: Class or Object composition ??
in thread Class or Object composition ??

Which modules on CPAN are good examples of the plugin style architecture?
Template? DBIx::Class?

Replies are listed 'Best First'.
Re^3: Class or Object composition ??
by perrin (Chancellor) on Oct 04, 2006 at 18:52 UTC
    There are not many examples of composition on CPAN because CPAN is mostly smaller pieces. DBIx::Class uses inheritance, modified by Class::C3. Template Toolkit has an excellent plugin API, but that's kind of separate from composition.

    However, if you look at the TT code, it does use composition internally. For example, a Template::Provider is a service for finding templates which the main Template object points to. You can implement the API and create a Template object that points to yours instead of the default one. It's a very good system for replacing bits and pieces.

    Another plugin system that worked out really well is Crypt::CBC, but again it's not so much composition as a specific plugin API.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576203]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found