Wednesday 21 October 2009

.Net 4 – Enable standard controls for dynamic data

Just seen a new blog post by Scott Hunter today about some of the data enhancements that are coming for .Net 4.0.

The thing that got me excited was at the very bottom of the post where he mentions changes to the way dynamic data can be used.

What you should be able to do is attach dynamic data functionality to a existing control simply by specifying the extension method EnableDynamicData so to add the functionality to a ListView you would just enter:

ListView1.EnableDynamicData(typeofProduct))

This would then provide all the normal dynamic data functionality for that control. Sweet!

Sunday 18 October 2009

Silverlight 3 – dialog

Had one of those thick moments the other day whilst trying to debug a silverlight 3 app.

Used the new SaveFileDialog and the debugger was throwing an error when the dialog attempted to execute the .Open method.

It took me a moment to realise that the problem was that the browser needed to execute the action and that the action being executed by the code represented a security risk.

Once I ran the code to a point after the .Open I could debug to my hearts content.

Unity configuration intellisense

I’m late to the whole IOC party and since in work we use the Enterprise Library as our standard for majority of functionality we may want (like logging, error handling, etc) so Unity is the first stop I’ll make for an IOC.

Now the first thing I expected was to have intellisense to help me with the configuration so you can imagine my surprise when after I referenced the assembly the Enterprise Library configuration tool didn’t offer me ability to configure unity and when I dropped into the web.config to add the config manually there was no intellisense.

So I opened google and had a look around and found Unity Community Contributions which contains a set of extensions to unity one of which is an xsd that provides intellisense (its easiest to get it here as you can down load it by itself outside of the main project).  There is one draw back - you have to configure each project that you want to use it with, you can’t set it up so that its used by default each time.

Once you’ve downloaded it you need to Place the xsd in <drive>:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas.

To be able to use it you need to configure the properties of the config file that you will be putting the unity config in.  To do this open the config file and then go to the properties pane where you will find a property called schemas.

At the end of the schemas property you find the standard … button to open a dialog.

You should find the unity xsd listed and all you have to do is to select use and click ok and then you’ll have intellisense.

Friday 2 October 2009

Web forms a dead end?

Read a blog post by Dino Esposito The dead-end of Web Forms which is where Dino says:

When introduced, Web Forms was a cutting edge solution and it just engineered current best practices. But it was ten years ago. We could argue whether it was the right choice to engineer ASP practices ten years ago. There's not much more you can expert or achieve with Web Forms than you do today. OK, tomorrow, with version 4. This is the dead-end of Web Forms.

Does it mean that no more development will be done on web forms by Microsoft, I doubt it, will there be a lot of new development, that depends.

Web forms is a mature product this means that any changes to it will be incremental amending/enhancing existing functionality to improve how it works rather than jumping forward with innovative new functionality.

If you look at the changes in .Net 4.0 we see some of the new functionality being introduced having already been developed for MVC, for example routing, and I think going forward you will this trend increase with new functionality appearing in MVC first and then being added to web forms afterwards. 

If Microsoft themselves believe that web forms has hit a dead end then why not open it up to the community as open source the same way as MVC, if this happened at worst no changes would be made by the community but at best you may see new innovation and the product revitalised.

 
In the end that there are most likely 10’s of thousands of web sites built using web forms and they are not going to be replaced overnight with MVC. Web forms may be ‘a dead end’ as Dino puts it but a lot of people will be employed to maintain, extend and yes build sites with web forms for a good number of years yet.