Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 67951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:20:25+00:00 2026-05-10T19:20:25+00:00

In .NET 3.5, I’m going to be working with System.Reflection to use AOP (probably

  • 0

In .NET 3.5, I’m going to be working with System.Reflection to use AOP (probably in the context of Castle’s Windsor Interceptors) to do things like define which security actions need to be performed at the method level, etc. I have heard that some parts of Reflection are slow (I’ve read the MSDN article around it), and would like to cache these parts (when I get closer to production code, at any rate). I would like to validate my approach:

  • cache key is {type} + {case sensitive method name} + {list of parameter types}
  • cache key objects can be compared via an Equals operation
  • cache payload is a {MethodInfo} + {list of custom-attributes defined on the method}
  • cache is injected to my interceptors via constructor injection
  • cache can be maintained for a long time (based on the assumption that I’m not going to be writing self-modifying code 😉 )

Update:

I’m not intending to call methods via Reflection something I’m writing myself; just (at the moment) look up attributes on the ones I want to inject functionality into, where the attributes define the behaviour to inject. My interceptors at the moment will be using Castle’s Windsor IInterceptor mechanism until I notice a reason to change it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:20:26+00:00Added an answer on May 10, 2026 at 7:20 pm

    Explicitly calling a MethodInfo is indeed slow – but you can make it much, much faster if you convert it into a delegate. See this blog post for example. That doesn’t help in terms of finding methods etc of course, but if you’re going to call the method repeatedly it’s worth bearing in mind.

    The cache key sounds easy enough to build – types and strings compare nice and easily. Values are always relatively simple 🙂

    Once built, is the cache going to be read-only? Can you separate out the phases so that you can guarantee it won’t be read before being fully built? If so, you should be able to get away without any explicit locking – basically a dictionary from your custom key type to your custom value type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

.NET we have primitive datatypes like int and value types like struct. And also
net website, I would like to add button by which user can view the
NET MVC 1.0. I use ViewData[DeptID] = new SelectList(DeptID, ID, Name, course.DeptID); where I
.NET COM interop so far always has been working quite nicely. Since I upgraded
NET WinForms. VB code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
.NET 1.1 lacks ParameterizedThreadStart (I have to use 1.1 because it's the last one
.NET provides the JavaScriptSerializer class in the System.Web.Script.Serialization namespace. (provided in System.Web.Extensions.dll) It was
net 4 and c#. I have a GridView, I would like take a Row
net CF I need to use substring to capture the mid of a string.
net application. .exe generated is sufficient to use software. since I have 700 MB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.