Bltoolkit Cache Aspect

141 views
Skip to first unread message

Pavel Mikhailov

unread,
Feb 29, 2012, 4:12:18 AM2/29/12
to Business Logic Toolkit for .NET
Hellow!

I'm using the Bltoolkit Cache Aspect for my CustomCacheAspect.

I discovered that the attribute [Cache] works only with virtual or
abstract methods. It's maked purposefully? if so, why? And if not,
what can i do to work with non overrideable methods? I want to use
caching in business logic tier, where lot of non-virtual and non-
abstract methods.

Thanks.

NetTecture

unread,
Mar 6, 2012, 1:53:51 AM3/6/12
to blto...@googlegroups.com
Simple answer - it works by generating a subclass and overriding the methods. non virtual and non abstract methods can not be overridden / implemented in a subclass, ergo can not be used.

> I want to use caching in business logic tier, where lot of non-virtual and non- 
abstract methods.  

Simple - you want to eat a fully vegetarian kobe steak - wont happen, steaks are not vegetarian.

Ergo - you can not use BlToolkit aspect for this.

THAT SAID: I consider them surplus. BlToolkit is nice, but tries oto do a lot of thigns that others make better and have nothing to do with data access ;) Try looking at PostSharp for a bytecode postprocessing approach. That can easily handle even static methods by rewriting the bytecode after the compiler.
Reply all
Reply to author
Forward
0 new messages