Click here to Skip to main content
15,741,818 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a requirement to transfer files from heterogeneous sources (eg: FTP,SSH,SSHW) to destinations (can be again FTP,SSH,SSHW..etc).

I have identified the steps to implemenent this;
1. Get All File names from source
2. Rename files
3. Download Files
4. Transform Files
5. Upload to destination
6. Delete from source

In most cases, I have to execute all the 6 steps. But in some cases I have to use only some of these steps. In short, I will have different combinations of above steps. I will configure these combinations somewhere in DB or xml.

case1: step 1 ,2,3,4,5,6
case2: step 1,2,4

I am looking for proper design to implement this.

I tried to use Chain of responsibility. Thought I will take expert advise.

Appreciate your input.
Updated 23-Oct-20 4:27am
Sergey Alexandrovich Kryukov 8-Sep-15 10:48am    
Sorry, this is not a question. What's the problem? Why looking for a pattern at all? Don't you think that looking at pattern simply prevents you from sitting down and designing the system properly?

Software engineering is not done by "looking for design", it's done by working at design.

[no name] 11-Sep-15 21:15pm    
Agree with SA. Who said you need a pattern? There is no substitute for thinking.

I am surprised that people so dump that create a pattern for the pattern. File Transfer must upload and download files in order to transfer them. Renaming and transforming files is an obvious mixture of concerns (a design sin) and for these tasks we have ETL pattern (back to school!).

The author does not distinguish between systems and patterns: "Get All File names from source" is a system/implementation and is not a pattern at all; it is a simple request. The "Delete from source" has nothing to do with File Transfer - it is not a pattern also; it is an optional system operation.

If you want to be seen seriously, learn the basics first.

- Michael Poulin.
Share this answer
Dave Kreskowiak 23-Oct-20 11:43am    
You're only 5 years too late to the discussion.
The first thing that comes to mind is an XML configuration file, something along the lines of the following.

    <task id="1">
    <task id="2">
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900