design patterns - Where to put the logic for delete queries -


i have seperated model logic "entity", "mapper" , "service". started of putting database delete queries in mapper, more think it, feels service.

i'm unsure though, mayby there other layer don't know of make more sense.

precisely place logic physical changes database depends entirely on particulars of design. if have update , insert statements in "mapper", having delete entirely appropriate. conversely, if they're in service, having them there entirely appropriate.

what's important software makes sense, not adheres else's stated model.

(although, fwiw, expect "entity" classes unaware of physical database, "mapper" classes translate db result sets , entity classes, , "service" classes contain actual db code, select , update insert , delete.)


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -