473,698 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrapping DAO, for better or worse

I have a very ugly problem and I need some sincere guidance.

My legacy VB6 application depends heavily on DAO, especially as it
relates to custom properties on database objects. These custom
properties are, as I understand it, not avabilable with SQL Server,
which we need to migrate to in the not too distant future.

My boss, the owner of the company, requires that we provide for a
transition plan that minimizes (he really wants none) code changes to
the existing app (which is in use by over 8000 clients). It is also
required that we provide 100% backward compatibility with all of the
existing installed base, so we will never be able to abandon support for
Jet DBs. (Yes, never is a long time, but he still supports his DOS
product of 18 years ago!)

His desired solution is that we create a set of VB.Net interface classes
that presents a DAO like interface to the existing codebase. Then, we
implement two worker classes in VB.Net, one that uses DAO via Interop,
and then a few months from now, implement an ADO.Net worker class for
SQL Server that mimics the custom properties of Jet (this part is rather
straight forward, as we can do this using special tables.)

As I am exploring the topic, it seems that I'm going to have to make my
own collection classes (for the DAO recordset object, for example) and
pass those back to the app, essentially caching the DAO data. Yuck. I
can see memory usage and performance going right to hell, not to mention
the unintended consequences of failing to correctly implement some
aspect of DAO.

If I had my druthers I'd start over with a clean slate and rearchitect
this app to give it some reasonable object oriented structure and take
advantage of all that .Net has to offer - that just ain't gonna happen.

Are there any _sensible_ approaches to solving this problem?

Sean
Nov 21 '05 #1
18 2045
Uggh haven't messed with DAO in a while. If you want to store custom
properties for your database objects, how about storing them in a table in
your database? You can wrap the SqlClient functionality in classes that
present the customer properties and should hide the changes from the
programmers/users pretty well. As for 100% backward compatibility, ugghh...
I would probably just provide an upgrade tool to get users of the old
product into the new century... After all, MSDE is free...

"Sean Kirkpatrick" <na**********@c ommunity.nospam > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I have a very ugly problem and I need some sincere guidance.

My legacy VB6 application depends heavily on DAO, especially as it relates
to custom properties on database objects. These custom properties are, as
I understand it, not avabilable with SQL Server, which we need to migrate
to in the not too distant future.

My boss, the owner of the company, requires that we provide for a
transition plan that minimizes (he really wants none) code changes to the
existing app (which is in use by over 8000 clients). It is also required
that we provide 100% backward compatibility with all of the existing
installed base, so we will never be able to abandon support for Jet DBs.
(Yes, never is a long time, but he still supports his DOS product of 18
years ago!)

His desired solution is that we create a set of VB.Net interface classes
that presents a DAO like interface to the existing codebase. Then, we
implement two worker classes in VB.Net, one that uses DAO via Interop, and
then a few months from now, implement an ADO.Net worker class for SQL
Server that mimics the custom properties of Jet (this part is rather
straight forward, as we can do this using special tables.)

As I am exploring the topic, it seems that I'm going to have to make my
own collection classes (for the DAO recordset object, for example) and
pass those back to the app, essentially caching the DAO data. Yuck. I can
see memory usage and performance going right to hell, not to mention the
unintended consequences of failing to correctly implement some aspect of
DAO.

If I had my druthers I'd start over with a clean slate and rearchitect
this app to give it some reasonable object oriented structure and take
advantage of all that .Net has to offer - that just ain't gonna happen.

Are there any _sensible_ approaches to solving this problem?

Sean

Nov 21 '05 #2
Sean,
| Yuck. I
| can see memory usage and performance going right to hell, not to mention
| the unintended consequences of failing to correctly implement some
| aspect of DAO.
You would be implementing simply Proxy classes, in my experience simply
Proxy classes do not have adverse effects on memory usage or performance.
Seeing as you want to work with either DAO or ADO.NET, I would recommend an
Adapter pattern. Where you have a base class that defines the interface for
the Adapter, then DAO & ADO.NET concrete classes that define the
implementation of the interface...

| If I had my druthers I'd start over with a clean slate and rearchitect
| this app to give it some reasonable object oriented structure and take
| advantage of all that .Net has to offer - that just ain't gonna happen.
You can still do this & support both DAO & SQL Server. You could define a
Domain Model & then define 2 specific Data Mappers: one Data Mapper does
SqlClient and one does DAO. (I define a base classes for my Data Mappers to
minimize coupling).

http://www.martinfowler.com/eaaCatalog/domainModel.html

http://www.martinfowler.com/eaaCatalog/dataMapper.html

If you define the base class for your Data Mappers correctly, you should be
able to introduce support for Oracle, AS/400 or any other datasource (such
as an Xml File).

In addition to/instead of the Domain Model & Data Mapper patterns you could
also use the Table Module & Table Data Gateway patterns.

http://www.martinfowler.com/eaaCatalog/tableModule.html

http://www.martinfowler.com/eaaCatal...taGateway.html
| My legacy VB6 application depends heavily on DAO, especially as it
| relates to custom properties on database objects. These custom
| properties are, as I understand it, not avabilable with SQL Server,
| which we need to migrate to in the not too distant future.
SQL Server 2000 fully support custom properties on database objects. Lookup
"Extended Properties" in the BOL.

http://www.microsoft.com/sql/techinf...properties.asp

http://msdn.microsoft.com/library/de...l/sql02a10.asp

Hope this helps
Jay
"Sean Kirkpatrick" <na**********@c ommunity.nospam > wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
|I have a very ugly problem and I need some sincere guidance.
|
| My legacy VB6 application depends heavily on DAO, especially as it
| relates to custom properties on database objects. These custom
| properties are, as I understand it, not avabilable with SQL Server,
| which we need to migrate to in the not too distant future.
|
| My boss, the owner of the company, requires that we provide for a
| transition plan that minimizes (he really wants none) code changes to
| the existing app (which is in use by over 8000 clients). It is also
| required that we provide 100% backward compatibility with all of the
| existing installed base, so we will never be able to abandon support for
| Jet DBs. (Yes, never is a long time, but he still supports his DOS
| product of 18 years ago!)
|
| His desired solution is that we create a set of VB.Net interface classes
| that presents a DAO like interface to the existing codebase. Then, we
| implement two worker classes in VB.Net, one that uses DAO via Interop,
| and then a few months from now, implement an ADO.Net worker class for
| SQL Server that mimics the custom properties of Jet (this part is rather
| straight forward, as we can do this using special tables.)
|
| As I am exploring the topic, it seems that I'm going to have to make my
| own collection classes (for the DAO recordset object, for example) and
| pass those back to the app, essentially caching the DAO data. Yuck. I
| can see memory usage and performance going right to hell, not to mention
| the unintended consequences of failing to correctly implement some
| aspect of DAO.
|
| If I had my druthers I'd start over with a clean slate and rearchitect
| this app to give it some reasonable object oriented structure and take
| advantage of all that .Net has to offer - that just ain't gonna happen.
|
| Are there any _sensible_ approaches to solving this problem?
|
| Sean
Nov 21 '05 #3
On Tue, 19 Jul 2005 10:49:36 -0700, Sean Kirkpatrick <na**********@c ommunity.nospam > wrote:

¤ I have a very ugly problem and I need some sincere guidance.
¤
¤ My legacy VB6 application depends heavily on DAO, especially as it
¤ relates to custom properties on database objects. These custom
¤ properties are, as I understand it, not avabilable with SQL Server,
¤ which we need to migrate to in the not too distant future.
¤
¤ My boss, the owner of the company, requires that we provide for a
¤ transition plan that minimizes (he really wants none) code changes to
¤ the existing app (which is in use by over 8000 clients). It is also
¤ required that we provide 100% backward compatibility with all of the
¤ existing installed base, so we will never be able to abandon support for
¤ Jet DBs. (Yes, never is a long time, but he still supports his DOS
¤ product of 18 years ago!)
¤
¤ His desired solution is that we create a set of VB.Net interface classes
¤ that presents a DAO like interface to the existing codebase. Then, we
¤ implement two worker classes in VB.Net, one that uses DAO via Interop,
¤ and then a few months from now, implement an ADO.Net worker class for
¤ SQL Server that mimics the custom properties of Jet (this part is rather
¤ straight forward, as we can do this using special tables.)
¤
¤ As I am exploring the topic, it seems that I'm going to have to make my
¤ own collection classes (for the DAO recordset object, for example) and
¤ pass those back to the app, essentially caching the DAO data. Yuck. I
¤ can see memory usage and performance going right to hell, not to mention
¤ the unintended consequences of failing to correctly implement some
¤ aspect of DAO.
¤
¤ If I had my druthers I'd start over with a clean slate and rearchitect
¤ this app to give it some reasonable object oriented structure and take
¤ advantage of all that .Net has to offer - that just ain't gonna happen.
¤
¤ Are there any _sensible_ approaches to solving this problem?

I see several problems with attempting to impose a DAO interface, the primary of which would be that
the architecture is sufficiently different to cause a major headache when integrating with ADO.NET
database objects or SQL Server.

While you may be able to work with an underlying DAO Recordset, it doesn't translate directly to
ADO.NET. That will be an interop stumbling block. With respect to developing a custom interface that
mimics DAO, once again, the way in which DAO was designed to function is different than ADO.NET. Not
even Microsoft would develop a native DAO interface assembly for .NET.

You also have to consider that DAO was designed to operate through a persistently connected
environment, typically with a file based database, while ADO.NET's connections are generally
available only for the duration of the database update or query. This could be very different than
your current architecture if you're using an Access database.

Personally, since you're not only migrating to another development product but also from a file
based to server database, I would abandon the notion of trying to mimic the DAO interface in .NET.
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #4
Why don't you skip the bit involving creating a DAO wrapper, and just go
straight to the bit that involves "implement an ADO.Net worker class for
SQL Server that mimics the custom properties of Jet (this part is rather
straight forward, as we can do this using special tables.)" .. ?

This sounds like how I'd do it...
My legacy VB6 application depends heavily on DAO, especially as it
relates to custom properties on database objects. These custom
properties are, as I understand it, not avabilable with SQL Server,
which we need to migrate to in the not too distant future.

My boss, the owner of the company, requires that we provide for a
transition plan that minimizes (he really wants none) code changes to
the existing app (which is in use by over 8000 clients). It is also
required that we provide 100% backward compatibility with all of the
existing installed base, so we will never be able to abandon support for
Jet DBs. (Yes, never is a long time, but he still supports his DOS
product of 18 years ago!)

His desired solution is that we create a set of VB.Net interface classes
that presents a DAO like interface to the existing codebase. Then, we
implement two worker classes in VB.Net, one that uses DAO via Interop,
and then a few months from now, implement an ADO.Net worker class for
SQL Server that mimics the custom properties of Jet (this part is rather
straight forward, as we can do this using special tables.)

As I am exploring the topic, it seems that I'm going to have to make my
own collection classes (for the DAO recordset object, for example) and
pass those back to the app, essentially caching the DAO data. Yuck. I
can see memory usage and performance going right to hell, not to mention
the unintended consequences of failing to correctly implement some
aspect of DAO.

If I had my druthers I'd start over with a clean slate and rearchitect
this app to give it some reasonable object oriented structure and take
advantage of all that .Net has to offer - that just ain't gonna happen.

Are there any _sensible_ approaches to solving this problem?

Sean

Nov 21 '05 #5
Paul Clement wrote:

Personally, since you're not only migrating to another development product but also from a file
based to server database, I would abandon the notion of trying to mimic the DAO interface in .NET.


You're preaching to the choir, but this ignores the much more
fundamental problem: I do not have a choice to abandon DAO - the owner
of the company has mandated that this be done. I am directed to write
some sort of interface that looks like DAO such that under the covers, I
can substitute a different class that interacts with any old arbitrary
DB engine. This means that I am going to have to implement my own
Recordsets, Fields, Properties, and etc. so that the existing code works
without (much) change, and provide translations from the native DB
notion of these entities.

It is not pretty.

Silly? Yep. Other choices? Nope.

Sean
Nov 21 '05 #6
That was my initial approach, but it doesn't solve the backwards
compatibility problem: i.e., I must continue to support those 8000+
clients out there who are using Jet DBs (some of whom have written their
own custom addins to my product that likewise depend on Jet custom
properties.) Also, my boss does not want to migrate right now to to
MSDE/SQL Express, so my alternatives are severely constrained.

Sean

Bonj wrote:
Why don't you skip the bit involving creating a DAO wrapper, and just go
straight to the bit that involves "implement an ADO.Net worker class for
SQL Server that mimics the custom properties of Jet (this part is rather
straight forward, as we can do this using special tables.)" .. ?

This sounds like how I'd do it...

Nov 21 '05 #7
Sean,
You can use DAO via COM interop, you don't need to write any wrappers per
se. The COM interop writes all the wrappers you need...

When you are ready to implement the SQL side of things, you could (could)
simple define your own classes that implement the interfaces from DAO.

I however would take a different approach. I would decouple the current app
from DAO, encapsulating all the DAO code in my own data objects. Then when
you are ready for SQL, you would create a new set of data objects that
talked SQL Client instead of DAO.

Of course depending on how tightly the current app is coupled to DAO
creating data objects might not be a viable option.

Hope this helps
Jay

"Sean Kirkpatrick" <na**********@c ommunity.nospam > wrote in message
news:uv******** ******@TK2MSFTN GP12.phx.gbl...
| Paul Clement wrote:
|
|
| > Personally, since you're not only migrating to another development
product but also from a file
| > based to server database, I would abandon the notion of trying to mimic
the DAO interface in .NET.
| >
|
| You're preaching to the choir, but this ignores the much more
| fundamental problem: I do not have a choice to abandon DAO - the owner
| of the company has mandated that this be done. I am directed to write
| some sort of interface that looks like DAO such that under the covers, I
| can substitute a different class that interacts with any old arbitrary
| DB engine. This means that I am going to have to implement my own
| Recordsets, Fields, Properties, and etc. so that the existing code works
| without (much) change, and provide translations from the native DB
| notion of these entities.
|
| It is not pretty.
|
| Silly? Yep. Other choices? Nope.
|
| Sean
Nov 21 '05 #8
On Wed, 20 Jul 2005 10:39:07 -0700, Sean Kirkpatrick <na**********@c ommunity.nospam > wrote:

¤ Paul Clement wrote:
¤
¤
¤ > Personally, since you're not only migrating to another development product but also from a file
¤ > based to server database, I would abandon the notion of trying to mimic the DAO interface in .NET.
¤ >
¤
¤ You're preaching to the choir, but this ignores the much more
¤ fundamental problem: I do not have a choice to abandon DAO - the owner
¤ of the company has mandated that this be done. I am directed to write
¤ some sort of interface that looks like DAO such that under the covers, I
¤ can substitute a different class that interacts with any old arbitrary
¤ DB engine. This means that I am going to have to implement my own
¤ Recordsets, Fields, Properties, and etc. so that the existing code works
¤ without (much) change, and provide translations from the native DB
¤ notion of these entities.
¤
¤ It is not pretty.
¤
¤ Silly? Yep. Other choices? Nope.
¤
¤ Sean

Not that management would understand (or even care about) the ramifications of attempting to do what
they are requesting, but I just wanted you to understand what you're in for.

It's one thing to abstract the data access method from your application so that is can be easily
changed once technology changes, but it's quite another to attempt to retrofit an old architecture
into a new one.
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #9
Hi Jay.

Any and all of this discussion helps, if only to clarify my thinking.

First of all, thanks for the reference to Fowler's book - I just went
out and picked up a copy of it and am about to dig in.

I think we're on the same page here: what I'm calling wrappers you're
calling data objects.

Let me run this past you.

It seems like I should write my own abstract class heirarchy beginning
with a CDatabase object that has an OpenRecordset call that returns a
CRecordset object. Then, I'll write write a subclass that implements
these in terms of DAO calls, and later a SQL Server subclass. Then, with
proper redeclaration of variables in my app, the essential call
structure remains the same.

This means that I have to provide my own Recordset class collection that
maps DAO records sets to my own, as well as to ADO.Net recordsets. I
don't have to (and am not yet planning on) implementing the ADO.Net map.

Another related question: It is highly likely that I will pass off the
ADO.Net mapper off to another fellow in the shop here. I want to make
sure that he implements the same interface that I define in its
entireity. This suggests that I should define a suite of Interface
classes that he must implement. However, I've discovered that there's a
few wrinkles with this in that I really want to make typesafe collection
classes for Fields, Properties, and the like.

I think an alternative is to define a set of abstract base classes with
MustOverride methods.

Are there other things that I need to consider?

Thanks for your help and insight. This has not been an easy or fun
project for me to work on - if you saw the extant code base you'd know why.

Sean
Jay B. Harlow [MVP - Outlook] wrote:
Sean,
You can use DAO via COM interop, you don't need to write any wrappers per
se. The COM interop writes all the wrappers you need...

When you are ready to implement the SQL side of things, you could (could)
simple define your own classes that implement the interfaces from DAO.

I however would take a different approach. I would decouple the current app
from DAO, encapsulating all the DAO code in my own data objects. Then when
you are ready for SQL, you would create a new set of data objects that
talked SQL Client instead of DAO.

Of course depending on how tightly the current app is coupled to DAO
creating data objects might not be a viable option.

Hope this helps
Jay

Nov 21 '05 #10

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

Similar topics

13
3852
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some modifications along the way to make the interface more Pythonic. For example, all of these functions return an error code (typically just errno passed along, but not always). They all accept as one of their arguments a pointer to someplace to store...
2
2463
by: Alex Dribin | last post by:
Hi, Are there ready solutions for auto-wrapping lines in ostream? I am using ostream for output and want this output to be wrapped at some position. Of course I can monitor stream pointer position and insert end-of-lines periodically. Something better than that? Alex
11
5598
by: yawnmoth | last post by:
word wrapping normally treats some spaces as line feeds, if there hasn't been a line feed for quite a while. so while a string with eighty consecutive a's might not word wrap, a space placed squarely in the middle of that string will sorta word wrap. so why doesn't it seem to work with !'s? here's a page that demonstrates how !'s don't seem to word wrap: http://www.geocities.com/terra1024/wordwrap.htm here's a page that shows how...
12
19503
by: sneill | last post by:
Hello, I have the following HTML / CSS that draws 2 rows. Each row has 3 cells. I want the cells within each row to span a single line. Each cell is 100px wide, and the row containing them is 250px wide. Clearly the last cell won't fix, but rather than wrapping to the next 'line' within the row, I'd like the last cell to be clipped and only showing the first 50px. This code was developed in IE6. Can't say what it looks like in
14
5409
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB 7.2 environment, the choices the optimizer makes often seem flaky. But this last example really floored me. I was hoping someone could explain why I get worse response time when the optimizer uses two indexes, than when it uses one. Some context:
10
2323
by: Douglas G | last post by:
I've tried various ideas on this problem, but I don't see word wrapping. Can you point out what is wrong? It's a K&R exercise, and I'm still new to programming. Other pointers would be helpful too. #include "header.h" /* does the wordwrapping */ void fold(char buffer, int len) {
85
3262
by: masood.iqbal | last post by:
I know that this topic may inflame the "C language Taleban", but is there any prospect of some of the neat features of C++ getting incorporated in C? No I am not talking out the OO stuff. I am talking about the non-OO stuff, that seems to be handled much more elegantly in C++, as compared to C. For example new & delete, references, consts, declaring variables just before use etc. I am asking this question with a vested interest. I...
6
1165
by: Markus Ernst | last post by:
Hi Searching for a possibility to display some text with preserved white space and line breaks, but with long lines being wrapped, I found this CSS declaration, which I found helpful: pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */
9
1572
by: trondhuso | last post by:
Hi, I have a solution that - at time of writing - has to use tables to render a list of database-results. My challenge though is that we have used iframes and such to render the different lists on this page, and now - for some reason - the table has become to wide. I am looking at the code and trying to change width using css, but without much luck. I see that in some of the data there are Caps-only text, and I am now wondering if...
43
1848
by: Pawel_Iks | last post by:
I've read somewhere that c++ is something more than better c ... then I talk with my friend and he claimed that c++ is nothing more than better c ... I tried to explain him that he was wrong but I forgot all arguments about it. Could someone told something about it?
0
8675
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.