support user type factory
add a trick to read external object as something else, for example, you can convert ArrayCollection to a normal array.
support both class and object as trait factory
implement write_boolean