0

I'm about to create a desktop application. I decided to do it in swing. Now I am confused about the architecture that I'm going to use. I decided to do something like.

ui-controller-service-dao

I'm confused mainly in the relationship between the controller and the UI. I understand that the controller does the operations that the ui needs to do like the controller handles the events of the ui, such as when a button is click. But for cases like when a button is clicked then disable some ui, it means the controller needs to acces the ui to do the disabling. Now how can provide access to ui from controller?

Bnrdo
  • 5,325
  • 3
  • 35
  • 63

1 Answers1

0

The Controller will have a link to its respective view and model. A button click would not have to go through the controller since its the responsibility of the UI itself to handle this event. On the other hand if you are opening an internal frame and there are multiple panels, then these should be displayed by going through the controller. And if say one panel wants to change the value of another panel, then it should go through the respective controller to which that view belongs to and not interact directly with the view.

dinukadev
  • 2,279
  • 17
  • 22