in reply to Re: Re: subclass and overridden constructor
in thread subclass and overridden constructor
It might be straightforward to make a package that was a subclass of a specific processor, such as Unleashed::AuthorizeCard::AuthorizeNet inheriting from both your Unleashed::AuthorizeCard and Business::OnlinePayment::AuthorizeNet.
If you want to dynamically handle whichever processor the end-user selects, you'll probably have to either generate subclasses on the fly, or use delegation rather than inheritance.
(More generally, this illustrates one of the advantages of well-factored frameworks that use delegation internally; for example, I can imagine a version of Business::OnlinePayment that was divided into separate Transaction and Processor classes, which would allow you to subclass Transaction without worrying which Processor it was connecting to.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: subclass and overridden constructor
by geektron (Curate) on Dec 03, 2003 at 22:12 UTC | |
by duff (Parson) on Dec 03, 2003 at 22:24 UTC |