Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
add comment

closed as not constructive by gnat, Jim G., Walter, Mark Trapp, World Engineer Oct 15 '12 at 20:35

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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