bll

n-layered architecture - BLL, DAL and interfaces. What is best practice?

耗尽温柔 提交于 2019-12-04 16:33:20
I have a question regarding n-layer architecture. I thought long and hard before asking this question as there's a lot of similar questions here already... however, after literally a day and a half looking at it and reading these other answers I'm still unsure. The variety of seemingly similar terminology and different approaches has me confused. If I had a BLL and a DAL in different class libraries, one way to communicate between the BLL and DAL would be to utilise an interface, kind of like a DTO defined in another separate DLL that was referenced by both BLL and DAL. My domain model

Manual DAL & BLL vs. ORM

落花浮王杯 提交于 2019-12-03 07:54:38
问题 Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database? 1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions that come from this ORM, and we do not have full understanding and control of this "black box". 2) In another project, we decided to write the DAL and BLL

What to return from the DAL to BLL

帅比萌擦擦* 提交于 2019-12-03 06:15:26
问题 I currently have an application which consists of: User Interface (web page) BLL (Manager & Domain Objects) DAL (DataAccess class for each of my Domain Objects). I use the following in the UI to search for a domain object. protect sub Button1_Click() { IBook book = BookManager.GetBook(txtID.Text); } Here is my BLL public class BookManager { public static IBook GetBook(string bookId) { return BookDB.GetBook(bookId); } } public class Book : IBook { private int? _id private string _name; private

Communication between BLL and DAL

核能气质少年 提交于 2019-12-03 04:18:36
Solution setup: DAL (class library) BLL (class library) Common (class library (some common functionality - enums, logging, exceptions,...)) Application1 (Windows Application) Application2 (Windows Application) WebApp (Web application) ... Let's say I have a Customer entity, which is: a table in SQL server a CustomerDataTable in DAL a Customer class in BLL a BLL.Customer class in all the applications What kind of objects should BLL and DAL use for communication - DataTable or List<Customer> (for example)? In first case, BLL logic should transform Customer object to DataTable and send it to DAL.

POCO's, DTO's, DLL's and Anaemic Domain Models

狂风中的少年 提交于 2019-12-03 03:23:30
问题 I was looking at the differences between POCO and DTO (It appears that POCO's are dto's with behaviour (methods?))and came across this article by Martin Fowler on the anaemic domain model. Through lack of understanding, I think I have created one of these anaemic domain models. In one of my applications I have my business domain entities defined in a 'dto' dll. They have a lot of properties with getter's and setter's and not much else. My business logic code (populate, calculate) is in

Manual DAL & BLL vs. ORM

有些话、适合烂在心里 提交于 2019-12-02 21:24:30
Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database? 1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions that come from this ORM, and we do not have full understanding and control of this "black box". 2) In another project, we decided to write the DAL and BLL from scratch. Although this implied writing boring code many, many times, but this approach proved to be

What to return from the DAL to BLL

╄→гoц情女王★ 提交于 2019-12-02 19:37:35
I currently have an application which consists of: User Interface (web page) BLL (Manager & Domain Objects) DAL (DataAccess class for each of my Domain Objects). I use the following in the UI to search for a domain object. protect sub Button1_Click() { IBook book = BookManager.GetBook(txtID.Text); } Here is my BLL public class BookManager { public static IBook GetBook(string bookId) { return BookDB.GetBook(bookId); } } public class Book : IBook { private int? _id private string _name; private string _genre; public string Name { get { return _name; } private set { if (string.IsNullOrEmpty(value

POCO's, DTO's, DLL's and Anaemic Domain Models

爱⌒轻易说出口 提交于 2019-12-02 15:38:42
I was looking at the differences between POCO and DTO (It appears that POCO's are dto's with behaviour (methods?))and came across this article by Martin Fowler on the anaemic domain model. Through lack of understanding, I think I have created one of these anaemic domain models. In one of my applications I have my business domain entities defined in a 'dto' dll. They have a lot of properties with getter's and setter's and not much else. My business logic code (populate, calculate) is in another 'bll' dll, and my data access code is in a 'dal' dll. 'Best practice' I thought. So typically I

Do you allow the Web Tier to access the DAL directly?

梦想与她 提交于 2019-11-30 06:22:20
问题 I'm interested in perceived "best practice", tempered with a little dose of reality here. In a web application, do you allow your web tier to directly access the DAL, or should it go through a BLL first? I'm talking specifically of scenarios where there's no "business logic" really involved -- such as a simple query : "Fetch all customers with surname of 'Atwood'". Scenarios where there's any kind of logic absolutely are gonna go through the BLL, so lets call that moo. While you could

Use BLL functions without reference the DAL in my API

别等时光非礼了梦想. 提交于 2019-11-29 18:37:58
I have 3 project (C#) API, BLL and DAL. The DAL reference the DAL and the API reference the BLL. In my API I need to use all the CRUD functions but I can't use the function from my BLL because VS said that "The type "blabla" is defined in a assembly that is not referenced. You need to add the reference (DAL)" but I don't want to referenced the DAL in API project. Is there a way to do it without use my DAL project ? Amit Joshi In my view, what you are trying to achieve is good way to architect the project. I am also doing same; just small difference that I will explain below. Not referencing