Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java rich client design patterns: where to find?  RSS feed

 
Diego M. da Rosa
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people,

below is the copy (with little modifications) of a message I posted to the USENET group comp.lang.java.programmer. Since I have got no good answers, I decided to post it here too. My apologies to the readers of comp.lang.java.programmer for the cross-posting.

The link to the original message:
http://groups.google.com.br/group/comp.lang.java.programmer/browse_thread/thread/aac02566d5766156/136ae87a21eed7b2?lnk=st&q=java+rich+client&rnum=1&hl=pt-BR#136ae87a21eed7b2

Regards,
Diego

Hi all,

another possible title for this message would be:

Where can I find effective references on design patterns and best practices to build complete and elegant Swing applications?

I have been developing Swing applications for about 3 years and never got satisfied with the results. In the begining I was not using any design pattern, just putting all my code there in the same class, so you can imagine the mess. After some months I started looking for some references on "building elegant Swing applications" and what I found was very frustrating: there are very few _effective_ references on that.

I think _effective_ is a very important word here. In fact, there are thousands of sites and books describing Java technologies and another thousand others explaining how to build a complete Web application using J2EE technologies. The problem is finding references on building a complete, real-life, java rich client application. This topic is so controverse that one will find many terminologies to define the same type of application: java rich client application, java desktop application, java GUI application, Swing application. The situation gets worse by the fact that people used MVC to build Swing. Then you try googling "swing MVC" and thousands of sites explaining how Swing was developed show up. The problem is I DO NOT WANT TO KNOW HOW SWING WAS DEVELOPED, I WANT TO KNOW HOW TO DEVELOP GOOD APPLICATIONS USING SWING! I have even tried to adapt some J2EE patterns to Swing applications, but the results were definetly not good.

In fact, there are some sparse references describing how to build complete Swing applications using patterns like Presentation Model and Model-View-Presenter (MVP):
- Desktop Java Live: http://www.sourcebeat.com/TitleAction.do?id=10
- JGoodies: www.jgoodies.com
- Martin Fowler home-page: www.martinfowler.com
- Martin Fowler work-in-progress (Patterns of Enterprise Application Architecture): www.martinfowler.com/eaaDev
- Spring Rich Client Project: www.springframework.org/spring-rcp
- Eclipse Rich Client Platform: wiki.eclipse.org/index.php/Rich_Client_Platform
- The Humble Dialog Box: www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf
- HMVC: http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc_p.html

The problem with this references is that the information is either not uniform or not complete. Each one explains MVP one way, with very poor examples. Also, many of them do not approach key subjects such as validation and event handling. It would be very good to see a complete source code example of a Swing application using MVP with validation and accessing a persistence layer. Does anybody know where can I find that? Any book talking about this topic would be very good too.

"It is our belief the only problem with Swing is that there are a limited number of higher-level abstractions available that assist in making the toolkit simpler and easier to use, and a limited number of design best practices. The goal of spring-richclient is to provide that." Spring Rich Client Project

Thanks in advance,
Diego M. da Rosa
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Diego.
I agree. Most of the work out there is centered on how to use particular components rather than how to design applications. For the record, I mostly write web-apps. When I do use Swing, I try encapsulate small scale MVC relationships (i.e. a button with the number "1") into larger components (i.e. a calculator keypad) with their own events and listeners into larger scale MVC relationships (i.e. a calculator component with keypad and display) until I have an application (see this conversation for some discussion). It's not much, but it is a good tool to get a handle on complexity.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!