Which are the best ways to organize view hierarchies in GUI interfaces?
Posted
by
none
on Programmers
See other posts from Programmers
or by none
Published on 2013-10-18T07:46:48Z
Indexed on
2013/10/18
10:14 UTC
Read the original article
Hit count: 183
design-patterns
|gui
I'm currently trying to figure out the best techniques for organizing GUI view hierarchies, that is dividing a window into several panels which are in turn divided into other components.
I've given a look to the Composite Design Pattern, but I don't know if I can find better alternatives, so I'd appreciate to know if using the Composite is a good idea, or it would be better looking for some other techniques.
I'm currently developing in Java Swing, but I don't think that the framework or the language can have a great impact on this.
Any help will be appreciated.
---------EDIT------------
I was currently developing a frame containing three labels, one button and a text field. At the button pressed, the content inside the text field would be searched, and the results written inside the three labels.
One of my typical structure would be the following:
MainWindow
|
Main panel
|
Panel with text field and labels.
|
Panel with search button
Now, as the title explains, I was looking for a suitable way of organizing both the MainPanel and the other two panels.
But here came problems, since I'm not sure whether organizing them like attributes or storing inside some data structure (i.e. LinkedList or something like this).
Anyway, I don't really think that both my solution are really good, so I'm wondering if there are really better approaches for facing this kind of problems.
Hope it helps
© Programmers or respective owner