dagobah icon indicating copy to clipboard operation
dagobah copied to clipboard

Code Quality: Refactor remote tasks into subclass

Open rclough opened this issue 11 years ago • 3 comments

I realized when making the changes for job as tasks that remote tasks should also be subclassing the task, rather than exacerbating the logic within the Task class.

rclough avatar Jun 12 '14 19:06 rclough

ps dagobah now has #99 problems

rclough avatar Jun 12 '14 19:06 rclough

Actually now that I think of it, this makes switching a task from remote to local a bit more difficult? I guess calling init with the relevant info wouldnt be hard to do. If necessary there could be a convenience method like convert_to_remote() and convert_to_local() that would return the appropriate version

rclough avatar Jun 12 '14 19:06 rclough

I think you probably want a Task base class with LocalTask and RemoteTask sub-classes. The base class would contain a method that spits out whatever information the subclasses constructors would need to facilitate conversion.

thieman avatar Jun 12 '14 19:06 thieman