> On 10/05/2007, at 1:51 AM, Dave Rolsky wrote:
>
>> On Wed, 9 May 2007, A. Pagaltzis wrote:
>>
>>> Delegation means that the caller communicates only with the
>>> object that delegates and doesn’t know which object does the
>>> actual work. That’s not what’s happening in your example.
>>>
>>> Something like this would be delegation:
>>>
>>>    sub trail_length {
>>>        my $self = shift;
>>>        $self->breadcrumbs->trail_length;
>>>    }
>>>
>>> Here the caller talks only to VegGuide::Response and doesn’t even
>>> know that there’s a VegGuide::Breadcrumbs object behind the scene.
>>
>> I think there's a name for tha pattern I'm using, but I can't
>> remember it or find a good reference online.
>
> Would that be the factory method pattern?
>
> http://en.wikipedia.org/wiki/Factory_method_pattern
>
> --
> Adam Clarke

or the closely-related Dependency/Provider injection pattern?

Dependency injection is a pattern in which responsibility for object
creation and object linking is removed from the objects themselves and
transferred to a factory.
^- http://en.wikipedia.org/wiki/Dependency_injection



_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to