3 ms·
Let's say I have an object representing a file in the file system, and I'm writing a file browser. I give the user the ability to rename the file.
by st3v3r 10y ago
Let's say I have an object representing a file in the file system, and I'm writing a file browser. I give the user the ability to rename the file.
- lacampbell 10y agoI would say that at that point, it ceases to be a simple setter method (or set property). It's not a simple case of mutating some element of a data structure of filenames as strings. There'd be some validation and error handling involved. It's a perfectly valid high level message to send a file object. As an aside, I'd probably make a method called "rename" that does this, as opposed to something like "setName".