[rt-devel] extending rt3 classes? (fwd)
Ruslan U. Zakirov
cubic at acronis.ru
Fri Oct 10 11:14:31 EDT 2003
Alex Porras wrote:
> Hi Ross,
>
> On Thu, 9 Oct 2003, Ross Patterson wrote:
>
>
>>On Thursday 09 October 2003 02:54 pm, Alex Porras wrote:
>>
>>>I did notice that. Maybe I'm confused with the purpose of the _Overlay
>>>and _Local structure.
>>
>>These two techiques allow for replacement of object methods by the RT
>>authors (*-_Overlay.pm) or your site (*_Local.pm). I don't think that's
>>what you were asking how to do.
>
>
> Oh, so it's so you can make changes and not have to change the frontend
> code as far as referencing package names. That makes sense. Okay, I'm
> talking to myself now, so I'm going to shut up.
>
> Thanks for helping clear that up.
>
*_(Overlay|Local|Vendor).pm files contain only functions which just
override subs in module that include them. So you never call Foo from
RT::Ticket.pm if RT::Ticket_Overlay.pm also contain sub Foo.
Also RT::Ticket_Overlay.pm does not contain 'package' directive so it is
same package as RT::Ticket.
Ok. Now if have to change any function of RT::Ticket code then you just
define it in RT::Ticket_Local.pm and it works instead of RT's one. But
you must save API of this function otherwise you could break RT's logic
at all.
Also you could add any new function with any API and call it on any
RT::Ticket instance, but I recommend you follow RT Coding Style.
Good luck. Ruslan.
More information about the Rt-devel
mailing list