[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

Should onInsert call onUpdate?

Victor Porton

11/27/2015 5:42:00 PM

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://porton...