473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Database programming

I am coming from other programming tools field, and new to VB .NET. Just
wondering what is the common approaching in database programming in VB .NET?

1) Are you guru always using the data aware controls to bound the database ?
OR
2) Create separate data object/layer to access backend database and link to
the front end ?
ie.
front <--> business <--> database <--> backend
end object layer database
Nov 20 '05 #1
3 1574
There are different strategies for accessing data, but by and large, pulling
over the data you need and using a BindingManager/Context is a pretty
standard way of doing things.

1) Yes
2) Yes,
they are not mutually exclusive. All you need to bind is a
DataSet/DataTable (in ASP.NEt you can even bind a Grid to a dataReader).
How you get that DataSet is up to you. You can do it from the UI, you can
do it from your business objects, you can skip business objects altogether
(not recommended), you can have any layer you want query a web service
directly....which in turn can query the database.

You may want to pick up David Sceppa's ADO.NET Core Reference or Bill
Vaughn's ADO ADO.NET Best Practices...they both do a superb job of
addressing thesee issues. Also, Rhokford Lhotka has a Business Objects book
that has a much different, but very cool approach to doing business objects.

HTH,

Bill
"Alan" <NO**************@yahoo.com.au> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
I am coming from other programming tools field, and new to VB .NET. Just
wondering what is the common approaching in database programming in VB ..NET?
1) Are you guru always using the data aware controls to bound the database ? OR
2) Create separate data object/layer to access backend database and link to the front end ?
ie.
front <--> business <--> database <--> backend
end object layer database

Nov 20 '05 #2

"Alan" <NO**************@yahoo.com.au> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
I am coming from other programming tools field, and new to VB .NET. Just
wondering what is the common approaching in database programming in VB ..NET?
1) Are you guru always using the data aware controls to bound the database ? OR
2) Create separate data object/layer to access backend database and link to the front end ?
ie.
front <--> business <--> database <--> backend
end object layer database


Certianly different people do it different ways. But I would say that there
is an emerging practice of using "bindable" business objects. ADO.NET makes
this very easy with it's disconnected and stongly typed datasets. Although
it's also possible to implement the interfaces that support databinding on
custom business objects.

The idea is that 1) and 2) are no longer the only choices. You can mix them
for a best-of-both-worlds approach. On the one hand a DataSet or DataView
does not have to be bound directly to your database. They are just
middleware data storage objects. And on the other the front end controls
can be bound to objects other than the intrinsic ADO.NET data storage and
retrevial objects. Custom objects can be made bindable too.

Here's where it gets more controversial. One thing I look for is ways to
add simplicity to applications, and I prefer a pay-as-you-go approach for
simple applications. It's just too hard to see into the future, and
therefore too easy to over-engineer a solution. Directly binding
applications to the database sure is simple. I think that for a simple
application you can do this "guiltlessly" since you can later interpose a
business object layer without too much disruption. Just have the new
business objects output the bindable objects that the UI expects.

David
Nov 20 '05 #3
I used to bind the dataaware controls in UI with the backend database with
dataset and datasource.

After reading messages from newsgroup about the framework/architecture, the
approach is using a business object. eg. customer business object,
encapsulte the attributes such as customer name, phone..etc, fetch the
values from the UI and pass itself into the database layer
(customed/dedicated database object for the backend database type eg.
oracle, ms sql server), the database layer execute the sql statement by code
or other database object in the tools.

So the database layer knows the business object, for example, it has a
method AddCustomer(CustomerObject), this method extract the attributes of
the CustomerObject and pass to the data binder or execute SQL : Insert
into... valuse (...).

As the same for FetchCustomer(CustomerObject), this method extract the
customer id from CustomerObject and execute the SQL like Select * from...
where id=... . Then by assigning the attributes back to the CustomerObject,
the UI can read back the attributes of CustomerObject.
I am coming from other programming tools field, and new to VB .NET. Just
wondering what is the common approaching in database programming in VB .NET?

1) Are you guru always using the data aware controls to bound the

database ?
OR
2) Create separate data object/layer to access backend database and link to
the front end ?
ie.
front <--> business <--> database <--> backend
end object layer database


Certianly different people do it different ways. But I would say that

there is an emerging practice of using "bindable" business objects. ADO.NET makes this very easy with it's disconnected and stongly typed datasets. Although it's also possible to implement the interfaces that support databinding on
custom business objects.

The idea is that 1) and 2) are no longer the only choices. You can mix them for a best-of-both-worlds approach. On the one hand a DataSet or DataView
does not have to be bound directly to your database. They are just
middleware data storage objects. And on the other the front end controls
can be bound to objects other than the intrinsic ADO.NET data storage and
retrevial objects. Custom objects can be made bindable too.

Here's where it gets more controversial. One thing I look for is ways to
add simplicity to applications, and I prefer a pay-as-you-go approach for
simple applications. It's just too hard to see into the future, and
therefore too easy to over-engineer a solution. Directly binding
applications to the database sure is simple. I think that for a simple
application you can do this "guiltlessly" since you can later interpose a
business object layer without too much disruption. Just have the new
business objects output the bindable objects that the UI expects.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: A Cate | last post by:
I am new to PHP. I am trying to develop a web site on a development machine that needs to access data in a mysql database. I have mysql running on my development machine with a copy of the...
0
by: John Davis | last post by:
I always heard the term "data/database driven programming" model in ASP database, SQL programming, and web programming circles. But I don't quite sure what does it mean? Does it mean the web...
2
by: hplloyd | last post by:
I am fairly new to VB.NET programming but have built many database applications in Access SQL Server etc. I need to find a good book or other reference material that will help me take my OO...
6
by: Randy Yates | last post by:
Hi Folks, I'm looking for something that is completely independent of the MSVC++ Dev Studio environment, something that will compile and run under win32 using the mingw distribution. A class...
3
by: jaYPee | last post by:
i am searching a lot of resources in the net that discusses about database programming. i'm still searching on it and would like to received any links that discusses about database programming in...
1
by: Dave | last post by:
Hi, I work on a small team that currently uses an access 97 database for managing peoples time. The database front end is heavily implemented in VBA and is secured with user level security,...
8
by: Maxi | last post by:
Hello, i'm sorry my bad english :( I have CR9 Webservice, how to change databadse name and User_name into Webservice method? (not Viewer Control) Tks!! -- --------------------------
2
by: webcm123 | last post by:
People say that structural programming isn't good for database connection. I code fast-running structural oriented CMS and I don't know what I should do. I use mysql connection using mysql_*. I...
4
by: triton96 | last post by:
I want to get in to programming but would like your input on a couple of things: I would like to write some basic applications that would for example create a payroll check or create a billing for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.