|
Part of the problem is not wanting to proliferate methods on to CompositeType because of AnyType. With that in mind, I did a usage search for casting to ComponentType to analyze what methods would need to be pulled up from ComponentType to CompositeType in order to remove that particular cast. I came up with this list:
-
ComponentType#hasNotNullProperty - this is simply a check for whether any of CompositeType#getPropertyNullability return false. But rather than iterating them all each time, {[ComponentType}} maintains a state flag for this. We could simply do the same for both AnyType and CompositeCustomType.
-
ComponentType#getPropertyIndex - is another convenience method for handling iterating over CompositeType#getPropertyNames and handling "not found" cases. Nice to have that consolidated. AnyType and CompositeCustomType could easily implement this too.
-
ComponentType#instantiate - not sure how to best deal with this for AnyType and CompositeCustomType.
-
ComponentType#getComponentTuplizer - again, not sure how to best deal with this for AnyType and CompositeCustomType.
I went ahead and handle the first 2. The last 2 are not straight forward.
|