Hmm, that's interesting point you have. Using only one obviously makes sense. Now, when I see this my thinking is... Loading it three times - I suppose this is because you are actually in SE and with flat classpath. If you were in EE then not all resource loaders would be able to load your implementation, hence you need one backed up by CL which loaded Weld itself and another which is bound to deployment. Third one with custom CL as parameter is probably to enforce some EE restrictions on visibility, as in for stuff shoveled on EAR/lib perhaps? This would totally deserve some testing to see why the choice was made. Nevertheless, I don't really see much harm in multiple initialization so long as only one instance is used over and over again. |