From: Chris W. <ch...@cw...> - 2004-07-18 02:07:48
|
On Jul 17, 2004, at 3:12 PM, Antti V=E4h=E4kotam=E4ki wrote: > I began implementing this and noticed that maybe this isn't after all=20= > what would really be needed. All I really want to do is modify how=20 > OpenInteract2::Request works - I don't want to create a new request=20 > handler for apache, apache2, cgi, daemon & future request types. I=20 > just want that when they use OpenInteract2::Request functions as base,=20= > those functions offer some extra functionality. Well, this is the standard OO dilemma, eh? The number of request types=20= is fairly limited so putting your common functions in a parent class=20 (that subclasses OI2::Request) and then creating a simple class for=20 each of the implementations won't be so hard. For instance: # put your custom stuff here, overriding methods where necessary package OI2::Request::Antti; use base qw( OI2::Request ); # These can be an empty classes... package OI2::Request::AnttiLWP; use base qw( OI2::Request::Antti OI2::Request::LWP ); package OI2::Request::AnttiApache; use base qw( OI2::Request::Antti OI2::Request::Apache ); and so forth. Since you can override methods in your=20 OI2::Request::Antti class you can change however you want OI2::Request=20= to work. (For instance, overriding 'assign_request_url()' you can use=20 whatever means you want to pull out the 'action' and 'task' from the=20 URL.) Make sense? > So could it be possible to define 'request' class in 'system_class'=20 > which would be used as base for all basic request implementations? That really breaks how the system works. I think we can find another=20 way around it :-) Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |