From NetBeans to IntelliJ IDEA, Week 1

I have been using NetBeans for a long time now; Because it is easy to use, easy to understand and explain to others, it has impressive Java EE support, etc. I was working on Java EE projects or projects  involving NetBeans RCP applications with 40-50 modules (1m loc or so) which are considered small applications. I didn’t need to have all modules opened or even when I needed NetBeans handled it pretty well. After joining GlassFish team things started to change a little. GlassFish codebase was new to me and the number of maven modules in GlassFish project was way larger than what I could easily open in NetBeans IDE to be able to navigate around in the code, to find the usages of a method, or to locate all of the implementing classes of a particular interface, etc.

I opened a RFE in NetBeans bug-tracking system but till that RFE got addressed I needed to work and thus I decided to give IntelliJ a try and see how it fares with GlassFish codebase and how easy it will be for me to adopt it as the IDE of choice for my day to day work on GlassFish.

First days impressions (Positive):

  • Can import the entire GlassFish codebase and start using it, no delay in code assisting popup and amazingly no lag after the initial scanning and indexing of the entire codebase.
  • Find usage works almost perfectly, sometimes it says that the class/es are outside of the codebase which might be my fault when importing the project
  • Code completion assistant is fast, when I say fast I mean really fast.
  • I like the fact that I can choose between different available LAFs. [The CDE/Motif LAF is still part of the JRE which denotes the overzealousness of keeping the backward compatibility of the platform?]
  • I like the “Store Current Layout as Default” feature which let me store a layout and use it when the layout get too messed-up.
  • I like the “Autoscroll to source” and “Autoscroll from source” though I’d rather have the action to do it manually when the mentioned options are disabled and I want to locate a class in the project view

First days impression (Not positive ones): Some of what I am missing might be available somewhere in the IDE but I haven’t find them yet….

  • I was not able to switch between different profiles for the module, for example IDE, release, etc. Maybe it is somewhere but I have not found it yet.
  • I think the color schema is hard to read because some of the used colors are low contrast, for example the comments, annotations, are hard to read and required some adjustment to be easier to read.
  • I opened some views that I cannot close, IDETalk, commander, Ant Build… they are all on auto-hide in the vertical bar in the left side without any close button or close action in the context (right click) menu to remove the tab from the side bar. Same goes for view tabs appearing in the bottom bar and left bar. But the good thing is we can rearrange them for better accessibility.
  • I think the local history feature in NetBeans has a better UI and usability than IDEA. In NetBeans the local history is shown in the same tab as the code and not in an extra window same goes for  diff window, etc.
  • The code formatter works better in NetBeans (SHIFT+CTRL+F) compared to IntelliJ (CMD+ALT+L). I like the NetBeans hotkey better as it has something from Formatting in the hotkey. (I tried couple of unindented unglized code snippet in both).
  • The Favorites view does not allow me to add a file system directory to a favorites list which limits the favorites view usage to project members (classes, packages, modules) …

I will post another blog entry after I used IntelliJ for another two weeks to give you a more in depth comparison of how they work for Mavan projects (my comparison will be mostly on Editors and Project/ navigation and refactoring features. Nothing on other languages support, Java EE, JavaFx, application server support, etc.)

NetBeans 6.8 joined the GlassFish v3 in the release feast.

NetBeans 6.8 released coordinated with GlassFish v3 today. NetBeans 6.8 can be considered a fine step ahead of NetBeans because Sun is officially supporting the NetBeans RCP platform as a product from now on.

NetBeans 6.8 features are as follow:

  • Java Enterprise Edition 6 support
  • Web Projects with JavaServer Faces 2.0 (Facelets)
  • JavaFX 1.2.1 support
  • Kenai.com: Connected Developer
  • Full support for PHP 5.3. NetBeans is now a modern IDE for PHP as well as for Java
  • Full Maven support for new projects and importing projects
  • Full support for Ruby and Support for creating Rails 2.3.4 apps
  • Full development cycle is provided for C/C++

More information:

NetBeans ECP, which the IDE is based on, is a first tier application development platform for Java platform. Anyone looking to develop a desktop application should definitly take a look at NetBeans RCP before making a decision about the framework or platform he or she wants to use.

So you want to develop a rich client application on top of NetBeans RCP?

I was involved with development of a RCP application based on NetBeans platform and now I find few minutes to share some of the experience with you.

All standard coding and best practices are applicable here. Use project management systems like Trac or any project management system that you know. Never start a project without a project management system. Use coding standard, unit testing, desing and implementation documents versioning, design discussion sessions and so on.

Prepare all library wrappers and give them proper names. In NetBeans RCP we can not add JAR files to modules and instead JAR files need to be wrapped inside library wrapper modules and then this modules can be included in list of other modules dependencies. Use proper names for library wrappers, for example: jfreechart-wrapper-1.0.13. Never think about having one fat wrapper which contains all required libraries.

Avoid including the same JAR files in more than one wrapper which will be used by one module. instead include all common JAR files in one wrapper and include that wrapper in the dependencies of each wrapper which need it.

Think ahead and decide which modules you want to have and how these modules depends on each other. For example: A module which holds the domain mode and persistence layer (it will be wrapper inside a library wrapper if persistence layer is based on JPA), a module which contains all Web Services access objects (Again, this is a Java SE project wrapped inside a library wrapper), a module for reporting, a module for security implementation, a module to host all utility classes and common resources like icons, graphics, configuration files, etc.

Avoid circular dependencies. You can not access Security module from persistence and then using persistence objects from security module. Best practice is to define some logical layer and ensure that each layer can only access the layer under it and not any other layer.

If acceptable by customer, prepare an update center and push updates using the update center to avoid over working. The update center will help with distributing the software updates which can be new modules, updates, bug fixes etc.
Keep these FAQs close as they will help you along the way:
http://wiki.netbeans.org/NetBeansDeveloperFAQ
http://deadlock.netbeans.org/hudson/job/faqsuck/lastSuccessfulBuild/artifact/other/faqsuck/build/faq.html

Quick NetBeans RCP Tip: How to reuse an already open TopComponent instead of creating a new one.

Well, NetBeans RCP is a flagship product of NetBeans Project which the famous NetBeans IDE is based on it. To reuse an already opened TopComponent in an RCP application we can use a code similar to following listing, Assume that the TopComponent name is ContractorInfoTopComponent and we want to reuse the already opened tab instead of creating a new one.


Set tset = WindowManager.getDefault().getRegistry().getOpened();

            for (TopComponent t : tset) {
                  if (t instanceof ContractorInfoTopComponent) {
                    ContractorInfoTopComponent citc = (ContractorInfoTopComponent) t;
        	    citc.requestActive();
                }
            }

NetBeans RCP is the answer to creating complex and large scale swing applications in a modular way. 

NetBeans 6.7 is here. Grab your copy and explore tens of new features

NetBeans 6.7 is available for download. NetBeans team decided to release more often to provide developers with new features sooner than later. This new release model ensure that as soon as a set of certain features are developed and stabilized can be accessed by developers to develop faster, easier and with more confidence over availability of support for latest standards and frameworks.

NetBeans IDE 6.7 Overview

NetBeans IDE 6.7 is integrated with Project Kenai, a collaborative environment for developers to host open-source projects. With Kenai and the NetBeans IDE, a team of developers is able to create projects, check out, edit, debug, build, discuss, and commit code, all through one easy-to-use interface!

The release also builds on the success of NetBeans 6.5 with native support for Maven; GlassFish, issue tracker and Hudson integrations; and enhancements to Java, PHP, Ruby, Groovy and C/C++. Highlights of the 6.7 release include support for JavaScript 1.7, Ruby Remote Debugging, and integration of the Java ME SDK 3.0.

If you were following NetBeans releases you should know that NetBeans IDE is now available through several mirrors to ensure that users can get the IDE as fast as possible and no release rush will cause the servers to slow down. The first one is updated with NetBeans 6.7 release and the second one is still offering 6.5.1 as the latest release.

 

Netbeans 6.5 is at your door step, take a look at shining new features

NetBeans IDE seen a lot of changes during past three years, the evolutionary changes starts with NetBeans 5 and later on continued to NetBeans 5.5 when Sun Microsystems released more of its code base under the open source license.

The main reason behind the feature rich releases can be seen behind the unifiyng of Sun closed source line of IDEs engineering team with NetBeans engineering teams, and further expanding the team with new engineers and evangelists.

NetBeans 6 goal was improved editor, improved SOA support and improved Java EE support, while NetBeans version 6.5 is mostly targets editor enhancement, web applications and scripting language support. While you can deploy your application to GlassFish version 3 prelude in NetBeans 6.5, NetBeans 7 will be the first IDE with Java EE 6 support including JSF 2.0 and Web Beans

What of what you can expect from NetBeans 6.5 is as follow:

  • Full PHP development support
  • Full RoR development support (Ruby on Rails)
  • Full Groovy and Grails development supports
  • Improved J2ME application development
  • Improved C++ application development (editor, project life cycle, etc)
  • Improved SQL editor with good integration with MySQL
  • Improved Editor, many small changes to make the over all code navigation easier, many changes to make the IDE GUI more accessible
  • RESTful web services, Spring, and Hibernate support
  • Improved profiler with remote profiling support
  • AJAX support by providing debugging, library manager, built-in support for Yahoo UI, WoodStock, jQuery, dojo, scriptaculous, prototype

If you want to see more new features, which are numerous, you can tale a look at its well covered list of features with a lot of screen shots

You are eager to see how these features works? You were looking for an IDE with these broad range of features out of the box? you can wait until 20th of the November or you can try its Release candidate 2 right now, by using RC2 you can check the features and report any bug that you encounter to ensure that the final release is bug free.