473,399 Members | 3,302 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,399 software developers and data experts.

Working with objects that are dependent on a database connection.

Hi all.
I'm migrating a small app from vb6 to vb.net. It basically deals with
invoices. This is the first time I do this kind of migration, from an
existing app to a new one, the new app should be as "object oriented" as
practically possible.

I have several objects that are dependent on a database connection, such as
the Invoice, the InvoiceDetail, a Currency object (mostly used to get real
time foreign currency exchange rate, and convert between currencies), etc.

A few questions:

1) What would be the recommended way of dealing with database persistence of
those objects? For example, before persisting a new invoice I should be able
to do some validiy/consistency checks, and then insert the corresponding
database lines within the context of a transaction. This is particularly
important, I need the Invoice and its corresponding InvoiceDetail to be
created correctly, or not at all. Is there a framework that will do that for
me?

2) How to correctly model that dependency of the objects on the database? I
will probably have only one database connection active for the client, and
all the operations regarding database access should use this one. Passing a
database connection as a parameter seems quite cumbersome (for example
invoice.persist(myDatabaseConnection)) so I guess all abjects should inherit
from some kind of super object, a "Session" object or such, so they all can
use the database connection when they need to. Am I right? Is there a better
solution?

3) VB.NET has lots of facilities regarding "connecting" GUI controls
directly to database items. I don't know whether I should use the facilities
it provides, or go on a fully separated layer/oriented architecture, which
is what I'm more accustomed to.

Thanks guys, your help is mostly appreciated.
Jul 21 '05 #1
0 990

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

Similar topics

3
by: viviane lima - * - * - | last post by:
Also idea ? how to use ASP for working .DBF files ? Please help me .. thanks Vivian
17
by: Gabriel Mejía | last post by:
Services or applications using ActiveX Data Objects (ADO) 2.0 or greater may intermittently return empty recordsets on queries that should be returning valid results. At the time the problem...
6
by: charliewest | last post by:
I have developed an application for WM 2003, which frequently transacts with a sql server ce 2.0 database. I have several procedures which utilize the following code: cn = new...
2
by: Frédéric Mayot | last post by:
Hi, In my web application, I need to connect to an SQL Server database. My pages (UI) will use one or more business objects as well as datareaders (I cannot make everything a business object...)...
0
by: Nico Raddatz | last post by:
Hi all. I'm migrating a small app from vb6 to vb.net. It basically deals with invoices. This is the first time I do this kind of migration, from an existing app to a new one, the new app should be...
0
by: NM | last post by:
Hello, I've got a problem inserting binary objects into the postgres database. I have binary objects (e.g. images or smth else) of any size which I want to insert into the database. Funny is it...
7
by: billelev | last post by:
Does anyone know if it is possible to close all objects in a database (tables, forms, queries etc.) using VBA code? I have not been able to find anything online to help me so far... My motivation...
16
by: Wayne | last post by:
I've read that one method of repairing a misbehaving database is to save all database objects as text and then rebuild them from the text files. I've used the following code posted by Lyle...
0
by: satyajit911 | last post by:
Hi, Can anyone please provide me information on how we can check which database objects(views, indexes, etc.) are dependent on a UDF. I want to drop a particular function & recreate a new one....
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.