ASP.NET is a database framework

by Mads Kristensen 19. April 2009 21:34

I have a very clear view on what ASP.NET is and what it isn’t. I’ve never given it much thought until recently when I learned that my view was different from a lot of other ASP.NET developers’. It started at an ASP.NET session at the MVP summit where a presenter asked whether or not people in the audience used the Entity Framework or Linq2Sql. I thought to myself that data access had absolutely nothing to do with ASP.NET but found to my surprise I was the only one finding it a weird question at an ASP.NET session.

Since that session I started talking to people about this and almost everyone told me that a website without some sort of database is a thing of the past and that being an ASP.NET developer involved mastering databases, data access and business logic. I don’t disagree that mastering these disciplines is a huge part of being a .NET developer, but I still refused that it had anything to do with ASP.NET. Yes, I’m that anal.

The field trip

So, I went to Barnes & Noble to find some ASP.NET books. They had 8 different titles and I started to look at the table of contents in all of them. 7 out of the 8 ASP.NET books had minimum one chapter about databases and data access. I looked at the covers again and was reassured that I was indeed skimming ASP.NET books. Not data access books, but ASP.NET books.

What I have learned in the past few months is that databases and data access is part of ASP.NET. Or in other words, ASP.NET is a database presentation framework and NOT a web application framework. Not acceptable!

Here is my view on what ASP.NET is and what it isn’t.

My clear view of ASP.NET

ASP.NET is a framework for creating dynamic websites. It is not a framework for doing data access, business logic or any other thing besides building websites. If your business logic knows it is being used by an ASP.NET project by relying on an HttpContext for instance, then you are doing something wrong. Business logic is an API for what ever (presentation) logic that sits on top of it whether it being ASP.NET, WinForms, WCF or something completely different. This is a rule of the N-tier application architecture.

Smaller web projects often have the business- and data logic classes in the App_Code folder within the web project itself. Those classes are physically part of the web project but logically they are separate from the ASP.NET logic and as such the same 3-tier architecture applies. But it is still not ASP.NET, it is just C# classes that physically lives inside the web project in Visual Studio.

ASP.NET handles everything related to browser/server interactions and nothing more. Calling the database directly from your code-behind or controller action doesn’t make ADO.NET part of the ASP.NET framework. The presence of the BCL in both ASP.NET and the business logic makes it less transparent, but I hope you see my point.

Even though the data- and business logic aspects are both related and important to ASP.NET developers, they are still not ASP.NET.

This is my clear view on the ASP.NET database presentation framework.

* Only $4.95/month ASP.NET & Windows 2008 + IIS 7 Hosting! FREE SQL Included

Tags:

ASP.NET

Comments

4/19/2009 9:55:57 PM #

Jesper Blad Jensen

I really think that most people will agree with you, but that is not the same as its not related. When making a presentation you rely on the technology that is needed to show your Demo. To ask people if they use entity or linq2sql is the same as asking what database we should use, or even if we should use c#,vb.net or even IronPython. We need to keep the friction low.
For books it is a different deal as people supect to learn the technology and the related technologies for 'normal use', and databases is importaint for at least 9 out of 10 interactive websites.

Jesper Blad Jensen Denmark |

4/19/2009 9:57:43 PM #

Mads Kristensen

I agree with you that it's related and important. My point is that no matter how important and related it is, it still isn't ASP.NET

Mads Kristensen Denmark |

4/19/2009 10:56:50 PM #

Kazi Manzur Rashid

Come one Man if you buy a book on ADO.NET/L2S/EF and found chapters on integration with ASP.NET/WinForm/Wpf do you call it a UI book?

Kazi Manzur Rashid United States |

4/19/2009 11:05:40 PM #

Mads Kristensen

Nope, but that wasn't my point. I'm just trying to give a clear cut on what ASP.NET is and what it isn't IMO.

Mads Kristensen Denmark |

4/19/2009 10:58:08 PM #

Lee Dumond

You are, of course, absolutely correct.

I don't really think that the discussion of data access in ASP.NET books means that those books are attempting to position ASP.NET as a database presentation framework. I just think it means they are trying to sell books!

As an author, I can tell you that many publishers, in an attempt to maximize sales, aim books at the "lowest common denominator" -- that means lone developers or members of very small teams. As such, stuffing a book with data access material is a way to add value to potential readers, as lone devs will want/need to know about those kinds of things, and as such are likely to choose a book that contains that "extra" material over one that contains a more narrow focus.

Lee Dumond United States |

4/19/2009 11:06:22 PM #

Simone

Mads, it seems like we are among the few ASP.NET developers that are web developer first.
That's one of the reason I like ASP.NET MVC being totally DB agnostic, and caring deeply about the markup, CSS, and javascript side of things.

Simone Italy |

4/19/2009 11:08:50 PM #

Mads Kristensen

Yeah, I remember we talked about it just after the session.

Mads Kristensen Denmark |

4/19/2009 11:30:50 PM #

Mark S. Rasmussen

How is ASP.NET MVC more database agnostic than classic ASP.NET?

I fully agree on the merits of ASP.NET in regards to markup control, but I really don't see it being any different when it comes to database agnosticism.

Mark S. Rasmussen Denmark |

4/20/2009 6:29:33 PM #

Simone

ASP.NET MVC doesn't have the datagrid, the LinqDataProvider, the SQLDataProvider (or whichever is their name).
ASP.NET does have a lot of "facilities" when it comes to Database access.

Simone Italy |

4/22/2009 2:43:01 PM #

Mark S. Rasmussen

But, using those arguments, would you also say that the .NET BCL framework as a whole is not database agnostic? After all, it does have the SqlConnection?

Just because ASP.NET includes weapons of mass destruction does not mean you automatically have to use them. I can also create a DataGrid'ish control for ASP.NET MVC, but that would still not render ASP.NET MVC any less database agnostic than it was before.

On a conceptual basis, ASP.NET and ASP.NET MVC are both equally database agnostic imho.

Mark S. Rasmussen Denmark |

4/20/2009 12:29:31 AM #

Dominic Pettifer

In the UK when you sit your driving test, the examiner will ask you to check things like the oil and engine coolant level as part of the exam. The oil/coolant levels dont have anything to do with your actual ability to drive a car, so why do they ask this?

Well in the real world if these things aren't checked properly it could be potentially dangerous, and you could damage your car, they are a vital part of running/using a car. Same way with ASP.NET, though database access isn't scrictly part of ASP.NET, in the 'real world' 99.9 times out of 100 you will be accessing some form of database. Thus I feel it's appropriate for an ASP.NET book to cover some form of database access technology, providing it's kept to it's own section, and the reader is taught separation of concerns.

Dominic Pettifer United Kingdom |

4/20/2009 6:39:54 AM #

Syed Tayyab Ali

but database cover more area than anything in asp.net.

Syed Tayyab Ali United States |

4/20/2009 8:49:52 AM #

Janko

Totally agree, Mads. Lack of knowledge about n-tier architecture is probable reason why people don't understand what ASP.NET is and where its part is.

Janko Serbia |

4/20/2009 9:56:55 AM #

pingback

Pingback from arjansworld.com

Arjan`s World    » LINKBLOG for April 20, 2009

arjansworld.com |

4/20/2009 3:34:28 PM #

Paul

Hmmm... Are you saying that ASP.NET = WebForms?

Paul United Kingdom |

4/20/2009 4:25:01 PM #

HoyaBaptiste

Many assume the one ASP.NET book is all you need to master and there is nothing else you'd need to learn. For most basic apps with mere "CRUD" requirements, this might suffice. Then when asked to implement logic that is more than CRUD, these "masters" reach for stored procedures which make the database the chokepoint. Logic that could be applied in code is in the database and take long enough that tables become deadlocked with 2 or more concurrent users.

HoyaBaptiste United States |

4/22/2009 11:47:31 AM #

jack

After reading your 'Category of asp.net developer', I think you idea is quite unusual and strange, but a quite interesting topic!

jack |

5/7/2009 12:01:03 AM #

pingback

Pingback from amrelgarhy.com

Amr ElGarhy » ASP.NET developer categories

amrelgarhy.com |

5/15/2009 3:28:11 PM #

pingback

Pingback from webproasp.com

Web Pro ASP - Active Server Page Development News

webproasp.com |

9/16/2009 6:20:09 PM #

trackback

ASP.NET is a database framework

Thank you for submitting this cool story - Trackback from PimpThisBlog.com

PimpThisBlog.com |

9/21/2009 12:54:49 PM #

pingback

Pingback from random.cgi-biz.com

ASP.NET -   ASP.NET is a database framework - Random Things To Blog

random.cgi-biz.com |

3/15/2010 11:13:25 PM #

pingback

Pingback from devwebpro.com

Using ASP.Net As A Database | WebProASP

devwebpro.com |

Comments are closed

About the slave

Mads Kristensen Mads Kristensen
Web developer at ZYB and founder of BlogEngine.NET. More...

LinkedIn ZYB Facebook Last.fm Twitter View Mads Kristensen's profile on Technorati

The Lounge

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008