user2062228
user2062228

Reputation: 1

Separation of UI from the event handlers

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

Answers (1)

splungebob
splungebob

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

Related Questions