mardi 2 août 2016

What's the design pattern used by Ant and MSBuild?

Build systems like Ant and MSBuild allow many subtasks ("targets") to run atomically, leave persistent artifacts that allow rapid calculation of whether their output is up to date, and be associated with zero or more prerequisite targets.

Or at least that's my understanding of them. Right now I'm dealing with a batch system that has a lot of different expensive steps in its workflow, many of which are reading and caching data from external systems using ad-hoc and error-prone flags and timestamps to control the logic of when caches need to be refreshed.

I don't need think I need anything as configurable as Ant or MSBuild, but I need to make my workflow and prerequisite logic more reliable. That is, hard-coding the dependency map into C# is probably fine for now. I think I want some flavor of the Command design pattern that will allow all the current steps in our workflow to be organized into objects similar to MSBuild <Target> or Ant <target> nodes.

Can you name the pattern I'm looking for and give some examples of where it's used?

Aucun commentaire:

Enregistrer un commentaire