User Tools

Site Tools


whyflagsarenolongerviable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
whyflagsarenolongerviable [2014/08/08 18:35]
Mitch
— (current)
Line 1: Line 1:
-From a programming perspective, the functionality provided by directives is not much different than that proposed by the flag model. Both aim to modify the default behavior of the ParserMonster Framework. 
- 
-Directives are more suitable than flags for the simple reason that flags imply a limited pair of options: True or False (or Set / Reset, On/Off, Yes/No, etc.)  
- 
-A simple example of the limitation of flags is that the proposed source file option didn't make sense: 
- 
-<code><pre> 
-===== Source File Options ===== 
-Normally, you select the folder where one or more source files are to be processed. Sometimes, though, you may need to specify multiple files from all over the hard drive. If you don't want to have to keep browsing or dragging and dropping folders, one of these flags can help: 
-[[readsourcefromfile]] ignores the Main Window's Read From box and gets file names from (should the file name be based on task name? If not, how do you determine file name? Keep in mind, exporting file lists is common and we do not want to force users to rename files unnecessarily.) 
-</pre></code> 
- 
-The [[directivesreadfrom|<readfrom>]] directive is more straightforward!  
- 
-Not only that, flags might interfere with each other. ParserMonster allows for the source files to come from drag and drop, the folder browse dialog box or a list file (from another program's output, for example). The way the framework handled flags, if each source had its own flag, nothing prevented a task from setting more than one of them. 
- 
-With directives, the framework will obey the last one detected. Simple. 
- 
-Finally, directives are easier to code and maintain. Flags would have proliferated all over the framework as each module checked an increasing number of options. 
- 
  
whyflagsarenolongerviable.1407522931.txt.gz ยท Last modified: 2014/08/08 18:35 by Mitch