  public static SmartObject getObject(String classname, int id)
          throws SmartObjectException {
    try {
      SmartObject so;
      Class theClass = Class.forName(classname);
      if (!(isSubclass(SmartObject.class, theClass)))
        throw new SmartObjectException("Invalid class. Class " + theClass
              + " does not implement com.neo.smartobjects.SmartObject.");
      so = getCachedObject(theClass, id);
      if (so != null) return so;
      // else implicite
      so = newObject(theClass);
      so.setID(id);
      load(so);
      cacheObject(theClass, so);
      return so;
    }
    catch (SmartObjectException soe) {
      throw soe;
    }
    catch (ClassNotFoundException cnfe) {
      throw new SmartObjectException("Exception occurred getting instance of "
            + classname + " with object id: " + id + ".", cnfe);
    }
  }
