My question is three-layer architecture.
My project is briefly similar to below, however annoying me after I insert a new column into my database, I need to update all fields except BLL. In the presentation layer, I created an OBJ, and also inside DAL plus inside DAL, there is an SQL query. I have to update all these fields manually.
If I do this in the βnormalβ way, I put everyone in the presentation layer and update everything in one place.
Am I applying this 3-layer architecture correctly and what are the benefits of using this layered architecture?
My second question is:
Inside DAL, I collect data through _view. I wonder if I should write another Boboj for each view? I already have a BOBOj class, but it does not contain all the fields.
When inserting data, I have to use my BOboj, however, when I enumerate the data, I use the views, in this case should I create a different BOboj_view class for each view or another? What is the way to alleviate this?
eg; I have 20 views and 40 classes that map to each table on sql server. My views collect tables with different data (this means different objects). Should I create 20 more classes, except 40, which represent the view?
Obj
class BOboj { private int _PId; private string _Name; ....... ....... }
Gave
BOboj_DAL { public bool Add(BOboj obj) { using (SqlConnection con = Connect.connect) { string sql = "insert into Persons (Id,Name, ....... ....... }
BBL
BOboj_BLL { ....... ....... public bool Add(BOboj_DAL obj) { BOboj_DAL bb_dal = new BOboj_DAL(); try { return bb_dal.Ekle(obj); } catch (Exception) { throw; } finally { bb_dal = null; } } ....... ....... }
Presantaon layer
protected void Add(object sender, DirectEventArgs e) { BOboj_BLL bll_= new BOboj_BLL (); BOboj obj_ = new BOboj { Name = Name.Text, .............. ............... }; bll_.Add(obj_ ); }
Thanks.