Reputation: 1620
I am basically writing a code which reads a text file, stores it in a string, does some operations with the string and displays it on a dialog, then writes the file if some changes are made. Now i have made separate interfaces for FileRead, FileWrite, StringHandling, LineHandling, Database and i have a controller class which implements these interfaces and i just call the instance of controller class in gui.. I wanted to ask that if the design is ok or do I need a separate class implementation for each interface.
Upvotes: 0
Views: 40
Reputation: 7863
I think for such a small project it is acceptable but generally I would consider it bad design for two reasons:
As I said for such a small tool it might be considerd OK but it's never a bad thing to have your architecture straight ;-)
UPDATE
If you follow these two points you still only need one controller class. It can refer to the different classes that do your logic.
Upvotes: 1