Platinum Partner
netbeans

Tunisian National Order of Pharmacists on the NetBeans Platform

Daoud AbdelMonem Faleh (blog is here) is a software developer from Tunisia with about 7 years experience in the IT field. His first encounter with Java and Java EE technologies was at his first job, at WebOne, where he served as a System and Network Administrator. There he built, deployed, and managed Java EE applications, and since then fell in love with the technology.

Daoud, you've recently released your first commercial application on the NetBeans Platform. Please tell us all about it!

My first encounters with Java were exclusively on the server side. This is the first time I've been contracted for a desktop application. The application is for the local National Order of Pharmacists, it basically manages member affiliations. Members have access to documentation sold by the organization, which is also handled by the application.

Click to enlarge the image of the main window below:

What are the two or three things that you are happiest about, relating to this application?

  1. This is my first ever commercial desktop application. It opened a whole new horizon for me, with new business opportunities.
  2. The nice, responsive, and friendly GUI my application offers the user.
  3. The modular infrastructure of the NetBeans Platform, which lets me be quite agile in managing user requests and expectations.

Underneath this application is the NetBeans Platform. Why?

As I said above, the modular architecture of the NetBeans Platform lets a single-person team be agile in managing the application's growth and uses cases. Plugging in a new module that implements a new user requirement works like a charm.

Next, the available documentation and the great community really helps in lowering the learning curve and resolving technical challenges.

Third, with the help of NetBeans Platform window system, I've been able to offer the concept of a "work area", where users can manage different views they'd like to see, along with their placement (which is persisted across restarts), so that the application adapts to the user's preferences... and not the other way round, which is normally the case.

How did you find out about it? When? Why did you start using it?

I have been a happy user of NetBeans IDE for a long time. I've used it extensively lately for developing and maintaining a large Java EE project that I migrated from a commercial IDE to NetBeans, while providing rapid consulting services.

Last summer I got the opportunity to give a JSF/Richfaces training with NetBeans IDE and the attendees were very pleased with the functionality that the NetBeans IDE offers. So I was looking for ways to further extend the IDE and create the tools I may need later, as I believe that good developer tools are key to productivity. So I tried to develop some NetBeans IDE plugins, as I was working on tools for the jMaki Ajax framework. I ended up creating a "jMaki widget creator", which is currently discontinued due to time constraints, but I'll get back to it someday!

What are three things you gained from the NetBeans Platform?

  1. As I come from server-side Java EE programming, I am used to the container paradigm that the NetBeans Platform offers to desktop applications. So, I was able to split my application into separate modules, with the NetBeans Platform managing their lifecycle and interacting according to the contracts handled by the NetBeans Platform.
  2. Coding to interfaces is a good practice. From this perspective. the modularity of the NetBeans Platform lets me organize my code into separate API (interface) modules and implementation modules. This allowed me to play with the implementations and swap them without breaking the application's dependent modules.
  3. The NetBeans Platform is all Swing, which I consider to be a great advantage over the competing Eclipse RCP, especially in regard to the wide availability of open sourced Swing component, such as SwingX, which I am using in the application's GUI.

Which APIs have you used? Which ones are your favorites and why?

Lookups in general, as well as the Central Lookup contributed by NetBeans Dream Team member Wade Chandler. This works as DI and communication slots between different loosely coupled modules.

The Wizards API enables the implementation of wizard-based uses cases, like adding a user subscription or acquiring new documentation, witch turned out to be the preferred functionality for end users:

I've also used the ModuleInstall class to bootstrap an embedded Derby database to work as a persistent storage provider:

public class Installer extends ModuleInstall {
...
static {
..
server = new NetworkServerControl(localhost, 1527);
..
}

@Override
public void restored() {
...
server.start(null);
...
}

@Override
public void close() {
...
server.shutdown();
...
}

The storage directory is set by the user with a provided Options window extension saved to an NbPreferences store:

NbPreferences.forModule(DataDirectoryOptionsPanelController.class).put("datadir",
dataDirTextField.getText());

Retrieved later, in the Derby Connection Manager implementation module, which is an implementation module for the Connection Manager API module, with the following:

NbPreferences.forModule(DataDirectoryOptionsPanelController.class).get("datadir",
"");

This application architecture, coupled with JPA access, allows us, if needed, to swap out Derby for, let's say, MySQL.

Here's an example of the application's output:

What could be improved about the NetBeans Platform?

NetBeans is already a great platform for many application scenarios. However, recently, the increasing interest in building enterprise applications on top of the NetBeans Platform showed up on the openide mailing list, as well as in many blogs. These kinds of applications have special needs, such as storage, remote communication with application servers, reporting, integrated security, and access control. The NetBeans Platform has all the bits needed to make it possible to build such applications, it would be nice if those common needs were to be addressed in a dedicated cluster, providing all the building blocks needed to let enterprise developers focus more on application logic rather than on integrating those frameworks over and over again.

Do you have some tips and tricks for a complete newbie, who is getting started with the NetBeans Platform?

I would strongly recommend what is already an open source mantra: simply clone the NetBeans sources, everything you need is already there. You can find similar implementations for what you're trying to do in one of the many modules in the NetBeans sources. Reuse those bits. They are there for that purpose. That's simply the beauty of open source! And don't be shy to contribute back to the large NetBeans family. :-)

Anything else you want to say?

I'd like to thank the NetBeans Team for the great work they have done in providing us with such a powerful and solid foundation for building large modular applications. Also, thanks to the great and helpful community for providing support, help, and tips.

Lastly to managers I'd like to say that open source is a very viable model to follow in these tough economic times. Following it will always pay back, both in the long and short run. And sure, you can also offer commercial consulting services for NetBeans and the other great open source projects too.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}