|
Event | Usage |
WriteProperties | When you add the object into a Property Bag, this event fires. Use the event to write code that adds all the object's property values into the bag. |
ReadProperties | When the object is extracted from the bag, this event fires. Use the event to write code that reinstates the object's properties from the bag. |
InitProperties | When a persistable object is created using "New" or "CreateObject," this event fires. It doesn't fire when an object is extracted from a bag, as ReadProperties will be called instead. In both cases, the object's Initialize event will fire. Use this event to write initialization code that only fires when an object is first created. |
|
|
|
|
|
|
|
The most noticeable feature of these three types of applications is that
they're becoming more and more common, especially in the brave new world
of Internet-based commerce. "Talking objects" should have a bright
future.
Download TURF.exe
Rob Macdonald is an independent
software specialist based in London and southern England. In addition to
consulting and training in Windows, client/server, VB, COM, and systems
design and management, he also runs the U.K. ODBC User Group and is author
of RDO and ODBC: Client Server Database Programming with Visual Basic, published
by Pinnacle. +44 1722 782 433, salterton@msn.com.
Sidebar: Don't Overdo Persistence
This article has focused on reading and
writing persistable objects to and from files and queues. But even if you
never see yourself doing these things, some applications of using Property
Bags might have come to mind. Here are some I've used:
|