Why should I use an N-Tier Approach When using an SqlDatasource is ALOT EASIER ?
Posted
by The_AlienCoder
on Stack Overflow
See other posts from Stack Overflow
or by The_AlienCoder
Published on 2010-03-26T12:41:34Z
Indexed on
2010/03/26
12:53 UTC
Read the original article
Hit count: 254
When it comes to web development I have always tried to work SMART not HARD. So for along time My Aproach to interacting with databases in my AspNet projects has been this :
1) Create my stored procedures
2) Drag an SQLDatasource control on my aspx page
3) Bind a DataList Control to my SQLDatasource
4) Insert, Update & Delete by using my Datalist or programmatically using built in SQLDatasource methods e.g
MySqlDataSource.InsertParameters["author"].DefaultValue = TextBox1.Text;
MySqlDataSource.Insert();
Recently however I got a relatively easy web project. So I decided to employ a 3-tier Model...But I got exhausted halfway and just didnt seem worth it ! It seemed like I was working too HARD for a project that could have been easily accomplished by a couple of SqlDataSource Controls.
So Why Is the N-Tier Model better than my Approach? Has it anything to do with performance? What are the advantages of the ObjectDataSource control over the SqlDataSource Control?
© Stack Overflow or respective owner