What is the best wrapping strategy ?

Posted by Riduidel on Programmers See other posts from Programmers or by Riduidel
Published on 2010-12-29T10:39:30Z Indexed on 2010/12/29 11:00 UTC
Read the original article Hit count: 293

Filed under:

Hi, I'm planning to integrate an external tool (ffmpeg in my particular case, but it could be anything, in fact, as lolng as its tasks are long running ones). This tool has a lot of command-line parameters.

For now, I've done to simple things with it, already requiring me a good bunch of class writing, to embed all the information it can return to me.

I now face the even more complex task of having to send it a bunch of parameters and to handle possible errors.

So, what is a best way for that ?

  1. Create classes containing all possible options
  2. Relying upon a reverse equivalent of commons-cli / CliBuilder / OptionParser
  3. Directly write all options from user input
  4. Obiwan Kenobi powers (or anything I don't even know about)

Please notice I do it in an uncommon language (for the sake of me, don't ask me what it is, as it looks like a desperate and sterile union between CoffeeScript and lua), as a consequence, there can be no framework doing what I want in the language I use.

© Programmers or respective owner

Related posts about design