What is the most idiomatic way to pass a single na...
# plugin-development
r
What is the most idiomatic way to pass a single named object from a domain object container to a task as an input?
p
Use named and a nameddomainobjectprovider as nested, but you would need to annotate the properties of the object as inputs.
If you only need some properties, use named and map.
r
Using a nameddomainobjectprovider was my first attempt, but if I use that for a task input I can't actually set it to anything during task registration since it's a read-only property
p
Ah, if you want to make it user configurable, just use a nested Property<Foo>.
But what exactly do you want to do? Often, but not always, it's the way around, you register a task based on a domain object of your extension.
r
That's what I'm doing for tasks, I just wanted to keep an internal marked reference to those task providers on my DSL object since they're used in a few places in my plugin during configuration. I don't know if there's a preference between keeping provider references to tasks/lazy configurations or just keeping the names and pulling them from the registry everywhere you need them. This specific question was more about objects containing nested properties - I came across a forum answer stating that having to do a property of a mutable object (like a sourceset, configuration, etc) typically meant a code smell