The simple data editing web application I'll walkthrough
building in this tutorial is a basic data entry/manipulation front-end for
products within a database:
Figure 1
The application will support the following end-user
features:
Allow users to filter the products by category
Allow users to sort the product listing by clicking on a
column header (Name, Price, Units In Stock, etc)
Allow users to skip/page over multiple product listings (10
products per page)
Allow users to edit and update any of the product details
in-line on the page
Allow users to delete products from the list
The web application will be implemented with a clean
object-oriented data model built using the LINQ to SQL ORM.
All of the business rules and business validation logic will
be implemented in our data model tier - and not within the UI tier or in any of
the UI pages. This will ensure that: 1) a consistent set of business
rules are used everywhere within the application, 2) we write less code and
don't repeat ourselves, and 3) we can easily modify/adapt our business rules at
a later date and not have to update them in dozens of different places across
our application.
We will also take advantage of the built-in paging/sorting support within LINQ to SQL to ensure that features like the product listing paging/sorting are
performed not in the middle-tier, but rather in the database (meaning only 10
products are retrieved from the database at any given time - we are not
retrieving thousands of rows and doing the sorting/paging within the
web-server).