PDA

View Full Version : Handle the same process with different actions



remizero
8th September 2016, 17:46
Hello again friends, as they are?

Today I bring the next question, I could not solve, or at least visualize the most appropriate way to resolve it.

I have a process called "refactor" who want to reuse, and have two tasks or actions, "delete" and "rename" I want to run, each on demand clear is.

The question itself is as follows:

How I can do to make this process receives a list of files to be modified and indicating the type of action "delete" and "rename" ?.

Is there a design pattern that allows me to perform this task ?.

I have been researching but not achievement which can serve to identify me.

Although I think the closest to what I want are: Command, strategy

Thanks in advance.

wysota
9th September 2016, 09:57
I think all you need is a list of items describing a single task you want to perform which you will pass to the process. Unless you intend to extend the amount of actions that can be performed, I don't see any benefits of using some complicated design pattern.