MVC: Controller for Swing

V

VisionSet

I've done a struts application using MVC, fairly happy with my Model - in
that it knows nothing of the view or even struts.

Now I'm building a Swing front end to a different Model.

I can see that the GUI in this case is not as abstract (however it could be
used in other ways) as a web apps View (ie JSP). I imagine interfaces will
figure heavily, in that the View deals with data that makes sense to it in
the form of an interface type.

Anyone have any comments or resources I should look at that discuss best
design principles/patterns for linking a Swing view with a Model tier?
 
H

Harald Hein

VisionSet said:
Anyone have any comments or resources I should look at that
discuss best design principles/patterns for linking a Swing view
with a Model tier?

As a general remark: You will find that the term "model" has a
particular meaning in Swing, and that Swing also has some kind of MVC
architecture. All the components have a corresponding ...Model class.
But you will find that these models are not suitable for non trivial
applications. You have to wrap and hide them in your presentation tier.

What you should do is to first define the interface to your application
logic in terms of the data which should be transfered, the
notifications and also the technology / communication protocol to use.
E.g. simple method calls instead of HTML.

Then you go about building the presentation tier like you would do for
every other tier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top