On 09/02/2012, at 4:08 PM, [email protected] wrote:
> Wouldn't you just want to add a withBaseDir() to FileOperations so you could
> do project.fileOperations.withBaseDir() instead of having a
> fileOperationsWithBaseDir() method?
The complication is that many objects might implement FileOperations, and a
method called withBaseDir() is kinda ambiguous. For example,
project.withBaseDir().
The other option is to not have so many other domain objects implement
FileOperations, which also has some appeal. This would mean methods like
project.copy() would become project.fileOperations.copy().
That's probably better long term. If we go that direction then the method
should be called withBaseDir().
> file(Object parent, Object name) would be the equivalent to the idea of new
> File(File/String parent, String name). Though I do prefer the idea of adding
> withBaseDir to FileOperations. The main benefit you get from either the
> two-arg file method or withBaseDir is that it allows you to resolve the
> portions separately.
>
> file("${parent}/${name}") will toString the components before going through
> the normal file resolution. If parent happened to be a Closure, this
> wouldn't work. I don't know how frequently that crops up, but it does seem
> more flexible.
Good points.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email