in reply to Re: Which is better software design
in thread Which is better software design

This of course leads to the question of whether it should receive a csv list or whether another component is responsible for this aspect of processing.

The answer of course depends not on tactics but on strategy. If you want your tag search to be closely tied to this representation then your suggestion is good, but if you want to make it more general and allow that representation to change, then you need to structure it differently.

Replies are listed 'Best First'.
Re^3: Which is better software design
by hippo (Archbishop) on Mar 27, 2015 at 11:25 UTC

    Completely agree. The change in structure is a much bigger job but one worth doing (or at least considering).

    Without knowing the detail of the OP's system it is hard to suggest anything specific. That said, generally the best approach IMHO to vanilla CGI is to collect, validate and sanitise the inputs right at the start so that by the time any real processing occurs the script has a known clean data set to work with. This is almost always worth the code refactoring work to achieve it and results in the rest of the code being leaner for having to do less validation at that later stage.