Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Design question on 3-tier application
Message
From
10/05/2008 12:01:47
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01315981
Message ID:
01316231
Views:
16
>And I would like to keep updates of each module done via the module Business/DA class.

Hi Dmitry,

You didn't say which language you're using, but here's how we manage it in our .NET apps:

The "parent" Biz class first instantiates it's associated DA class. That DA class starts the transaction. That DA object is then passed to all the "child" Biz classes. The Biz classes are constructed such that if another DA is passed to it in the constructor, it uses that DA object, otherwise, it uses it's own. Likewise the DA classes are constructed such that it will use another DA passed to it, or it's own Command, DbAdpater, etc. if not.

Other than when they're first instantiated, the individual DA classes don't know or care where their Command, DbAdapter, etc. objects came from. When a DA class finishes up what it's doing, it does the usual Commit/RollBack Transaction, or Close the Connection. But in the base DA class from which all are sub-classed, those methods (the CommitTransaction, RollBackTransaction, CloseConnection, etc), all know that if a DA class was passed in, then it won't actually Commit the Transaction, or Roll it back or close the Connection. It all gets passed back through to whatever initially called the DA class/method.

I hope this makes some sense. I can give you some examples if you need some (as time permits ... you may or may not have noticed that I've been absent from here most of this past week ... crunch time at the office!!)

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform