Thursday, February 14, 2008

Sw: Craft, Engineering or Science?


Sofware is part Maths, part Engineering and part Craft. Remove any of the parts and you have a mockery, so all the 3 ingredients are essential. If you remove maths: you cannot deal with types, compilers, complexity, algorithms ... If you remove Engineering: you miss teams, planning, standards, quality, time, cost and risk analysis, design ... If you remove craft you are condemned to repeat the same solutions for any problem because the only way to learn to do sw is by doing it (know-how).



Modern curricula try to specialize people in giving more weight to one of the components. When is a person ready to specialize is a personal issue. Some people are great with abstraction and cannot deal with real life details, other people work better alone and are extremely creative, while others are great at communication, dealing with people, coaching and coordinating. But, independent of your strong points, if you cannot deal acceptably in the three areas you will not be a good sw person. Not that you cannot do great things, but extreme specialization is for insects!

Tuesday, February 12, 2008

Using LDAP SDK on OS X with NetBeans

As an example of integrating an external jar for use with NB in java projects ... Probably it is better to stick with what is provided by JNDI, it is much better now, but if you have a project that uses ldapsdk.jar: 

  • Download  ldapsdk_java_20020819.zip from http://www.mozilla.org/directory/javasdk.html
  • Unzip it, there is a buildjsdk.txt that hints about the next steps
  • cd to mozilla/directory/java-sdk
  • execute make -f ldap.mk JAVA_VERSION=1.4 to get .class files (optional)
  • execute make -f ldap.mk basepackage to make the ldapsdk.jar (optional, previous command required: 301968 vs 301913 bytes in the jar I "inherited")
  • execute make -f ldap.mk doc JAVA_VERSION=1.4 (to generate javadoc)
To successfully execute the previous commands you may need to:
edit ldap.mk : add -source 1.4 -target 1.4 to each JAVAC variable definition like:
JAVAC=$(JDKBIN)javac -g -classpath "$(JAVACLASSPATH)" -source 1.4 -target 1.4
---
JAVAC=$(JDKBIN)javac -g -classpath "$(JAVACLASSPATH)"

create some environment vars: export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home
All this mess  is needed because the sdk uses enum as an identifier, and Java 5 uses enum for the typesafe enumeration pattern, as a reserved word. You need to either change the source code or compile for Java 1.4 ... So much for Java's backward compatibility. Still, you may get some deprecation warnings ...
  • Open NB (5.5.1): Tools -> Library Manager
  • Create a new library
  • add ldapjdk.jar to Classpath
  • add ./mozilla/directory/java-sdk to Sources
  • add ./doc to Javadoc
Add to your project the library you just created (and maybe remove the previous jar). You may need to restart Netbeans (to reload the classpath).
Test: 
  • Try MR-> Go to Source
  • Put breakpoints 
  • Use the "." for contextual javadoc, code completion ...


I hope my next NB entry will be about a detailed installation of Scala support in NetBeans (see Caoyuan's fine work)


A Beginning Is A Very Delicate Time

A good prologue is a must ... Before LOTR´s we had Dune´s
Lately, I've found myself trying to post comments to too many blog entries. Comments that will be dispersed around, not much interesting to anybody but me. So I'd rather write my own comments all on the same place. 
Entries are not supposed to be closed ever, so this is not a 'publication' ...