· 8 min read

Learning Java/J2EE and best tools for the job

A friend of mine who was recently put in charge of a decent size programming team talked with me about the best way to consolidate multiple development tools and paradigms (such as PowerBuilder, VB, C/C++, etc) into a single set of tools and processes centered around the Java platform. He mentioned their work centers mainly around data-centric web-based applications and wanted to mentor his programmers in best approaches to learning Java and J2EE. It seemed like a simple question but as we began to talk about it I thought back on my own learning curve with Java/J2EE and how I could best help my friend answer his question about training. So, after talking through it with him, I came up with the following basic plan.

If the need is to standardize on J2EE for consolidating the creation of database-driven web-based applications, the following seems like a minimal set of steps:

  1. Learn the essentials of Java. Since I had many years of object-oriented programming experience, I just picked up a copy of Java in a Nutshell and it was perfect. For people will less experience a good reference book might be Head First Java. Once you’ve learned the basics of the language, grab a copy of Java Cookbook and Java Examples in a Nutshell. These last two books are more solution-oriented than education-oriented. Lastly, get an intelligent IDE like JetBrains IDEA. IDEA is a great IDE to learn Java on because it has code analysis and automatic suggestions, interactive compiling and error detection while you’re typing, and full refactoring support. It’s an invaluable aid for those new to Java.

  2. Learn the essentials of J2EE. This one is a bit tougher but I think that if you’re centering development around web applications then starting with Jason Hunter’s Java Servlet Programming and JDBC API Tutorial and Reference are the best bets. Of course, J2EE is much more than just Servlets and databases but for most programmers, that’s going to be their initial foray into J2EE.

  3. Learn the fundamentals of XML by reading XML in a Nutshell or Java & XML: Solutions to Real-World Problems.

  4. Gain better understanding of solid software engineering practices by reading Code Complete, Agile Software Development, Principles, Patterns, and Practices and Test Driven Development.

  5. Become a better architect by absorbing the material presented in The Pragmatic Programmer: From Journeyman to Master and Patterns of Enterprise Application Architecture

  6. Start going through the libraries and open source projects available at Apache’s Jakara Site and start looking at application development frameworks like NEFS.

  7. Review the Learning J2EE page.

If you’re just getting into web development using Java, you may be interested in using the following tools:

  • Java Developers Kit (JDK): First, go and get the latest JDK. Be sure to pick the Java SDK links, not the JRE. The SDK includes the software developers kit which contains compilers and libraries. To stay on the bleeding edge, get the latest beta. To do productive business work, get only the latest stable version.

  • Web Browser: Mozilla Firefox – IE doesn’t include all the features that this browser does, especially for development of web applications.

  • Java IDE: JetBrains IDEA – none of the other open source or commercial IDEs come close to the “intelligence” built-into IDEA. Eclipse and others are nice, but IDEA still reigns supreme.

  • Text Editor: TextPad – when an IDE is overkill for editing text files, TextPad is perfect.

  • Revision Control: CVS – don’t be one of the 60% of projects that are doing manual revision control of source files. Use CVS to manage all your code on Windows, UNIX, MacOS, or Linux servers.

  • Build Management: Don’t use batch files or scripts and instead standardize on Ant. Take a look at Ant automation tools like AntHill, Maven, and CruiseControl. Either way, setup a nightly build process that can build and test your code everyday.

  • Revision Control Client: WinCVS – if you’re not a command-line guru, WinCVS is a great free CVS client. If you want even more features and easy of use but are willing to pay a few bucks, check out SmartCVS. Most modern IDEs already include a CVS client built into the IDE too. JetBrains IDEA 4.0 is already integrated with SmartCVS so you don’t have to do anything extra. You may also want to try CVSWeb, ViewCVS, QueryCVS for accessing your CVS repository using a web browser.

  • Defect Tracking: If you’ve brave with good system admin skills like me, install and use Bugzilla. If you want something easier to use, prettier, and easier to administer, install JIRA.

  • Programmer/Team Communication: You’ll want to install one the dozens different Wiki products available. My suggestion is to get Confluence because it’s easy to install and works well.

  • Unit Testing: You’ll want to be sure that you have fully automated unit tests for all the great code you’re writing (to make sure it’s really as good as you think it is). To keep your code honest, use the JUnit and HttpUnit testing frameworks. JUnit support is already built into most modern IDEs so you have no excuses for no automating your unit tests.

  • Code Coverage: As you’re developing your code and you’re testing it you need to know what percentage of code is not being tested. This is called code coverage – discovering what code you’re covering in your test cases (whether manual or automated). One of the best tools for code coverage is Clover and you should definitely use it or something like it.

  • Servlet Engines: If all you need is web application support without all the bells and whistles provided by a J2EE compliant app server, get Resin. It installs in less than 5 minutes, is rock-solid, and outperforms even the most expensive app servers.

  • Application Servers: If you need full support for the J2EE spec (including EJBs, JMS, etc.) you’ll need to get JBoss, BEA WebLogic, or IBM WebSphere. There are other providers out there, but these three are the kings of the open source and commercial industries (respectively). Don’t go for anything more than a Servlet Engine until your architecture leads you to one. Please don’t make the mistake of thinking your app needs WebLogic before your app is completed. Pick a Servlet engine like Resin and stick with it until you need to grow into something like WebSphere or WebLogic (or even JBoss). Simplicity rules and there’s nothing simple about J2EE Application Servers, even for experienced folks like me.

  • Web Frameworks: While Struts is a viable option, it’s too complex and difficult to use. Grab a copy of the NEFS because it’s much easier to, provides far greater functionality, and includes many more features missing from most other frameworks. Using NEFS you don’t need separate persistence frameworks, separate presentation framework, separate reporting reporting framework, separate portal framework, separate libraries, etc. NEFS includes and fully integrates all the common libraries like Ant, JUnit, HttpUnit, Log4J, Jakarta Commons into a conslidated framework that can be used by neophytes and experienced engineers alike.

  • Web Debugging: Many web-based application problems can only be solved by looking at web-based debuggers that allow viewing HTTP traffic, cookies, and related issues. For this, the Charles Web Debugging tool is very nice.

  • Reporting: If the reporting features in NEFS aren’t sufficient, use JasperReports, JFreeReport, JFreeChart, DataVision, iText, or POI (for creating Excel files). You’ll need to stick with Crystal Reports or something like Actuate if you lots of ad-hoc and sophisticated reporting needs.

  • Virtual Machine Software: To help you run multiple virtual machines (one for development, one for testing, one to run a VPN, etc.) you should use VMware.

  • Scheduling Jobs: If you need timing and job scheduling, take a look at JCronTab (easy to use), Cron, and Quartz (complex but powerful).

  • Database Browsers: Since connecting to databases is such a common task, you’ll want some good tools to connect to databases. Try SQuirrel, TORA, or DBVisualizer. None of these provide database-specific functionality and are limited to the functionality provided by JDBC but they are definitely useful.

  • Documentation: Try and standardize on something like DocBook instead of Microsoft Word. While MS-Word is easier to use, it’s too difficult to get content out of it for sharing across products and libraries. DocBook uses XML for its format and it’s pretty complex for technical writers (and even developers) but you should use the XMLMind XML Editor (XXE) to give you a WYSIWYG view of DocBook. The nice thing about XXE is that anyone can use it (tech writers, developers, etc) and once your information is in DocBook format, it can be converted to PDF, HTML, RTF, etc and made searchable with the click of a button. Also, text-based format (not .doc) is much better for version control and you can configure CVS to rebuild browsable documentation on every check-in. Also, developers can edit docs from within their favorite IDE or text editor. Stick with the XML, not SGML, variant of DocBook.

  • Instant Messaging: All developers should be using one more IM tools like MSN Messenger, AOL Instant Messenger, or Jabber. Quick communiations should be done via IM, not e-mail.

  • Modeling/Design: MagicDraw is a really good choice. There are community and profession/enterprise editions. Another good tool (commercial but cheap) is Enterprise Architect by Sparx Systems in Australia. It can arguably do more than Rational Rose at a fraction of the price. I recommend it for a variety of architecting tasks (not just UML).

    Share:
    Back to Blog