If we have lots of constraint in this my_trans class and each test needs one of them. How to handle it ? We have to create lots of child class which extends my_trans , just like you mentioned ?
You could use constraint_mode as a Task to solve your query
// **In Each Test after creation of my_trans but before randomizing it**
my_trans_object.constraint_mode(0) ; // Used as a Task Will disable all Constraints
my_trans_object.AA.constraint_mode(1) ; // Used as a Task Will enable Only Constraint AA