MVP for the Great Unwashed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

MVP for the Great Unwashed

bill
I'm a lowly Java programmer, who is having a very hard time
programming GUI apps (my background is in scientific programming).
I'm using Java Swing for this, but I have no choice on the matter:
that's what I'm told to do by my boss.

I posted a desperate plea for help in comp.object, and one of the
responders made me aware of MVP.  Since then, I've read two papers on
MVP ("Twisting the Triad" by Bower and McGlashan of Object Arts
(http://www.object-arts.com/Papers/TwistingTheTriad.PDF), and "MVP:
Model-View-Presenter: The Taligent Programming Model for C++ and Java"
by Mike Potel of Taligent(/IBM?)
(http://www-106.ibm.com/developerworks/library/mvp.html).  These
articles are very useful to get a general picture of the thinking
behind the MVP framework, but they are still too vague.  Neither has
toy examples with code, or even pseudocode, to illustrate their
generalities.  I don't feel that my grasp of what they are talking
about is firm enough to translate these generalities into actual
running Java code.

(I'm not fluent in Dolphin Smalltalk, or in Smalltalk period, so it is
difficult for me to follow the MVP examples/tutorials in the Object
Arts site.)

I've tried to make the simplest implementation of an "MVP-style"
application using Java Swing, but I quickly run into tasks that seem
to me impossible to do without rewriting huge portions of the Java
Swing library.  (I'd be happy to give details, but this is probably
not the right forum to post Java code!)

My question is, does anybody know of some simple examples of the MVP
framework written in Java/Swing?

Thanks,

bill


Reply | Threaded
Open this post in threaded view
|

Re: MVP for the Great Unwashed

Barry Carr-2
Hi Bill,

Your best bet is to probably try some of the tutorials available on Sun's
web-site. Here is a link to their swing tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/index.html. I also
recommended that you register with Sun's Java developer connection at:
http://developer.java.sun.com/developer/. Where can access loads more info
and tutorials, its free to register BTW. You may also want to try
http://www.jguru.com/

Hope this helps

regards,

Barry Carr

Ixian Software Components Ltd
Blairgowrie
Perthshire


Reply | Threaded
Open this post in threaded view
|

Re: MVP for the Great Unwashed

bill
Thanks.  I'm quite familiar with the Swing tutorial.  In fact, I've
written several Java Swing applications already.  They all do their
job, but they are, as far as I'm concerned, very poorly coded.  Each
one is basically a whole bunch of spaghetti code.  The Swing Tutorial
does not address OO design issues in sufficient depth to help me here.
That's why I'm trying (as hard as I can) to understand MVP, and how to
apply it to Java Swing applications.

bill


In <Xns921BD16D37BB7barryarrakisclaranet@158.152.254.78> Barry Carr <barry@<nospam>arrakis.clara.net> writes:

>Hi Bill,

>Your best bet is to probably try some of the tutorials available on Sun's
>web-site. Here is a link to their swing tutorial:
>http://java.sun.com/docs/books/tutorial/uiswing/index.html. I also
>recommended that you register with Sun's Java developer connection at:
>http://developer.java.sun.com/developer/. Where can access loads more info
>and tutorials, its free to register BTW. You may also want to try
>http://www.jguru.com/

>Hope this helps

>regards,

>Barry Carr

>Ixian Software Components Ltd
>Blairgowrie
>Perthshire


Reply | Threaded
Open this post in threaded view
|

Re: MVP for the Great Unwashed

Barry Carr-2
Hi Bill,

Sorry I missed the point of your post.

I'm not sure that you are looking in the right place. As I understand it
Swing uses MVC (Model-View-Controller) rather than MVP. I'm no expert on
either so I'm not qualified to tell you what the differences are.

On a more positive note, I did a search on MVC at jguru.com and got quite a
large response. There might be something there that could help you.

Regards

Barry


Reply | Threaded
Open this post in threaded view
|

Re: MVP for the Great Unwashed

Dave Harris-3
barry@<nospam>arrakis.clara.net> (Barry Carr) wrote (abridged):
> I'm not sure that you are looking in the right place.

That's probably my fault as I pointed him here. His original plea was more
general. I hadn't realised he was wedded to Java and MVC.

  Dave Harris, Nottingham, UK | "Weave a circle round him thrice,
      [hidden email]      |   And close your eyes with holy dread,
                              |  For he on honey dew hath fed
 http://www.bhresearch.co.uk/ |   And drunk the milk of Paradise."


Reply | Threaded
Open this post in threaded view
|

Re: MVP for the Great Unwashed

bill
In <[hidden email]> [hidden email] (Dave Harris) writes:

>barry@<nospam>arrakis.clara.net> (Barry Carr) wrote (abridged):
>> I'm not sure that you are looking in the right place.

>That's probably my fault as I pointed him here. His original plea was more
>general. I hadn't realised he was wedded to Java and MVC.

I'm wedded to Java (unfortunately), but not to MVC.  If I could
implement MVP in Java without rewriting major chunks of Swing, I'd
very much like to try it.  But I need to understand it first.  The
title of Potel's paper (with the word Java in it) had given me some
hope of finding MVP for Java somewhere...

bill