The question you are askin goes to the very heart of why n-tier applications exist in the first place.
Think about what an article actually is in real life. It is a thing with properties such as an author, a body, and abstract, a publish date, and so on. It is also a thing that can have actions performed on it, such as being written, saved, updated, thrown away, and so on.
Now, think about what an article is to your database. It is a table with rows and columns, nothing more.
So, in effect, an article "exists" in two different forms -- as a data-storage conceptual table construct, and as a real-world object.
The idea behind an n-tier application is that it is easier for programmers, being human and all, to deal with real-world objects rather than rowns and columns. So, we create layers in our programs to translate from one form to the other.
Those layers need to have classes that can represent what an "article" means in that layer. In a data access layer, you have an ArticleDetails class that represents the columns of the table and the data within them. And in the business logic layer, you have an Article class that represents the properties of the real world object.
Once these layers are in place, we can build our pages, using the BLL to treat an Article as a real world object. We can evaluate and set its properties, call its methods, and so on, without ever having to think about "rows" and "columns" at all.
Getting back to your real-world question -- do you need to do it this way? Of course not. If you feel comfortable doing so, you are free to flatten the BLL and DAL into a single layer if you like. That way, you wouldn't need an ArticleDetails class. You could just put all of that data access logic right in the same class as the Article's properties and methods if you want.
However, most programmers find it easier and more natural to do it as seperate layers, so that the data access logic is abstracted away, and so we don't have to think about it.
|