Security:

  1. Declare every class , method and variable final by default. Well, there is no need to declare a method final if the class already is final.
  2. Do not use inner or anonymous classes. They are a security risk.
  3. Of course declare everything as private as it can get.
  4. Every SUPPORTER should be handeled as untrusted by default. This means that data received from an untrusted supporter should be erratically checked to prevent modifed antbears from subverting the network.
  5. A SUPPORTER might as well be explicit defined as trusted which would make doublechecks (on this special SUPPORTER) unnecessary.

Networking:

  1. Communication between MASTER and SUPPORTERs should be compressed to save bandwith. At least the larger packages.
  2. Keep communication on the necessary minimum.

Performance:

  1. All data should internally be handled as integer arrays. This way there is no converting necessary because the data arrives as byte arrays and does get sent as byte arrays. No need to use Strings at all.
  2. The JVM is faster in handling integers than bytes. So store incomming bytes as integers.
  3. Use stack variables if possible and adequate. Accessing stack variables is way faster than accessing static or instance variables.
  4. Keep method calls in hot-spots low.
  5. Use propper (string) matching algorithms for searching. Boyer-Moore for instance.
  6. Antbear should use the new Java nio classes.

Architecture:

  1. A network of one MASTER and multiple (this includes zero) SUPPORTERs is possible. Every SUPPORTER directly connects to the MASTER. So antbear can run on its own or as an distributed application.