NetBeans Platform intro Emilian Bold
What's it about ? ● Contains usual desktop application items: – Window management – Menu & tool bar management – User settings – Application autoupdate – Task management with GUI feedback – Modular architecture (usual ?)
Open Source ● Everything Open Source – Supported by SUN (all the main developers are probably payd by SUN) – Passed through rigorous QA ● Respects standards (or improves them)
Ant based ● The build harness is totally ant based. ● One could use it the same from the IDE or from the command line (though harder)
Modular ● There is a Platform-core ● Most of the other facilities are modules build on top of the core – Even the window system ! ● Modules may be enable / disabled at runtime. ● Modules may be added at runtime without application restart. ● Support for update
Modules ● A module is just a JAR ● Initial interaction with the Platform declarative: – Menus / toolbars – Default windows, services etc. – Reason: Mostly to avoid actual class-loading which is expensive.
Dependencies ● Declared in Manifest file ● Can declare dependency on a particular class, not module (handy if working with 3rt party jars that you want to interchange)
layer.xml file ● Contains all the descriptive part – Menu items – Toolbar items – Actions – Services – Windows – User options – Even resources
layer.xml ? ● At runtime the Platform only uses the layer info to present the GUI – Modules are lazy-loaded – If a module is disabled all its gui items will go away
Configuration filesystem ● The layer file is actually a configuration filesystem ● Toolbar is a folder – Files inside are actual menu items ●.instance file handler ● Each module may add / remove files from the filesystem ● The FS is read-write – Store settings in the nb.user folder
System update ● The harness build system generates autoupdate information ● The user just downloads the new module (which is a glorified ZIP; think WAR ;) )
Window system ● Docking windows (like JIDE) ● Draggable floating windows ● Window persistence ● Window groups ALL pure Swing.
META-INF/services ● Service declaration
Lookup ● Poor man's JNDI or registry ● Drives most of the Platform ● Initially started with the Cookie concept
Options API and SPI ● Easy API to offer user options ● GUI – wise similar to the Firefox option window ● No persistence offered so far – Will show up in 6.0 release (ie. 2007) – Use preferences API from standard Java (on windows -> registry)
Tasks and GUI feedback ● RequestProcessor, Mutexes, etc – Written long before java.lang.concurrency API ● Progress API – Display a GUI progress bar – Cancel tasks – Asynchronous