Usually, write (first time) and change (modify/update) have potentially
very different executions.
For instance in an SQL database, writefirsttime is not set based and
implemented by an insert (this is dialect dependent), in a codasyl
database the writefirst time needs to take account of all the
mandatory/optional sets a record is member of. Also the database locking
implications are different.
I don't expect to program so stating my preferences on naming is
probably not helpfull, but forward compatability around write/update
methods may imply that two methods are required. We should at least ask
the question why everyone else has two methods?
No, I can't help myself, if saveXXX is a write first time function, then
I'd prefer something a bit more first time about the verb. (insert or
write maybe?)
Allen Gilliland wrote:
David M Johnson wrote:
On Apr 17, 2006, at 4:11 PM, Allen Gilliland wrote:
this isn't part of the backend refactoring proposal because it
doesn't serve any functional purpose, but would anyone be opposed to
me renaming some of the manager methods just to get them all
conformed to a standard convention?
i am thinking we would structure the methods like this ...
addXXX() - add new item. equivalent to hibernate save() or sql insert.
storeXXX() - update existing item. equivalent to hibernate
merge()/update() or sql update.
removeXXX() - remove existing item. equivalent to hibernate
delete() or sql delete.
getXXX() - for any queries.
Big +1 on conforming to standard convention.
I prefer the below names, but I don't feel strongly about it:
saveXXX()
updateXXX()
removeXXX()
getXXX()
retrieveXXX() - get by ID
it sounds like we need to make a decision on whether or not to offer
separate save and update methods, or if we want them combined. i
think the rest is pretty standard.
i actually prefer not to use the retrieveXXX() methods mainly because
i think it's confusing (at least for me). i think it's a little
easier if all the lookup methods start with the same prefix.
-- Allen
- Dave
--
Dave L
<http://www.sun.com> * David Levy *
*Sun Microsystems Ltd.*
55, King William St.,
London EC4R 9ND United Kingdom
Phone +44 (0) 20 7469 9908/x18308
Mobile +44 (0) 7710-360922
Blog http://blogs.sun.com/DaveLevy
Email [EMAIL PROTECTED]
Sun Proprietary & Confidential . This e-mail message is for the sole use
of the intended recipient(s) and may contain confidential and
privilidged information. Any unauthorised review, use, disclosure or
distribution is prohibited. If you are not the intended recepient,
please contact the sender by reply e-mail and destroy all copies of the
original message.