Should DAL classes be publicly available?

Say I have a DAL that several applications use to access the same data. DAL defines its own classes and interfaces for working with this data, but should applications using DAL have to work with these classes or just with interfaces?

Another way; it should be:

List<Product> products = MyDAL.Repository.GetProducts();

or

List<IProduct> products = MyDAL.Repository.GetProducts();

Is it good or bad that each application using DAL will have to create its own data to implement the product?

+3
source share
3 answers

Passing interfaces, not classes, is one (very good) thing. Making your DAL classes private is another (and not necessarily good) thing.

, , , DAL, ? , ?

, -, URL- ? , - ?

0

, .

, DAL, , .

"", . DAL , , , .


, , , .

, "": , .


, , .

0

, GetProducts(), , . IOC.

0

All Articles