# Saturday, 05 December 2009
« Windows IT Pro Hero Award Tribute | Main | Adding cut and paste character count fun... »

Dynamic Data is a new project type in VS 2008.  It uses scaffolding to help code faster.  Over the past month or so I have been playing with DD and wanted to share the resources that have helped me understand and use/customize DD.

Dynamic data on codeplex: Good resource, has lots of samples on doing things beyond the basics. http://aspnet.codeplex.com/Wiki/View.aspx?title=Dynamic%20Data

Some samples include creating your own view using your own select statement.  Also in the samples is how to use Stored Procedures with DD.

Matt Berseth - http://mattberseth.com/blog/dynamic_data/

Has some nice tutorials on going beyond the basics like creating a custom meta provider that allows you to change the default way your columns are named.  For example, have the columns be Product ID instead of ProductID.

Stephen Naughton - http://csharpbits.notaclue.net/

Perhaps the best site I have found for taking DD to the next level.  Many examples of customization.  Stephen is an expert on DD in my opinion.  I used a sample from him to turn off foreign keys from showing at all for the entire application.

Craig Shoemaker also has some great examples and a book for about $10. The book isn't heavily into the underpinnings though but is worth the price for a beginner.  He also has a deep dive example which goes a little more in depth.

http://weblogs.asp.net/craigshoemaker/archive/tags/Dynamic+Data/default.aspx

http://blogs.msdn.com/rickandy/archive/2009/01/08/dynamic-data-faq.aspx - Great links to resources and perhaps my second most visited site while trying to get a handle on DD.

http://www.asp.net/learn/3.5-SP1/ - video's on DD...

http://forums.asp.net/1145.aspx - forums for dynamic data....

Depending on your level of skill with Linq2SQL or Linq2EF you may want to learn more on them as well since DD sits on top of these tools.  Knowing more about these topics and extending them will also add to your arsenal for DD.

For me, I found the basics of DD to be easy to grasp but I quickly realized two things: 

  1. DD could be really great for small tasks like creating administrative pages that allow users to add / edit lookup tables, etc….
  2. Taking DD off road, aka – going beyond the basics will require a much deeper knowledge (duh).

The three items I found that are important to understand in order to take DD off road:

  • Modify / define your own metadata providers.

http://mattberseth.com/blog/2008/08/dynamic%5Fdata%5Fand%5Fcustom%5Fmetada.html - Names all columns with a space between words... Yes, you could use the DisplayName attribute but this is a sample of how to refine the basic scaffolding project.

  • Creating your own attributes.

http://csharpbits.notaclue.net/2009/04/hiding-foreign-key-column-globally-in.html - Sample of creating an attribute to hide the foreign key column for all tables.

http://csharpbits.notaclue.net/2008/10/dynamic-data-hiding-columns-in-selected.html - Sample of another attribute to hide a column but applied at the page level.

  • Create / modify the templates.

You can create your own templates and modify the existing templates to influence the UI experience.

After this, to get DD ready for the real world you can:

Tier it:

http://weblogs.asp.net/craigshoemaker/archive/tags/Dynamic+Data/default.aspx

Mix it with Web forms, with MVC... http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473

Use AJAX and/or JQuery….  These are not DD specific modifications but likely necessary to be real world ready.

Hope this helps you on your journey!

Posted 12.05.2009  #    Comments [0]  |