Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Rolling Back Object Changes
|
199
See Also
To use the built-in ASP.NET cache object independently of a web application, see
the following topics in MSDN:
“Caching Application Data”
“Adding Items to the Cache”
“Retrieving Values of Cached Items”
“Deleting Items from the Cache”
“Notifying an Application When an Item Is Deleted from the Cache”
“System.Web.Caching Namespace”
In addition, see the Datacache2 Sample under “.NET Samples—ASP.NET Caching”
in MSDN; see the sample links to the Page Data Caching example in the ASP.NET
QuickStart Tutorials.
Also see the “WeakReference Class” topic in the MSDN documentation.
3.30 Rolling Back Object Changes
Problem
You have an object that allows its state to be changed. However, you do not want
these changes to become permanent if other changes to the system cannot be made
at the same time. In other words, you want to be able to roll back the changes if any
of a group of related changes fails.
Solution
Use the memento design pattern to allow your object to save its original state in order
to roll back changes.
The memento design pattern allows object state to be saved so that it can be restored
in response to a specific situation. The memento pattern is very useful for imple-
menting undo/redo or commit/rollback actions. This pattern usually has
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata