On Apr 6, 10:54 am, Jonathan Vanasco <[email protected]> wrote: > Usually I go for application maintainability. Looking at the original > code , this bigtask() class looked to be a logging functionality that > is used across multiple controllers and actions. i'm inclined to > refactor code like that into helper functions , so I only need to > update them in the smallest amount of places when the objects > interface / methods change. assuming bigtask() adds a new column, and > is called in a dozen places, I'd rather only edit 1 invocation of the > method to pull the request params -- not 12.
It actually calls a task, and each action that calls it uses different parts of the request object. I thought about writing a wrapper class around the wrapper class, but, adding another layer of indirection seems like it would harm maintainability. I thought about doing something like (task_id,status) = task().bigtask().add(request.params) and having .add figure out what arguments it needed.. but then I need to pass client_id... and this calculated field... and another.. there are 8 different bigtask() classes, and each class has 8-10 methods. They are all related to task() which is the master class for task dispatch. Each action in the controller calls each class differently, so, there is no real repetition. I think this is one of those situations where it can't be any cleaner while maintaining readability. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
