Hi dircums,
Maybe my concept of layer is not the same as the correct ones. Business Logic layer, to me, is not a flat layer on top persistence logic and drive it. What I found that works for me is treat buisness logic as a subsystem that rely on nobody else. To me, business logic layer is
entity class with all possible logic in them.
My service layer, invoked by function calls from UI layer, drives all actions in the system. For example:
Code:
class AccountService
{
....
public void UpdateBillingContact(int accountId, string name, string address)
{
//Service layer get hold of business layer by call persistence layer
Account account = _da.GetAccount(accountId);
//Apply business logic. [b]Here is the trick.[/b] Lets say that a business rule says
//if an account's contact is updated and if the account was closed for solicitation
//we will turn the account on, we will put such logic in the Contact class instead of the AccountService class.
account.Contact.Name = name;
account.Contact.Address = address;
//_da.CurrentSession.Save(account) in a transaction
}
Hope this helps
Hongze[/code]