Gustav Brock
Gustav at cactus.dk
Mon Mar 19 04:13:56 CDT 2007
Hi Bruce If the recordings are to track the user behaviour and actions, it should be the DAL. In case "the system" performs actions on its own, the user of those changes would be "System". If the recordings are to track (log) the sequence of changes, then the engine should record the events on its own. This is also the case if DALs can be designed which do not by themselves record the changes. Of course, if all access to the db goes through the DLL, the DLL can handle the recordings. /gustav >>> bbruen at unwired.com.au 19-03-2007 07:42 >>> Dear friends, I just can't seem to get my head around this today, so I'm throwing it open for ideas. I have "inherited" a rather nicely designed 3-tier VB application to do a design review on. The UI is separate from the business object layer as is the data access layer, which includes an MS-Access (XP) option. Putting that another way, there is a (set of) VB apps that use logical business objects that depending on the selected/implemented DAL could be an MS-Access db. The Access db interface is actually implemented as an mdb (mde) which executes stored queries in the real backend. Now, to get down to the dirt.... There are a significant number of tables in the design that have audit attributes, "createdOn", "lastChangedBy", etc. Here's the question! Should the audit fields be set by the business logic layer or by the DAL? (At the moment its a mixed bag, some are set at the BLL and some at the DAL.) By way of example, lets say we have a business object "project" with said audit attibutes. When an update is made to the object, i.e. the current instance of project, say MyProject, the user can at some time update those changes to the database. When s/he does so, the "lastChangedBy" and "lastChangeDate" of the project needs to be updated by the system (to "currentUser" and "now() respectively). So what layer should ("logically", or "architecturally" or "industry standard" or "best practice" or....) be responsible? The BLL or the DAL? Your input would be appreciated - either by considered answer or by survey: [Survey] a) Uh???? (This is the top answer from the VB forums I use) b) The DAL c) The BLL d) What does it matter, the real question is "Does it work?" [/Survey} -- regards Bruce