Re: What I saw at MS Launch



Trevor de Koekkoek wrote:
The DataSource components in .NET 2.0 are very cool and databinding in .NET 1 was also well beyond what Delphi VCL has had. The datasources allow you to abstract your databinding away without knowing your source. Source can be a database, flat file or object collection.

You can reference a TDataSource.DataSet without knowing what exactly type of TDataSet is attached. You could write a TFlatFileDataSet or TObjectDataSet, connect a TDataSource, and the consumer wouldn't know otherwise.


In regards to .NET and data binding, Eco and Bdp provide a greater level of abstraction. They do a better job of separating a data's source from its consumption.

Microsoft says...
"There are several new data source controls in ASP.NET 2.0, such as the SqlDataSource, ObjectDataSource, XmlDataSource, AccessDataSource, and SiteMapDataSource (shown in Figure 1). They all can be used to retrieve data from their respective types of data sources and can be bound to various data-bound controls."


Correct me if I am wrong here. So you bind a DataSource of a specific type to the controls. See a problem? VCL developers have been down this road. Let's say you bind your controls to SqlDataSource. Great. Now you've written your own object persistence framework, and you want to bind to your objects now. Oops. Now you have to change all references of SqlDataSource to ObjectDataSource and change the control bindings.

To quote Microsoft...
"One of the coolest features of the GridView and the other data-bound controls is that once they are set up, they can be bound to either an ObjectDataSource control or a SqlDataSource control by simply changing a single property."


Yea, that's real cool. Sure, it's a single property, but on how many grids and other UI controls will I have to rebind? Bah. And what about those SqlDataSource components? I have to go replace them.

said, I concur that Delphi did mark the way well with it's concept of zero code UI connections and I'm not one of those who doesn't like Delphi's data-aware paradigm. You have to go to the oodesign group to find that group :)

I agree. See above. I think OO design folks didn't have a problem with data binding in general. The problem was what it was binding to. You can paint yourself into a corner if you are not careful. I always try to take the path of least reference. MyDataSource.DataSet.FieldByName() is better than MyTQuery.FieldByName().
.




Relevant Pages

  • Re: n-layer approach
    ... On Mar 5, 3:15 am, Adlai Maschiach ... Code reuse, you say you write many web sites, I guess that most of them ... I have used the SqlDataSource in each ... These controls are often used in MS presentations: ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Display a record - several questions
    ... ObjectDataSource set up to get the correct record on a select. ... sub controls in the certain tepmlate and modify them. ... How do I display a RadioButtonList and CheckBox value where it is ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: SqlCeResultSet: catching events
    ... Problem is that I don't want implement my business logic at ui controls ... binding automatically began supporting the BL ... automatic data binding and instead handle the Update yourself after the ... To generate a typed resultset, add a new data source to ...
    (microsoft.public.sqlserver.ce)
  • RE: Better way for dropdownlists
    ... We cannot retrieve multiple record sets with it. ... However, if we choose SQLDataSource, it will save us much time on coding. ... We can just drag-drop five SqlDataSource controls into page, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO objects like Connection and Recordset ETC.
    ... > Because data controls controls are inefficient (and often ... They are really just for prototypes. ... 'Data Binding' to a 'control' is at the very heart of OOP. ... >>> Dim rsMySet As Recordset 'declare the recordset object ...
    (microsoft.public.vb.general.discussion)