Hello,
I have noticed two
patterns, heavily used in this forum - Factory and MVC. Do we really need them?
1. Factory pattern. Consider following architecture: Business interface with methods like book() and search() is implemented as local(for alone mode) and remote(for cleint mode) objects. Is it worth to have 4 classes(BusinessFactory interface and 3 implementations for each mode) instead of 3 static initializers? In either case we need to check for input argument(mode) and either call static initializer or instantiate appropriate factory. And what do we win from the latter approach? Instead of passing Business instance to GUI(or whatever) constructor, we pass factory isntance.
2. MVC pattern. IMO we need to implement it for main GUI since it is indirectly required by Sun. But how about those connection dialogs(host, port) - do we really need MVC for them? Take a look at JFileChooser - it has no MVC and it's ok, since it is too simple.
Conclusion: IMO design pattern is only a tool to build smth, not a goal itself.