Since code attachments should be loaded together with the adf file (all bundled in a cache-able cad instance), the code attachments should specified inside each adf file, not per-agent.
The alternative would be to allow different code for the same Java function name, which would be counter-intuitive and would disable caching.