I am making a program in which I have a list of items. You can add a new item or edit an existing one. The dialog box for editing an element and adding a new one is practically the same, one small detail that changes is good, one editing, and the other adds the element, and another completely different.
I was wondering if, in general, the best design choice should have two separate classes or only have one class that is passed a parameter that indicates whether the dialog will be for editing or for adding.
I use C ++ with Qt, but I think the same design will apply to any OOP language / structure.
Thanks in advance.
source
share