Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Learning NetBeans platform: annotations vs layer.xml file

I am in the early stages of learning the NetBeans platform. I note that NetBeans 7.0 makes extensive use of annotations to register classes, specify window modes etc. This is a nice feature, but the learning materials that I've found so far (Rich Client Programming, The Definitive Guide, the tutorials at netbeans.org, and the latest refcard) all make extensive reference to inspecting and editing the layer.xml file. Since I'm still in the lower foothills of the learning curve I'm finding it hard to juggle annotated code with layer file examples.

I'm considering dropping back to a 6.x version of NetBeans while learning, to be in sync with the books and tutorials, at least until I get the core API and basic practices under my belt. I'd appreciate hearing from experienced NetBeans platform users and developers on whether that's sensible, or if it might be better, in the long term, to stick with NetBeans 7 from the beginning.

like image 744
michael Avatar asked Apr 30 '11 08:04

michael


2 Answers

What actually happens behind the scenes with the annotations is that a layer.xml entry is created for you. So you don't need to use the annotations, if the tutorial you are working with deals entirely with layer entries then just use layer entries.

The thinking is that it's a lot easier to understand and find annotations then layer entries. This seems to be whats going to happen with a lot of the layer entries(dynamically created via annotations) going forward. However while they are transitioning it definitely causes confusion!

like image 105
Tim Sparg Avatar answered Oct 03 '22 05:10

Tim Sparg


In fact, there's no references to layer.xml in the latest refcard at all, nor to those tutorials that have been updated.

like image 44
Jason Avatar answered Oct 03 '22 05:10

Jason