Assess my layering

Posts   
 
    
llblPowa
User
Posts: 41
Joined: 19-Nov-2006
# Posted on: 19-Nov-2006 23:09:56   

Hello Guys, I am having some problems with layering my new application and I am sure that you experts will be able to help me and provide some advice. Below if my current layering (with some functions signature) :

Facade Search(Criteria) Transfer(AccountA, AccountB, Amount) CreateAndTransfer() GetAccount(AccountID) AddNewOperation(AccountID)

Service GetAccount() Create() Transfer() GetAccount(AccountID) Search(Criteria) AddNewOperation(AccountID)

Domain Debit(Account, Amount, Transaction) Credit(Account, Amount, Transaction) AddNewOperation(AccountID)

Manager (Generated by Manager Template) FetchCollection() FetchEntity() Save()

-->The facade is called by my clients (web apps and winform). This is a thin layer that only calls Service layer and orchestrates the service. -->Services can call either the domain or the manager layers. Domain can impact on several entities (tables). Service does not contains BL logic (it uses domain methods for that), but it contains the way to retrieve data (Get, Search...). -->In the current design, Entities can be accessed by all the layers.

I have created the domain layer as the Manager templates are generating all the tables and offers too much entry points. Moreover, these managers offers too much functions.

I didn't want to mix operations on an entity and entity behaviors, this is why I have separated functions like Search or GetAccount(in Service) and debit/Credit/AddNewOperation(in Domain).

I have put a Facade layer to be able to coordinate my service. For example, I can have: Facade.Transfer(AccountA, AccountB, Amount) that will call Service.Transfer() or Facade.CreateAndTransfer(AccountA, AccountB, Amount) that will call Service.Create() and Service.Transfer()

As Facade can call several services or only one services, Transaction are started in the facade (sic!) and each of my services are duplicated : Service.Create() Service.Create(Transaction) Service.Transfer() Service.Transfer(Transaction)

Ok, that is all.

**I am not happy with this design as I think that I have too much layer and because my transaction are started in the service layer.

What you experts think?

Do you see any other way to manage transaction?

Also, may be this is just a naming problem and thus, may be do you have a better name for each of my layer to suggest.**

Hope to read soon from you.

Cheers.

llblPowa :-)

llblPowa
User
Posts: 41
Joined: 19-Nov-2006
# Posted on: 22-Nov-2006 13:14:41   

Nobody interested in? no code angel confused

Hope to read from you soon smile