Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net, C# Interface between Business Logic and DAL

I'm working on a small application from scratch and using it to try to teach myself architecture and design concepts. It's a .NET 3.5, WPF application, and I'm using Sql Compact Edition as my data store.

I'm working on the business logic layer, and have just now begun to write the DAL. I'm just using SqlCeComamnds to send over simple queries and SqlCeResultSet to get at the results. I'm starting to design my Insert and Update methods, and here's the issue - I don't know the best way to get the necessary data from the BLL into the DAL. Do I pass in a generic collection? Do I have a massive parameter list with all the data for the database? Do I simply pass in the actual business object (thus tying my DAL to the conrete stuff in the BLL?).

I thought about using interfaces - simply passing IBusinessObjectA into the DAL, which provides the simplicity I'm looking for without tying me TOO tightly to current implementations. What do you guys think?

like image 330
Joel Avatar asked Apr 24 '10 16:04

Joel


1 Answers

I don't think there is a simple answer to your questions because there are many options depending on the circumstances. I have found it helpful to read the two books below to help me understand the problems you describe better.

  • MS .NET: Architecting Applications for the Enterprise (Esposito, Saltarello)
  • MS Application Architecture Guide, 2nd edition.

The second book is available online. Look here.

like image 125
Captain Sensible Avatar answered Sep 20 '22 01:09

Captain Sensible