2

While programming an object that represent a GUI, the class is a mix of code of following sections:

  1. Overrides of super GUI, for behavior customization
  2. Implementations of interface contracts, to talk/listen to other GUI objects
  3. Local event handling methods
  4. Local data crunching methods
  5. Code to query/update a remote database and a global object provider

Assuming all this is crammed into one class file, how would you split it into separate files or parent-child classes so that you can delegate these to different developers with minimum dependency on each other?

1 Answer 1

3

Check out the Model-View-Presenter or Presentation Model patterns, or indeed any of the many UI design patterns whose express purpose is to separate the display from the logic.

The basic concept is that the View, being the page or screen of form or whatever, handles only the UI itself - fields and buttons and so forth. There's a Presenter that does the number crunching, DB access and so forth, and any UI action (button click, for instance) is mapped on the View to a call to an action on the Presenter, which does the logic. This means the UI can be developed independently, facing a mock/basic Presenter. Meanwhile, the Presenter can be developed abstractly, since it just exposes Commands, rather than expecting button clicks.

Not the answer you're looking for? Browse other questions tagged or ask your own question.