No more mandatory component binding in Visual Web
By winston on Jan 14, 2008
Netbeans Visual Web Designer (NB 6.0 and before) mandates that each JSF component tag in the JSP must have a binding attribute which is bound to a property in the backing page bean via Expression Language binding. This ends up generation of getter and setters for each of the component in the page bean. Even though, this is convenient to set properties directly to the JSF component used in the page, this is very annoying because 95% of the components declared in the page Java source are not used and unnecessarily bloats the backing page bean.
For Netbeans 6.1 release this is going to change. Following changes have been implemented already and available in the Netbeans 6.1 nightly builds.
- Newly created pages and page fragments will not have any binding attribute.
- The generated Java source will not contain tons of getter and setters for corresponding properties.
- The binding attribute in the JSP and corresponding property in the Java source will not be generated when a component is dropped on to the designer.
- Users will have the option to add component binding using "Add binding attribute" context menu item of the component in the outline or designer.
- Users will also have the option to remove component the binding using "Remove binding attribute" context menu item.
Here are some test results after the implementation
- Create a project
- In the page drop a table and copy and duplicate it to 20 tables
- Copy the page and duplicate it to 128 pages.
- Results With binding attribute for each component
- Extremely slow to copy and create all the pages (more than 20 minutes)
- Memory in the memory meter reached 512 MB and OME after copying about 95 pages
- Copy all 128 pages after restarting IDE.
- Final project size 10.2 MB
- Restart IDE and Open project and 10 pages (switch to Java) - Memory 120/190 MB
- Result With out binding for each component
- Reasonably faster to copy and create all the 128 pages (about 5-7 minutes)
- Final Memory in the memory meter (after GC) 165/340 MB
- Final project size 1.9 MB
- Restart IDE and Open project and 10 pages (switch to Java) - Memory 75/140 MB