views:

168

answers:

6

I am part of a development team that switched to a different project from a pure Java 5 project to a Java 6, J2EE, cloud environment, open source project.

The problem is that we are doing barely OK, since we use a lot of search engines and we are pretty proficient in Java (3 years experience), but it feels like we need to start educating ourselfes in how do to things properly and hopefully being little better programmers and not just patch the first example we find in Google (it has its strengthens, but backfire at us with weird bugs and long debug time).

I was thinking having some sort of a hands-on information-session (2-3 hours) on various important/interesting topics in that technical aspect. It could be any thing from mechanisms in J2EE, threads, managing connections, structure of a request/response etc, to how to search for an open source component.

What is your advice and experience regarding the issues that needs to be covered, that you think are important in the fields above and in programming in general?

+1  A: 

Before getting down to the technicalities, I suggest you integrate some topics from the book The Pragmatic Programmer: From Journeyman to Master into your session. It addresses some of the issues you seem to struggle with.

Alon
and the book has a section about programming through web searches too.
Dan
+2  A: 

Okay, I think you're perhaps doing too much at the same time. So your break for recap what you actually want to do is obviously the right choice.

First of all, think about what you want to do. Your application is not getting better just because of using new fancy technologies. So try to work out what additional technologies you need and elaborate why.

J2EE is a powerful set of technologies. However, it is not very probable that you want to use all of them. If you're only using some subsets, like Servlets or JPA, you could also use that without switching completely to J2EE. You could also consider using lightweight frameworks like Spring.

Of course, there is also a bunch of books available for various interesting areas. Most of all, I'd like to recommend "Effective Java 2nd Ed." and "Java Concurrency in Practice" for detailed basics.

PartlyCloudy
Of course, thanks for that hint.
PartlyCloudy
A: 

Sounds to me, that you need to dig deeper then just to see what's new in Java 6.

David Soroko
A: 

A good practice in general -not only Java 6, not even Java- is GOOD ERROR HANDLING. I think it's one of the better friends of the programmer because it helps to catch error earlier and be confident with your program. It doesn't mean your program will be robust automatically, it only means your program will be honest.

How?

So, if something bad happens try to...

  • know it the sooner the better
  • have stack trace info
  • have general info (local variales and so on), chained exceptions

...and how?

Some things I learned is important (sometimes I've learned it suffering its lack :)

  • use exceptions, don't bother with error codes, exceptions are your friends
  • use chained exceptions throw new Exception("error in client add", originalException))
  • use a logger (not so difficult and not using System.out.println gives good karma)
  • please: DON'T sweep under the carpet!!! (try { xxx } catch (Exception e) { } is NOT error handling). If you don't want to explode at the user face then simply use ONE top-level catch that logs the error and say something relatively nice to the user. Don't bother with catching things you can't resolve at a lower level... (business logic or whatever except you have a good reason to).
  • DON'T expect your methods to do other than their purpose. If a method is suposed to open a file and it couldn't: throw an exception! Their name says what they do, otherwise: explode. Someone at an upper level will catch the exception and know what to do (or use the point before: "catch/log/apologize with the user"

With this in mind I think you can do a good error handling. One that helps to track errors in a proper way. It applies to all envorinments and all languages, so it's general enough.

Good luck!

and congratulations for trying to be better developers!

helios
+1  A: 

J2EE is actually called JavaEE now. Since Java JDK 1.5 was called "Java 5" (like JDK 1.2 was "Java 2") the J2EE name no longer made sense.

Anyway, the best way to get better at something is to do it. And to do it a lot.

You wrote "we need to start educating our self in how do to things properly and hopefully being little better programmers. and not just patch the first example we find in Google". You definitely don't want to just take code that's out there and then try to modify it to do what you want. Read through the documentation carefully and understand enough to write the basics yourself.

Another thing you might want to try is, rather then diving into your whole project, find some small project for all of you to work on and write all your code from scratch. Since this wouldn't be part of your main project you don't have to worry about screwing up too much.

The best way to become a good programmer is to do a lot of programming. There's really no shortcut. When you write a lot of code you'll come across all the weird little issues that people talk about yourself, and you'll understand why the best practices people advocate are actually important, rather then simply taking them as dogma.

You're also probably at the stage where you want to be reading some books about JavaEE to see how it all fits together.

Chad Okere
+1  A: 

I think you need some kind of mentor to analyze the architecture of your project and to teach your team (or at least give hints) about the relevant technologies you're going to use. Otherwise it would take weeks (or should I say months) to learn the right things (I mean you're going to learn about a lot of things just to discover it's not what you need...)

pgras