I am programming data driven applications using asp.net with telerik controls (v2009 q2). I have a class called BLL that contains (almost only) static classes that return different objects that take some id as a parameter. Usually returns a group of objects in the form of lists.
My question is that there are some architectural flaws, always static. I know that people make their Busines Layer and DataAccess level as different projects. What is the advantage of this project? So I can add more functionality or just more neatly.
Thank you in advance
, . , , , . , , . , , , , .
/ . , , -, , .
:
, . , .
, , , . , , intellisense , , , . , ( ) . , , , . .
BLL DAL (.. ) , , , DLL ( , , , ). , .
-, , .
, / . , , BLL , .
, , BLL, , DLL bin, IIS, -
, , static.
, . - Singleton, .
I know that people create their business layer and DataAccess as different projects. What is the advantage of being a project? Therefore, I can add more functionality or just more neat in this way.
Benefits:
namespace BLL { public class tblCity { public tblCity() { // // TODO: Add constructor logic here // } private int iCityId; private string sCityName; public int CityId { get { return iCityId; } set { iCityId = value; } } public string CityName { get { return sCityName; } set { sCityName = value; } } public int InserttblCity() { DBAccess db = new DBAccess(); //db.AddParameter("@iSid", iSid); db.AddParameter("@sCityName", sCityName); return db.ExecuteNonQuery("tblCity_Insert", true); } public DataSet SelectAlltblCity() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("tblCity_SelectAll"); } public DataSet CheckCityName() { DBAccess db = new DBAccess(); db.AddParameter("@sCityName", sCityName); return db.ExecuteDataSet("tblCity_CheckCity"); } public DataSet SelectDistinctCityWithId() { DBAccess db = new DBAccess(); //db.AddParameter("@iCityName", iCityName); return db.ExecuteDataSet("tblCity_getLastId"); } public int UpdatetblCity() { DBAccess db = new DBAccess(); db.AddParameter("@iCityId", iCityId); db.AddParameter("@sCityName", sCityName); return db.ExecuteNonQuery("[tblCity_Update]", true); } public int DeletetbltblCity() { DBAccess db = new DBAccess(); db.AddParameter("@iCityId", iCityId); return db.ExecuteNonQuery("[tblCity_Delete]", true); } public DataSet FindPropertyLocationSubCategory() { DBAccess db = new DBAccess(); db.AddParameter("@iCityId", iCityId); return db.ExecuteDataSet("tblPropertyDetails_FindPropertyLocationSubCategory"); } public DataSet SelectDistinctPLCNAmeWithId() { DBAccess db = new DBAccess(); return db.ExecuteDataSet("tblCity_getLastId"); } } }
Source: https://habr.com/ru/post/1723280/More articles:How do I have a variable in C that can take various types? - cC all type parameters - cGetting "ArrayOf" added to arrays of ActiveRecord objects in the XML view returned by asp.net webservice using Mono - serializationWhat is the proper way to organize python utilities in sets? - pythonCorporate Library Registration Unit Software Configuration - c #How to convert the result of a MySQL function to tinyint (1) - mysqlgcov creates .gcov files in the current directory. Is there any way to change this? - c ++Why does Perl autovivitation work in this case? - perlRuby's viability for cross-platform development with native toolkits? - ruby | fooobar.comHow to create graphics on the fly using cherry - pythonAll Articles