This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

More MVC......question for Mark

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,
I have followed the MVC discussions with great interest especially the differening views of Mark and Eugene.
Im my current application i have followed the hook methods describes by Mark and have kept my model and view relatively uncoupled. I now have a GUI with a JTree on one side and alternating panels on the other side displaying differing details depending on the types of node selected in the Tree.
What i am wondering is if people have tended to use a Controller for each area of the GUI or have one overall Controller. Currently i have implemented a Controller for each area of the GUI (i.e one for the Tree Panel and one each for the various panels that can be displayed on the rhs). However what this mean is that i am often moving between the specific controller and the main controller in order to handle user events. E.g if a user adds a node to the tree i can add the node to the tree model from the Tree Panel controller buti then have to call a method in the main controller to get the correct information displayed on the rhs. I am wondering if this is the correct way to do this??
If i had a single controller for all GUI components then this controller class would be very large. I would have to add listeners for each GUI component on each of the different panels. I would then have a very large number of event handling methods in the controller. I could need an event handler method for 15 different text fields ( if i had 3 panels with an average of 5 text fields each. I am sure i could write a dynamic class to display node information but i do not have the time right now ). Also there would be event handler methods for the various kinds of mouse clicks on the GUI. So the result would be a very large(busy) class.
I am wondering if i should be prepared to increase the size of my controller class to prevent passing events up and down a controller hierarchy? What is the most appropriate solution.
Thanks,
John
[ August 29, 2002: Message edited by: John Ryan ]
 
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic