Archive for the 'ASP.NET Dynamic Data' Category



19
Nov

Dynamic Data: Kickin’ It Old School

There have already been articles written illustrating how to leverage Dynamic Data within an existing web application, but instead of just outlining the steps required to do so, I’d like to give a little contextual explanation as to why you might want to do that, and what benefits may exist.

If you’re developing data-driven web applications with ASP.NET today then you’re already making use of the rich server-control offerings provided (e.g. GridView, ListView, *DataSource), and can attest to the productivity boosts gained (most of the time). What you lack though, when using the existing server-controls, is any notion of data-centricness. Your UI is completely stupid as regards to your data, and requires complete maintenance/upkeep whenever a change is made to your model, no matter how minute it is.

Imagine I’m using a GridView to provide an inline-editing tabular experience to my users. Within the GridView I configure the columns I want to display (or use AutoGenerateColumns), what each column’s header text is, what each column’s sort expression is, and what the primary key is (i.e. DataKeyNames). In addition, since I’m using the control’s inline-editing functionality I have to determine whether I want to allow certain columns to use the default TextBox rendering or provide a custom edit mode by creating a template. Even if I’m fine using the default edit mode provided by a BoundField, I might need to have some validation, which I won’t get out of the box, so I have to create a template. These decisions go on and on…

If you read through every requirement in the above paragraph, you may be thinking that some of that could easily be deduced from our data model (e.g. primary keys, required fields). I would go so far as to say that all of that, and more, should be easily deduced from our data model, and that is exactly the functionality that Dynamic Data provides. Dynamic Data provides the glue between your data model and your UI, making your UI able to automatically reflect model-level changes.

How does Dynamic Data provide that functionality exactly? Remember in the last article I mentioned that Dynamic Data is merely a set of extensions to ASP.NET, which means you don’t have to learn some completely new API, but rather a handful of new tools that work along with what you already know. From the perspective of adding data-centric functionality to an ASP.NET application, what we need in order to solve the problems outlined above, and what Dynamic Data provides us, can be broken down into three categories:

  1. Data-smart server controls
  2. Field templates for re-usable field-level UI
  3. Higher-level abstraction of our data model

Understanding why those three aspects are necessary and how Dynamic Data leverages them will make the goals of Dynamic Data much clearer. In the next article I’ll explain in detail how those three features can enhance the development of data-driven web applications.

17
Nov

Dynamic Data: Come For The Scaffolding, Stay For Everything Else

ASP.NET Dynamic Data has gotten a bad reputation for being nothing more than a new web application type that allows you to point at a database and get a fully generated site, complete with pages for working with the data in your database (CRUD operations). While that perception does hold some water, it is far from being the complete truth.

Then what is Dynamic Data? Well if you ask me…it is simply a set of extensions to ASP.NET that make developing data-centric applications easier. By “data”, I don’t mean database, I mean data of any kind. When those extensions are combined, they can provide you the scaffolding functionality mentioned above, but that is merely a side-effect of the entire suite of tools.

Viewing Dynamic Data as an application type doesn’t really make sense either as it is merely a complement to an existing web application. In its current v1 incarnation it can supplement WebForms, but work is already underway to bring data-centric functionality to ASP.NET MVC. Sure, there are project templates in Visual Studio for Dynamic Data, but instead of viewing them as a custom application type, look at it as a shortcut for a WebForms application that already has the entire Dynamic Data suite of extensions applied to it.

There are three points that I think are key to appreciating Dynamic Data’s applicability:

  1. It can be used within an existing web application
  2. It can work against any type of data, not just relational
  3. Its metadata can come from anywhere, not just attributes on your data model

Once you’ve seen the above three points come to fruition, then you can begin to see Dynamic Data’s true colors. If then, you’re still not into it, then great, hate it for the right reason.

I’m going to put together a couple articles outlining the above three points in detail, as well as some screencasts that will show off some pretty interesting scenarios/implementations for leveraging Dynamic Data.

One final point that is important to notice is that the set of attributes that Dynamic Data leverages are not within the System.Web.DynamicData namespace, but rather the System.ComponentModel.DataAnnotations namespace. Why does that matter? Because it exemplifies the fact that those attributes are a common set of annotations for any type of data-driven application, with Dynamic Data being the first consumer. Who knows what kind of cool implementations will follow…

22
Dec

ASP.NET Dynamic Data Breakdown

You’ve probably heard about the new ASP.NET Dynamic Data feature that is a part of the recently released ASP.NET 3.5 Extensions CTP, but maybe you’ve been scratching your head trying to figure out what exactly it offers you. Well, Scott Hunter, a PM of the Dynamic Data team just published a great breakdown of what exactly Dynamic Data includes in terms of functionality.

The coolest thing that article brings out is that the majority of the functionality offered by Dynamic Data doesn’t even require the use of the automatic scaffolding. What does that mean? It means, you could leverage the pieces of Dynamic Data you want, in a traditional ASP.NET web application, or even a new ASP.NET MVC application. How awesome is that?!




July 2010
S M T W T F S
« Jun    
 123
45678910
11121314151617
18192021222324
25262728293031

Categories