UI: A class of its own or built by objects?
Should the UI be an object in and of itself or should the top-level container be built and maintained by a UI object while the components to this are designed and added by other objects.
> Should the UI be an object in and of itself
What else can it be?
> or should
> the top-level container be built and maintained by a
> UI object while the components to this are designed
> and added by other objects.
A UI is a complex Component with other Components and Containers as children.
I would put it in its own package and give the Controller a builder or factory that creates it as needed.
%
With that said, a complex UI is most likely to be several objects. If this is a Swing UI, you might have more than one JFrame/JPanel.If it's a web UI, made up of JSPs, you'll have at least one JSP per page. You might use SiteMesh to composite one page out of several.%