Is CurrencyManager and DataBinding worth it?

J

Johann Blake

I've been playing around trying to bind textbox controls and datagrids
to typed datasets. Up until recently, I never used DataBindings. I
always manually wrote the value into a textbox and stored its value
after the textbox lost focus or whenever someone manually saved the
record. I came to the conclusion after a long time and after many apps
have been developed that there had to be a better way. What I thought
would have been great is simply create a typed dataset, use the IDE to
connect to the fields at design time and voila - instant binding. This
does work fine for very simple situations where there is a clear
parent-child relationship and controls are generally textboxes,
listboxes or even comboboxes. But reality started to sink in when my
dataset started becoming far more complex with many-to-many
relationships, complex relationships and what-have-you. What initially
started out as drag-drop, wizards and
"select-what's-available-in-the-property-window" started to require
coding enhancements such as BindingContext, CurrencyManager, DataViews,
and so on. After a while, I stood back and looked at the mess and began
seriously questioning what the point of it all was. I was trying to
avoid manually coding the databindings, updates, inserts, deletes, etc.
but I began to see almost as much code invested in getting automatic
binding to work. So the question is - it it really worth it? What do I
really gain? Has anyone done application development both ways to make
a comment? Any alternative suggestions?

Thanks
Johann Blake
 
C

Cor Ligthert [MVP]

Johann,

Sorry you get a question back on your question.
After a while, I stood back and looked at the mess and began
seriously questioning what the point of it all was. I was trying to
avoid manually coding the databindings, updates, inserts, deletes, etc.
but I began to see almost as much code invested in getting automatic
binding to work. So the question is - it it really worth it? What do I
really gain?

Can you without databinding get the results withouth code?

I don't believe it.

Adding/updating orderrows to an order from a client and that withouth any
code and with complete concurrency error checking.

However, if you have that, please show us how.

Cor
 
N

Nicholas Paldino [.NET/C# MVP]

Johann,

I can say I've done it the other way, not in .NET, but with other
technologies which aren't half as gracious as .NET is when it comes to data
binding.

I think something you said kind of indicated part of the problem. You
said that your data set was becoming far more complex (with many-to-many and
complex relationships, although I don't know what you mean by "complex
relationships").

If it is becoming more complex, perhaps a design review is in order.
It's not the databinding layer's fault if the underlying data is
uber-complicated.

This isn't saying that something is wrong with what you are doing, and I
will admit the data binding story isn't perfect, but I think it is a lot
better than the alternative. The fact that it is baked into every control
as well is a huge plus.

Something I've found is that while you can't change your back-end data
source, it doesn't mean that you have to use the structure as-is. I find
that changing the structure of the intermediary layer (the data set that
will hold the information) can reap big benefits.

Finally, is there a specific issue that you are having a problem with?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top