开发者

One executable with cmd-line params or just many satellite executables?

I design an application back-end. For now, it is a .NET process (a Console Application) which hosts various communication frameworks such as Agatha and NServiceBus.

I need to periodically update my datastore with values (coming from the application while it's running).

I found three possible ways:

  1. Accept command line arguments, so I can call my console app with -update.
  2. On start up a background thread will periodically invoke the update method.
  3. Create an updater.exe app which will do the updates, but I will have code duplication since in some way it will need to query the data from the source in order to save it to the datastore.

Which one i开发者_高级运维s better?


Use the simplest thing that will work. Sounds like option 1 is the way to go based on the info you have given.

Option 2 has threads, threads always complicate programs, more difficult to debug and write, greater chance of bugs.

Option 3, would mean that you have two apps, if you make a change you will have to deploy new versions of both, increasing maintenance costs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜