p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   General .NET (http://p2p.wrox.com/forumdisplay.php?f=122)
-   -   bound Vs unbound controls on front ends (http://p2p.wrox.com/showthread.php?t=52177)

Richard_AU January 3rd, 2007 08:42 AM

bound Vs unbound controls on front ends
 
Hi,

My question is a generic question.
I am new to .NET. For now I am learning VB.NET 2005 from wrox books with ample examples of bound controls using ADO.NET.
But, should front-ends have bound controls at all? Say, you have SQL server as a back-end with your database and you want to build a front-end. Will you build your application with bound controls or is it better to build your application with unbound controls (that is, do not bound your controls to base tables at all). Instead have one "I/O" class where all interaction with the back-end is done. That class serves your different data entry forms and your reports.

Which way would you recommend and why?

Thanks,
Richard

Dilip Nagle January 6th, 2007 12:28 AM

Dear Richard,

I am just sharing my varied and long experience with you. I can not claim to be an expert in Visual Studio.

1. When it comes to database Management and especially web based applications developed in ASP.net, I prefer to have a [u]SEPERATE CLASS LIBRARY</u> developed exclusively for data management. These classes provide all the possible data management such as data updation, data retrieval etc.

2. I use store procedures very extensively and do not allow users, direct access to any base tables or crucial views for reasons of security.

3. This approach has given me the flexibility to change from one database vendor to another with minimum of changes, which remain confined only to this data management class library, e.g. if I am using SQL Server 2000 then
Imports system.data.sqlclient

and if I have to use any other database then
Imports system.data.oledbclient.

4. Any modifications in the business logic such as change of a calculation formula etc., are confined to stored procedures only and do not affect my source code. Moreover, I can present the same data in numerous ways, can filer on different keys etc. [u]dynamically</u> threby keeping my front end same while providing necessary result set to front end.

I have found it more convenient [u]NOT TO BIND CONTROLS </u>to the Back end, may it be a complex data grid or drop down lists.

With Regards,

Dilip Nagle




woodyz January 9th, 2007 08:36 PM

Quote:

quote:Originally posted by Richard_AU
 Hi,

My question is a generic question.
I am new to .NET. For now I am learning VB.NET 2005 from wrox books with ample examples of bound controls using ADO.NET.
But, should front-ends have bound controls at all? Say, you have SQL server as a back-end with your database and you want to build a front-end. Will you build your application with bound controls or is it better to build your application with unbound controls (that is, do not bound your controls to base tables at all). Instead have one "I/O" class where all interaction with the back-end is done. That class serves your different data entry forms and your reports.

Which way would you recommend and why?

Thanks,
Richard
In VB6 I never used bound controls, and often spent a lot of time working on projects where bound controls had been used and it was found to be more problems than it was worth.

In .NET I still don't typically use bound controls, but I have worked on projects where they are used. Binding directly to data tables isn't the only way to go. There is another layer to consider - and another set of objects other than DataTables. In .NET you can bind controls to your own custom "business" objects. And although in .NET the DataTables/Sets are disconnected from the database and provide a lot of nice features, using your own business object collections allow for a lot more custom control over the functionality.

Anyway - for some uses the bound controls are useful. If you truly have at least the 3 common layers (presentaion, business, data access) then if you want to bind your controls you will want to learn about binding to custom business objects.

There is a lot of info on this on the internet. A good resource book on this is Rocky Lhotkas business object books. He used to be with Wrox, but the newer books are with Apress.

Woody Z
http://www.learntoprogramnow.com


All times are GMT -4. The time now is 08:58 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.