This message was deleted.
# plugin-development
s
This message was deleted.
v
If it is defined exactly like you showed,
named
,
newInstance
couldn't construct it. The differences are also layed out in the JavaDoc of those two methods. Things created with
named
for example are not decorated and not extensible. For using
newInstance
you could for example change the signature to
Copy code
abstract class MyNamedType @Inject constructor() : Named
then both methods can construct such objects.
o
I think the Javadoc does a good job of explaining the difference between the two methods, mostly that
named
has extra validation and also states
Copy code
Objects created using this method are not decorated or extensible.
whereas
newInstance
states
Copy code
Objects created using this method are decorated and extensible