IF there are plenty of objects existing in memory, for example , MS Word,or Tanks in Red Alert, and most of them have some constant or not mutated attributes, then they can be extracted out into one object which is called flyweight object. Because the dublicated attributes used to appear in so many objects and now they are replaced by a reference to a common flyweight object, the total
memory consumption are reduced. that is why the weight is flied.
for the EJB, if it is stateless session bean, then it is almost too light to use flyweight.
if it is stateful session bean, then it consumes more memory.
But the problem is that the EJB container doesnt preview what kind of attributes user will need for the stateful session bean,
that is to say, it is impossible for EJB container to dynamically check all the deployed stateful beans and then re-organize their code structures. in Theory, it is feasible and it could be a competent sale point to beat Weblogic.
but in real life, EJB container can have sth like hashmap or hashtable is already good for us.