CirrusCachingAspect For Delphi Prism

Introduction

This is a Cirrus AOP Aspect for Delphi Prism that caches the results of methods to which it is applied. You can view the original post explaining its purpose and creation.

The source can be found on Github at my Cirrus Caching Aspect repository. You can still download a zipped copy from Github even if you don’t have a git client installed.

Goto the Cirrus Caching Aspect on Github.

Usage Example

You will need to download and install the Enterprise Library from the Microsoft Enterprise Patterns and Practices Library and in particular the Application Caching Block from Microsoft. You should consult the MSDN pages on the Caching Application Block for information on advanced configuration and usage.

Once you have installed this prerequisite, you can then download and compile the Aspect and add it as a reference to your project before adding Caching on a per-method basis like so:

  MyClass = public class
  private
  public
    [Aspect:MethodCache]
    method CachedMethod: XmlDocument;
    method NotCachedMethod: XmlDocument;

Standard Disclaimer

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Delphi Prism