one class per algorithm or one function per algorithm
I want to organize some (pattern recognition) algorithms (like fractal dimension , GLCM , etc) in a library (with lib and include ) , and i don't know which is the best approach , one class for each algorithm or one function for each algorithm .
If i do one algorithm per function , my functions signature will have a long list of parameters ... i actually do not know which is the best approach for this problem .
I also have to implement a detachable test module .
Could you please tell me , how would organize your code and why ... one class for each algorithm or one function for each algorithm .
Thanks in advance ,
Re: one class per algorithm or one function per algorithm
As long as it's just a single function, I don't think you should worry about the argument list being long. If some parameters are optional, put them last in your argument list and provide some default values.