I eventually went with a pure explicit engine, i have played (original 2 or 3 versions) with implicit, but after spending a great deal of time with nHibernate, honestly i have come to dislike and distrust implicit engines. I would prefer to say when i want an update, and when i request data, go back to the database to get it. Database developers (Ms, oracle or whoever) have spent more time than i ever could in optimising the query engines, so why on earth do i think i can do better? answer i can't, additionally if the engine decides when and what to write to the db as it feels like it there is risk it will get it wrong, and whats the point of persistance with that kind of risk.
Now i have a small amount of implicity in that it supports cascade (too useful to ignor) but i have restricted it a little, firstly if saving (insert or update) it will never delete, (otehrwise you have to track what queries the objects relate to etc) and it will check the record in the database if it needs to. Delete requests also cascade, and do delete, but only dependancies (i.e. if foreign keys to objects your deleting and fk column is not nullable the record is deleted). Finally at the point of calling write requests i have a cascade tree you can define, so you can specify exactly how deep to cascade if at all.
So why post about it now? well although i have been very happy with it, and my query engine is ok, i think it could be better, starting playing with a fluent Linq Expression qurery engine, my initial findins suggest i should be able to parse the expression
No comments:
Post a Comment