Brian Coyner

Greenhorn
+ Follow
since Mar 22, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brian Coyner

Originally posted by Junilu Lacar:
Eric/Brian: What, if any, were the recipes that you wished were included but for some reason or another weren't?


There are tons of recipes that we wanted to include but time constraints just do not allow this to happen. The second edition is definitely going to cover continuous integration tools. We are already putting together an extensive list of new recipe ideas and tools to cover. Of course, we continually monitor for new tools to surface, so we'll keep those in mind, too. Feel free to offer any suggestions.
I have been using IDEA for about two years, and their slogan is right on target: "Develop With Pleasure". I think this article says it all:
Intellij IDEA Article
They have an Early Access Program (EAP) that you can sign up for to get sneak previews of the latest and greatest features, and become involved with reporting bugs and submitting new feature requests. Here's the URL:
IDEA EAP
This does require registering.

Originally posted by Ilja Preuss:

An alternative approach would be to use a Factory to instantiate the objects. Use the "real" factory by default and provide a method to set a different Factory.


The first question to ask yourself before implementing the factory pattern is, "Do I need a factory?" Using a factory to help write a test is, in my opinion, not the best solution. It should work, but it might be totally overkill and add more complexity. Of course, you may determine that a factory is exactly what you need, and if so, great! I think decoupling your code into testable modules is a cleaner approach.
The most effective way to get others to write tests is to help them write their tests. When someone asks me for help, I ask them to explain the problem and present a solution using a test. This helps them to starting thinking about why something is failing, how to reproduce the problem, and ultimately fix it. This approach works very well with programmers that have never written a test (or are novice programmers) because they have me, a seasoned programmer, to help them get through it.
I now see programmers who used to fight the urge to write tests encouraging others to write them, too. Once testing is in you, it's hard to get it out.

Originally posted by Jeff Langr:
What level of Java experience is assumed by the book?


Our book has many specialized chapters. For example, if you want to use XDoclet to generate EJB code, then you'll have to be familiar with EJBs. If you want to use Cactus to test web applications, then you'll have to be familiar with Servlets and JSPs. Ant is covered on almost every page of the book, so if you know the elements of an Ant buildfile you are okay.

1. Refactor code


We both use IDEA. It's not free, though. Eclipse is a free Java IDE that has refactoring support. We like IDEA because it's very intuitive and easy to use. I tried using Eclipse about a year ago and deleted it after about thirty minutes because I could not get a simple project created. Of course, Eclipse may be better now.
Intellij IDEA

2. Enforce coding standards


Checkstyle is a very popular code format enforcer.
Checkstyle
Our book contains very focused "recipes" on how to accomplish certain tasks with various tools. For example, do you want to know how to test form parameters using Cactus? Our book has a recipe. Perhaps you want to know how to test event notifications in Swing? Our chapter on Mock Objects shows how.
Some of our chapters delve into why you would want to use a certain tool, and when a tool is overkill.
Our book also shows how to properly setup a robust Ant build environment for each tool. For example, do you want to setup XDoclet to generate EJB-specific files? We show you how. Perhaps you want to setup your Ant buildfile to start and stop Tomcat, deploy and undeploy, and run Cactus tests? We show you how to do this, too.
I have read the "orange" book and it's pretty good. I think the books compliment each other, and should be on every Java programmer's desk.