General Architecture Question
I have previously really only worked on your general 3-tier system.
I am now tasked with something slightly different. I now need to retrieve files from 3rd party location using FTP. In the few times in the past I would have built a console app run and ran it on a schedule. It would have worked but maybe not been the best.
I am looking for some general patterns that might 开发者_StackOverflowbe helpful. I am not looking to go into architect astronaut land. I just want to make sure I don't re-invent the wheel or make a newb mistake.
I will be implementing this on the .net framework
My view is that (generally) the best architecture is simply the simplest archetecure that achieves all of the requirements.
The two immediate options that I can see are:
- A simple console application that runs on a scheduled task
- A simple service that runs
Some people might argue that writing a service is more flexible and therefore a better architecutre, however its also the more complex design - for example:
- What happens if someone wants to do manually trigger the download?
- You also now need to mess around with timers and threads etc...
- What happens if there is a failure?
- etc...
It might be that certain requirements (e.g. resilience or something) mean that a simple console application doesn't fulfill all of the requirements in which case you are forced to go with the more complex solution, however if you can get away with it I'd go for the console application.
I agree with the idea of always writing the least complex application that satisfies the requirements. In this case it sounds like a console app run use task scheduler would be perfect. I also suggest you use test driven development and log4net for your logging.
精彩评论