Geertjan is a DZone Zone Leader and has posted 459 posts at DZone. You can read more from them at their website. View Full User Profile

Tunisian National Order of Pharmacists on the NetBeans Platform

03.26.2009
| 10687 views |
  • submit to reddit
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.

AttachmentSize
fig-1.jpg3.94 KB
fig-2.JPG29.25 KB
fig-3.JPG33.38 KB
fig-4.JPG60.29 KB
fig-5.JPG58.41 KB
fig-6.JPG138.18 KB
Published at DZone with permission of its author, Geertjan Wielenga.

Comments

jeni martin replied on Fri, 2009/06/12 - 6:03am

In a process of learning both JMaki and Netbeans plugin development, I come out to create a simple Netbeans plugin that register a new Netbeans project type "JMaki widget" and both two project templates (an empty widget and a sample widget). Belford High School

Kris Nalby replied on Thu, 2009/07/02 - 1:15am

NetBeans Platform it is very useful tool. I constantly apply it in the workings out. emo love

Jay Nekl replied on Sun, 2010/04/25 - 8:22am in response to: Kris Nalby

Agreed, my developers also make good use of this great tool.

Regards

Mat

Hey, found your site through blueworld. Keep up the good work.

Commonwealth Towers replied on Mon, 2014/04/07 - 9:16pm

Whilst Malaysian professionals reported the lowest salaries, it was those in China who commanded the highest salaries in Asia. Salaries in Singapore declined, with the government’s property market cooling measures being noted as one contributing factor. non-landed residential

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.