Reputation: 1
Why is it better to separate the source of the events (e.g. buttons) from the place where the event is dealt with (i.e. event handlers)?
Upvotes: 0
Views: 81
Reputation: 5425
For one, GUIs are inherently difficult to test. If you can successfully remove most/all application logic from your GUI, then all code that needs to tested will be in a separate class (that has no GUI widgets) that can now easily be tested under JUnit.
Upvotes: 1