Moving back end rules to the middle tier


Traditionally I have been putting a lot of the admin business logic (eg auditing, recent changes logs) in the back end, but I’m wondering if I should be moving it to the middle tier.


Let me give you a simple example. In SQL I log the last change to a record in a field using an update trigger that checks SUSER_SNAME(). Previously (read client-server projects) this was fine. But since most projects these days use a COM+ service running the middle tier we are running into problems. Basically the COM+ service on the server has its own domain account, and when SQL checks SUSER_SNAME() it gets the COM+ account instead of the account of the app calling the COM+ service. Initially I thought this was a COM+ setting (I’m using Impersonation) but I haven’t found a solution so far.


I raised this at the VFP User Group last night and whilst we coudn’t find a solution, it was commented that many vendors are moving these kinds of busines rules to the middle tier. There seems to be a tendency to leave the back end simple and clean. It also has the advantage of easily moving between back end servers (which I don’t care about because I am targeting SQL Server anyway).


But it has got me thinking. Maybe I should be putting the effort into the middle tier more so than the back end.



Add comment