Hey folks. I'm trying to get a handle on `Extensib...
# plugin-development
k
Hey folks. I'm trying to get a handle on
ExtensiblePolymorphicDomainObjectContainer.registerBinding()
, and the possible ins and outs of making the implementation type a distinct subtype of the public type. Specifically, if I have
Copy code
val container: ExtensiblePolymorphicDomainObjectContainer<T>
container.registerBinding(T::class, U::class)
does it hold that
Copy code
container.named<T>("foo").get() === container.named<U>("foo").get()
I am concerned that accessing objects as a
T
and as a
U
might have certain differences that I need to be aware of.
v
does it hold that
If you look at the code, I'd say sure. Both get the element by name only. Then the provider is casted to the requested type and checked for assignability, throwing an exception with message
"The domain object '%s' (%s) is not a subclass of the given type (%s)."
otherwise.