Motivation

Preferences API covers actually the same use cases as current settings infrastructure in NetBeans but there are many deficiences in settings infrastructure in NetBeans that disqualify it:

Missing easy-to-use, instantly ready API

There is actually no API dealing with settings in NetBeans. Developers must make it for themselves by subclassing SystemOption. Then they can choose one of following ways how to get their instance: All these ways are identical but this ambiguity might be confusing especially if the first two ways need dependency on org.openide.util and the last one on org.openide.loaders and org.openide.nodes.

There are additional tasks necessary before one can start to use its subclass of SytemOption:

Typo in settings file or in layer won't be traped during build process. Missing propertyChanges is next typical problem that causes that no changes are made persistent. Implication: error prone by design.
Example:
  1. Preferences prefs = Preferences.userNodeForPackage(getClass());
  2. SimpleOption so = (SimpleOption)SharedClassObject.findObject(SimpleOption.class); public static final class SimpleOption extends SystemOption { public String getName() { return (String)getProperty("name"); } public void setName(String name) { putProperty("name", name, true); } } <?xml version="1.0"?> <!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"> <settings version="1.0"> <module name="org.netbeans.modules.projectui"/> <instanceof class="org.openide.util.SharedClassObject"/> <instanceof class="org.openide.options.SystemOption"/> <instanceof class="org.netbeans.modules.yourproject.SimpleOption"/> <instance class="org.netbeans.modules.yourproject.SimpleOption"/> </settings> <folder name="Services"> <file name="org-netbeans-modules-yourproject-SimpleOption."settings" url="simpleOption.settings"/> </folder>

Excessive complexity

NetBeans settings infrastructure contains aproximately more than 6000 lines which somehow affects maintainance, robustness, performance ...
Involved modules:

Poor performance

Performance of SharedClassObject.findObject is rather poor:

Persistent settings are hard connected to implementation (java serialization)

Java serialization in settings infrastructure complicates: To be fair there exists a way how to avoid java serizalization by writing convertors but not well accepted by developers becuase usage of convertors makes developers to write additional code and registration.

Settings infrastructure gradually negates its original advantages

SystemOption seemed to be convenient because developers got for free: Bringing up convertors plus new Tools/Options infrastructure actually negates original advantages becuase now developers should care about both persistence and UI.