What’s the difference between `named()` and `getBy...
# gradle
d
What’s the difference between
named()
and
getByName()
? Seems to be interchangeable in usage. This is in
NamedDomainObjectCollection.java
m
Afaik one is lazy and one isn’t. But I always forget which one is which 😅
o
named()
will lazily create the object only when you call
.get()
on the provider,
getByName()
will eagerly create
for many things it doesn't matter, but IMO it doesn't hurt to always use
named()
if possible
d
Gotcha. Thanks @octylFractal @Marc Knaup