PureMVC Architects Lounge

PureMVC Manifold => Standard Version => Topic started by: nephiw on March 31, 2010, 12:10:04



Title: Application Class Part of View?
Post by: nephiw on March 31, 2010, 12:10:04
In Flex and Flash you have what equates to a view component for the application entry point.  It is either an <mx:Application> or a document class.  This is not the case with Java, with the possible exception of when one uses netbeans GUI designer to create the GUI.  However, I am creating my GUI using swing components arranged by hand, and it seems logical that the application entry point not be part of the view.  Instead PureMVC is created first, then a login screen, and finally the main application.

So my question is, does this approach hold to the PureMVC gestalt?  Is there an advantage to starting with a view component that I am missing?  Basically, what is the the best approach for application entry with Java?


Title: Re: Application Class Part of View?
Post by: puremvc on March 31, 2010, 10:06:33
My Java work has been on the server side, so what I know about Swing could fit in a matchbook without taking the matches out. However, I would venture there has to be some container that the components all go into at some point, a root node in the view hierarchy.

I would assume in a browser this be the JApplet class. So there you could get the init method being called when the browser starts the app, and that could get the facade instance, causing the PureMVC apparatus to be created. And you have a handle to the JApplet so you can set up listeners for the keyboard and mouse there if need be.

You basically just want to have the PureMVC apparatus mediate the root of the view hierarchy and then selected places in that hierarchy as need be.

-=Cliff>