views:

150

answers:

1

Hi.

I've been doing some Web-Projects lately that rely on heavy Data-Binding and have been quite happy with the results. Databinding Webforms works mostly the way I need it and I spared myself tons of code.

One thing that still feels weird is that I have application logic and database logic mixed throughout the application. Datasources query directly to the database..

Also, there is no way (I could think of) that would enable me to unit-test this system. By having the DA logic everywhere I can't really momck out database calls and provide fake data. (Although I am still learning how to do that on normal projects as well).

So, how was this meant to work initially? How do I use databinding without sacrificing structure and testability?

+2  A: 

It's very much possible!

Here's an article about it. (focuses on winforms however)

A common pitfall.

This however focuses on winforms, webforms is another story, and it's difficult to test properly.

If you like unit testing, why not have a look at asp.net mvc

kitsune
Thanks! I'll look into those articles
Tigraine