Quote:
Originally posted by shunt
Creating a design pattern:
Firstly, design patterns are methods of solving particular problems. They are not technology dependant, so it would not be a design pattern in any case. I have seen a name for this type of thing before, just cant remember it right now.
I think its an Observer.
Quote:
It is pointless trying to encapsulate ADO. Ask yourself: Why do I want to encapsulate ADO?
Actually tell me why you want to encapsulate ADO and I will convince you not to. ADO is the perfect adapter for database access... If anyone could make it any better, M$ would have payed them out ages ago. USE ADO, AS IS!
I was being considerate to the consumers of an NADO object. Rather than saddle a NADO consumer with 2 objects (a Notifier/Observer and ADO), you could create the NADO to epsose the identical ADO interface (so the consumer believes he is using ADO), plus "hide" a notification layer inside of it. That way, a NADO consumer would "not care" about dealing with sending notifications - it would just use NADO as it would use ADO.
Quote:
Your solution:
Dave, you are close. I think you are still exposing too much to your application. Remember, you do not want object references passed across your network. So, you will not want to make the recordset object available outside your data service. The only thing you want to make available is the data itself. In any case, to encapsulate the data access correctly, you should not be exposing a recordset object.
Yes, I agree, but this is an advanced topic to the point where no one thinks like this. This may be the "Holy Grail" of VB6 and I'm not sure we're ready for that yet ;)
Quote:
My Solution:
Have a look at the .NET framework and the remoting infrastructure. The .NET framework will serialize the dataset (basically convert it to an xml string) and send it accross the network (send the string). So, I decided to learn from this and send all my data objects in the same way. Serialize them, send them, deserialize on the other side. This works like magic! Performance hit? Who cares the ease in loading, saving and searching for objects far outweighs the negligible performance hit.
You mean to use ADO's built-in Method to serialize itself in the form of an XML file, then send that file across application space, then reload that file?