Thanks, Philippe. It works now. Another simple question is whether class T should be inherited from TObject. In my case, A is already inherited from TObject.
No. Your T does not have to inherit from TObject (unless you want it to). And actually neither does your templated class. However inheriting from TObject has it advantages (slightly faster I/O, can use TRef, can use TCollection(s)).