March 2007


Top ten things ten years of professional software development has taught me

The list is really fantastic. Here is the résumé:

  1. Object orientation is much harder than you think
  2. The difficult part of software development is communication
    And that’s communication with persons … Work on your soft skills.
  3. Learn to say no
    If you never say no, your yes is worth very little.
  4. If everything is equally important, then nothing is important
  5. Don’t over-think a problem
    I can spend whole days designing things in front of the white board. That doesn’t mean it will be any better, it just means it will be more complicated.
  6. Dive really deep into something, but don’t get hung up
  7. Learn about the other parts of the software development machine
  8. Your colleagues are your best teachers
  9. It all comes down to working software
    Focus on delivering working software, and at the same time prepare to continue delivering software using that code base and you’re on the right path.
  10. Some people are assholes
    Don’t take this too hard. Try to work around them and do what you can to minimize the pain and effort they cause, but don’t blame yourself. As long as you stay honest and do your best, you’ve done your part.

Desktop Java and Desktop Linux: A Match Made in Heaven?
I like Java and I like Linux. I don’t like Windows very much, but I use it because it is beautiful and rapid. Hope that we can create somethings cools in Linux with Java.

Recently, I had this error when developping a JSP page:

All the ReferentielBeanXXX extend the same class ReferentielBeanBase. In my JSP page, I just want to check:

    if ((ref instanceof fr.acmn.simu.ReferentielBeanIntermediation)) {
	if (ref.isSimuPossible()) {
            ...
        }
    }


and I got an error message with this statement and the message is:

    Impossible for fr.acmn.simu.ReferentielBeanMS to be instance of
fr.acmn.simu.ReferentielBeanIntermediation.
    at com.caucho.java.JavaCompiler.executeInt(JavaCompiler.java:504)
    at com.caucho.java.JavaCompiler.compileInt(JavaCompiler.java:436)
    at com.caucho.java.JavaCompiler.compile(JavaCompiler.java:419)
    at com.caucho.jsp.JavaGenerator.compile(JavaGenerator.java:2424)
    at com.caucho.jsp.JspGenerator.generate(JspGenerator.java:273)
    at com.caucho.jsp.JspParser.parse(JspParser.java:236)
    at com.caucho.jsp.JspParser.parse(JspParser.java:142)
    at com.caucho.jsp.JspManager.createPage(JspManager.java:155)
    at com.caucho.jsp.PageManager.getPage(PageManager.java:340)
    at com.caucho.jsp.PageManager.getPage(PageManager.java:195)
    at com.caucho.jsp.QServlet.getPage(QServlet.java:220)
    at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:128)
    at com.caucho.server.http.Invocation.service(Invocation.java:288)
    at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:214)
    at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:99)
    at com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:76)


The method isSimuPossible() is specific of ‘ReferentielBeanIntermediation’, but not of ReferentielBeanBase. It doesn’t work. Even if I use

    if (ref.getClass().getName().equals(
            "fr.acmn.simu.ReferentielBeanIntermediation")) {
	if (ref.isSimuPossible()) {
           ...
        }
    }


the JSP compiler does not accept because isSimuPossible() is not a method of ReferentielBeanBase.

In fact, the only way (?) that I know to make this code work is using Reflection, like that:

if (ref.getClass().getName().equals(
        "fr.acmn.simu.ReferentielBeanIntermediation")) {
    Boolean isSimuDispo =
          (Boolean) ref.getClass().getMethod("isSimuPossible", null)
                              .invoke(ref, new Object[0]);
    if (isSimuDispo.booleanValue()) {
        ....
    }
}