one class per algorithm or one function per algorithm
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: one class per algorithm or one function per algorithm

  1. #1
    Join Date
    Dec 2008
    Posts
    26

    Cool one class per algorithm or one function per algorithm

    Hi !
    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 ,
    d.m.

  2. #2
    Join Date
    Jun 2002
    Location
    Stockholm, Sweden
    Posts
    1,590

    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.
    Nobody cares how it works as long as it works

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center