Reputation: 1
I need to create an application which will read CSV, do lot of manipulation and finally load the data into some target Oracle cloud application.
There will be various source applications. In the main method, we will supply the source application name and depending on source application name, it will read a properties file for that particular source application and load all values like source folder name, source file name, etc. There are more than 20 source applications and hence 20+ Properties files. Which design pattern should I follow to implement this?
A series of operations are called to process a file and upload to target, such as file read, file validation check, file manipulation, file upload, file upload status check, etc. Which design pattern will be best to implement this kind of functionality?
Upvotes: 0
Views: 72
Reputation: 6054
For the first scenario
Factory
pattern should work,
var properties = propertyFactory.GetProperties(applicationName)
For the Second scenario,
You can use
Chain Of Responsibility
pattern as Erik mentioned
Upvotes: 0
Reputation: 1146
For your first use case, it doesn't sound like you need a design pattern at all. It seems like a method that takes a file name parameter, and then opens that file and reads its contents, possibly returning a struct of the parsed values. No need to over complicate things.
For your second use case, it sounds like Chain of Responsibility is suitable. https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern Wikipedia might not be the best resource here for understanding it, so I would recommend you do some research to see if this meets your needs.
And one final note, remember that design patterns are a means to an end, not an end unto themselves. It won't always be the case where a design pattern maps nicely to your problem at hand, so don't let that box in your imagination.
Upvotes: 1