I'm trying to design the "main" classe(s) of a Rich Desktop Application based on NetBeans Platform 7. This application will consume HTTP services and, through a "push system" over TCP, will receive messages.

  • We are 3 developpers and we want to develop modules in parallel
  • Application will be layered (Data, Business, Presentation)
  • We'll use Presentation Model in order to separate responsibilites
  • Some granular data (a bean Person for example) will be shared by several screens (and possibly displayed on several screens at the same time)
  • ...

We are able to develop individual screens, but We don't know exactly how to organize the whole application and define each module content.

  1. So, have you any advice (a pattern / best practice / book / sample app) to coordinate/manage interactions inside of the whole application?
  2. Any advice about how to define modules content?


Small example to illustrate what I want to build: A Foo User Management Application

  1. Launch the application
  2. At the left [explorer] we have a list of platforms (list is stored in a local file)
  3. At the top we have button to add a new Platform (also available with right click)
  4. By double-clicking on a platform, the app calls a HTTP service a retrieve a complete list of users. This list is displayed in the [editor] (in a JTable)
  5. A background process is started: through a TCP connection we receive messages
  6. It is possible to Add new user thanks to a button in a Toolbar

If the application is launched on another PC, and if the user is connected to the same platform, its User List will be updated dynamically (add/remove/status:{offline/online}) (thanks to messages)

In the future it a Chat Module will be provided.

My question is (in other words): any advice/best practice to decide on content of each module? If PM (Presentation Model) is a good way to separate view/business and data and create screens, what is the best way to link several screens based on PM? Imagine we develop the Chat Module, how to add an entry "Discuss with..." to the Context menu available with right click on User List?


2 Answers 2


Given your requirement, to start with the core processing stuff should be made of Command Pattern and later you can use Template patterns for request-processors. And so on and on. There is nothing called a Master pattern. If there were, they wont need us anymore.

The idea is to have a design that will allow you to evolve with requirements.

I would start by creating a base module interface and give the interface to everyone and some utilities around it. Let everyone implement their own modules based on the base-module.


I think you're looking at a pretty classic MVC pattern backed by services (RESTful I assume). The key will be to separate the service(s) from the UI. This is not because you are introducing an alternative UI, but because gives you clarity in what your service interface should be.

So when you are thinking about the getPeople service, make sure you think about how a secondary (non-Swing) UI would interact with the service. If you keep that in mind you'll come up with a fairly flexible/decoupled solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.