Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #5991 > unrolled thread

Should onInsert call onUpdate?

Started byVictor Porton <porton@narod.ru>
First post2015-11-27 19:41 +0200
Last post2015-11-27 19:41 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.programming


Contents

  Should onInsert call onUpdate? Victor Porton <porton@narod.ru> - 2015-11-27 19:41 +0200

#5991 — Should onInsert call onUpdate?

FromVictor Porton <porton@narod.ru>
Date2015-11-27 19:41 +0200
SubjectShould onInsert call onUpdate?
Message-ID<n3a4l3$fp7$1@speranza.aioe.org>
I am writing a lightweight ORM for SQL.

I create virtual methods onBeforeInsert, onBeforeUpdate and onAfterInsert, 
onAfterUpdate which are called respectively before or after INSERT or UPDATE 
SQL statements (done by my ORM when I ask it to save an object to the DB).

Should on{Before,After}Update also be called for INSERT queries?

My logical construction is the following: INSERT can be logically equivalent 
to creating a "default" object and then UPDATE it.

Accordingly this thought, when inserting all four virtual method should be 
called.

What do you think on this?

-- 
Victor Porton - http://portonvictor.org

[toc] | [standalone]


Back to top | Article view | comp.programming


csiph-web