Caching objects


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Caching objects

  1. #1
    Simon Fitzpatrick Guest

    Caching objects


    I've been having problems trying to cache the values of a class to another
    variable (in order to re-create an Undo-Redo scenario without having to go
    through each property in the class).

    When I set the contents of one of classes to another, (even when passing
    byval to a procedure) and then change the original class, the cached class
    is also affected. Is there anyway to in effect duplicate the contents of
    a class and change the original without affecting the other?

    I've probably missed something elementary here.

    Thanks in advance,

    Simon Fitzpatrick
    Share on Google+

  2. #2
    D. Patrick Hoerter Guest

    Re: Caching objects

    Simon,

    You'll have to roll your own Clone method. There is no way to copy an
    object in Visual Basic. Passing an object ByVal merely copies the reference,
    not the object.

    Regards,
    D. Patrick Hoerter


    Simon Fitzpatrick wrote in message <38fec375$1@news.devx.com>...
    >
    >I've been having problems trying to cache the values of a class to another
    >variable (in order to re-create an Undo-Redo scenario without having to go
    >through each property in the class).
    >
    >When I set the contents of one of classes to another, (even when passing
    >byval to a procedure) and then change the original class, the cached class
    >is also affected. Is there anyway to in effect duplicate the contents of
    >a class and change the original without affecting the other?
    >
    >I've probably missed something elementary here.
    >
    >Thanks in advance,
    >
    >Simon Fitzpatrick


    Share on Google+

Similar Threads

  1. Replies: 10
    Last Post: 05-15-2005, 06:14 AM
  2. Bug with Creation of Objects in SQL *Plus Worksheet
    By Michael Cole in forum Database
    Replies: 2
    Last Post: 04-02-2003, 03:06 PM
  3. Bug with Creation of Objects in SQL *Plus Worksheet
    By Michael Cole in forum oracle.general
    Replies: 0
    Last Post: 02-20-2003, 10:25 PM
  4. Thin Objects for Better Performance
    By Dave Fleischman in forum Enterprise
    Replies: 3
    Last Post: 08-18-2000, 01:10 PM
  5. Components vs Objects
    By Oliver Lennon in forum Enterprise
    Replies: 3
    Last Post: 04-18-2000, 12:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center