>>>>> "Steve" == Steve <st...@matsch.com> writes:
Steve> Hi all, Steve> I have a question regarding controller refactoring, and whether subclassing Steve> (or adding a Moose role) would be a good idea for a particular application. Steve> The application creates 6 different types of invoices, each representing a Steve> particular type of service. Currently, I have a controller for each that Steve> handles the various steps that must be taken to produce and ultimately send Steve> these invoices. ALL OF THESE CONTROLLERS HAVE THE SAME ACTIONS, and most of Steve> the same logic, which to me says I should refactor these controllers...I Steve> just don't know how, and also whether the benefit is worth the work. Almost Steve> certainly it would not be worth it in and of itself, however I might want to Steve> write another application someday where knowing this would certainly be Steve> useful :) Steve> So IF this seems reasonable, and my controllers are 'FOOcontrol', Steve> BARcontrol', 'BAZcontrol', and my actions are 'initialize', 'upload_data', Steve> process', 'generate_invoices'...etc., what is a good way to stay DRY? In Steve> particular I'm having a hard time wrapping my mind around how the URI's Steve> would be handled. If the actions aren't private, you want to create a base controller to preserve the URI paths and keep them consistent across the several inheriting controllers. If not, move the methods into a model and use delegation. -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkey http://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://blog.edencardim.com/ http://www.shadowcat.co.uk/servers/ http://twitter.com/#!/edenc _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/