Magic strings of class names in the source tends to create runtime errors.  Better to turn them into compile-time errors.

Instead of

    Class.forName("com.woplox.design.Account");

use

    // if Account class is in the import list
    Class.forName(Account.class.getName());

    // if Account can't be in the import list
    Class.forName(com.woplox.design.Account.class.getName());


blog comments powered by Disqus