Apr 13 2011

Project Development steps (best practices)

Category: English posts,TechnicalIuliana @ 14:18

You’ll find the internet a lot of opinions regarding this matter, but I really want to post here the way I do it, because it might be useful to someone. Being a Java developer, of course I’ll be referring to Java projects, but the steps are common to all projects, regardless of the technology used to develop them.

This is how I do it:

  1. I decide de name of the project. Any project has to have a name that tells a first time user what it does. The name mustn’t be too long or too complicated. The last project I worked on was called Expenses Manager. Well, what do you think? Can you easily infer what it does?
  2. Based on the name of the project I name my packages. Any JBoss package name has jboss in them, any Hibernate package name has hibernate in it and so on. But when the project name is long, like mine was, it is recommended to create a short name composed of the starting letter of the words which compose the project name – in my case em. For example one package of my application was called jj.em.test, jj is my nickname and test is the scope of the classes inside this package, in this case, classes used for testing. Some developers precede package names with com or org. Anyway you decide to name your packages the main purpose is to help a first time developer looking at your code understand the way the project was organized and why.
  3. I Define a logger for my project. Although there are a few logging libraries on the web, my recommendation is to keep things simple and not make your jar bigger than it needs to be or to complicate yourself with classpath  stuff. How do you keep things simple? By using java.util.logging.Logger the logger class provided by the jdk.  If you want an example here is a console simple logger implementation and here is a simple file logger implementation. (I dare you to do better!)  Why would you need a logger? Because you might need to see outputs, values of your variables at a specific step in development without switching to debug and using breakpoints and stuff, because this might slow you down. When you no longer need the logger, you can just turn it off and all the gibberish disappears.
  4. I set up a testing environment or module. Your application will need testing, no matter how small you might consider it to be. It is better to start with a few test classes which you will grow in parallel with your application by adding new test methods. Same as internationalization (point 5), starting to develop the test module when your application is already done might be a pain in the ass.
  5. I Internationalize! You might ask, why is this a key step and why is it really needed? Well, my dear readers, any time you start a project you must think that might be useful not only to you but to people that one day might actually pay for it. Look at the big picture, and internationalize at the beginning, because if you need to do this later, it will be a big pain in your smart ass!
  6. I Use a building tools like Ant or Maven. Ant for small projects, Maven for big ones which have a lot of dependencies. Also, you might want to check out JRebel.

Tags: , , , , , ,

3 Responses to “Project Development steps (best practices)”

  1. b.m says:

    This sounds cool. But if you use maven, the testing environment is already set up. ;)

    Also adding dependencies like apache commons becomes a breeze.

  2. a says:

    “The last project I worked on was called Expenses Manager. Well, what do you think? ”

    Is it expensive?

  3. Iuliana says:

    =)) No, but when I’ll release it, you will be the first to judge. :D

Leave a Reply