BLLs Referencing Each Other

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 05-Sep-2007 18:43:30   

Help me think this through. I've got two different databases (Student and Inventory), and therefore, I've got two DALs and two BLLs. In the business layer for the Student database, I want to move some inventory around. If I make calls from Student.BLL to Inventory.BLL, I've got to reference Inventory.BLL in my Student.BLL. This is fine until I need to do something to student data from inside the Inventory.BLL, because then I've got to reference my Student.BLL from inside of Inventory.BLL and I've created a circular reference for builds.

What's the best approach to this?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 11:52:55   

You could create a project with both databases (sqlserver, oracle) so then generate code for the whole project, targeting both catalogs.

Frans Bouma | Lead developer LLBLGen Pro
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 06-Sep-2007 19:25:02   

They are on different servers. Is it still possible to use a single project?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 13-Sep-2007 11:10:00   

NickD wrote:

They are on different servers. Is it still possible to use a single project?

No that will be impossible with 1 project, as catalogs in the same project are seen as catalogs on the same server, so joins etc. can be performed. You therefore need 2 projects: one for each server. So I'd move the code which controls access to both to an assembly which references both. Otherwise the cyclic references are hard to get rid of.

Frans Bouma | Lead developer LLBLGen Pro