aop

Can I conditionally control method calls at runtime with attributes?

The Conditional Attribute in .NET allows you to disable the invocation of methods at compile time. I am looking for basically the same exact thing, but at run time. I feel like something like this should exist in AOP frameworks, but I don't know the name so I am having trouble figuring out if it is supported. So as an example I'd like t...

AroundInvoke Interceptor on a @Timeout Annotated Method is Not Working

Application Server: JBOss 4.2 I have a method which I want to intercept.Its a method annotated @Timeout and invoked by javax.ejb.TimerService instance. The method signature: @Stateless class A @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) @Timeout @Interceptors(AnInterceptor.class) public void ...

AOP and user-specific data storage

I have been using AOP for "classic" things like logging and security for a while and am starting to take it further. One problem I come across frequently with desktop applications is the need to store user-specific data locally. To that end, I have built a component that works well for me that stores data as XML in an application-speci...

Do you know any designe pattern for AOP?

Do you know any designe pattern for Aspect Oriented Programming? Do you know a book or a list of such design patterns? I am looking for design patters which specifically could be implemented in AOP. I am not interested in implementing classical DPs in AOP. I'm looking for problems which could be solved much more easier using AOP. Even a ...

Is there a way to use PostSharp without installing the package.

I would like to automate the deployment of Postsharp that's why I would like to have a text file that would preserve the necessary deployment settings. ...

Aspectj in spring

I am getting the following error when i try to auto wire aspectj in spring org.xml.sax.SAXParseException: The prefix "aop" for element "aop:aspectj-autoproxy" is not bound. my appContext.xml entry looks like ..... <aop:aspectj-autoproxy/> <bean id="helloFromAspectJ" class="com.cvs.esps.aspect.logging.TestAspect"/> ..... some hel...

A .Net aspect weaver supporting relationship aspect implementation

With relationship aspects implemented in AspectJ I can associate objects of two types in the following way (see code example below). I would like to transfer this concept to .net. Can you point me towards a .net weaver implementation that will allow me to do this or something similar? Relationship aspects are designed by Pearce & Noble....

Getting attribute context in C#

Basically I'm trying to implement some sort of poor man's Aspect Oriented Programming in C#. I had thought about using a ContextAttribute but they seem only be be bound at the class level. Is there any way that I can put an attribute in such that it will receive the same parameters as the method which it annotates or some way to access...

Using PostSharp to retry method on Exception

Hi, For one of my DAL modules I have lots of duplicated plumbing in the shape of: while (retry) { ... try { ...do something retry = false; } catch (SqlException sqlEx) { // Retry only if -2 = Connection Time Out or 1205 = Deadlock if (sqlEx.Number == -2 || sqlEx.Number == 1205) { ..retry if attempt < max } .....

Separating Business Rules from Business Processes

Hi, how do I externalize the business rules from the business processes so that I can add rules without touching the business process logic? For example, I have two business processes, say "Add Product" and "Update Product", there are a few common rules that these 2 processes share, and rules can keep getting added later. I intend to w...

Ninject AOP - getting method parameters from intercepted method

Hi. Does anyone know of a way to get hold of the intercepted parameters sent into a method. For instance... You have an Update method inside a CustomerService like this.. Update(Customer c) ..and you want to get hold of the Customer object sent into the service. Does it come out of the box in any way or do I have to do anything else e...

AOP... Should I unlearn OOP ?

I have skimmed the online documentation, read the wiki entry, the posts and the blogs, but I'm still puzzled. What is, in a nutshell, Aspect Oriented Programming ? Is it simply better then Object Oriented Programming ? Should I unlearn OOP ? If not, how do I know when to use one or the other ? What are the main differences between the ...

Aop, Unity, Interceptors and ASP.NET MVC Controller Action Methods

Using log4net we would like to log all calls to our ASP.NET MVC controller action methods. The logs should include information about any parameters that were passed to the controller. Rather than hand-coding this in each action method we hope to use an AoP approach with Interceptors via Unity. We already have this working with some ot...

Spring Dependency Injecting an annotated Aspect

Using Spring I've had some issues with doing a dependency injection on an annotated Aspect class. CacheService is injected upon the Spring context's startup, but when the weaving takes place, it says that the cacheService is null. So I am forced to relook up the spring context manually and get the bean from there. Is there another way ...

Trouble configuring AspectJ LTW with Tomcat and Spring

Hi all, I'm having some problems getting load-time weaving to work with Spring in my Tomcat 6 webapp. I only want to use it for transactions (so that self-invocation respects transactional annotations, which it doesn't with AOP proxying). It appears that the weaver is being loaded, but my annotated classes aren't actually being woven. Wh...

feasibility on data mining program call stack using AOP

I am reading an article in IEEE Computer magazine about using data mining on applications. The part that is intriguing to me is the idea that we can have software that can monitor the execution flow of an program, and put the data into a database, where we can do some data mining. This data could then be used by a data mining tool to ...

How to inject C# code at compile-time?

I would like to be able to decorate any method with a custom Trace attribute and some piece of code should be injected into that method at compilation. For example: [Trace] public void TracedMethod(string param1) { //method body } should become: public void TracedMethod(string param1) { Log.Trace("TracedMethod", "param1", par...

Aspect oriented Programming?

How can we apply attributes to class fucntion using AOP in C#? UPDATE: I am slightly not clear in what context AOP should be used? As we can use AOP for logging purpose, security(Authentication), please suggest some other scenarios where we can take benefit of AOP Is AOP can be use to share data among different running threads in appli...

Advise in AspectJ to change control flow

I'm just starting to learn AspectJ, and I have use-case for say, User login. If a user's session data (cookies) doesn't match the stored data on the server, I want to change the function called. Say I have two operations: class HttpServlet { public function() { } public function2() { } public doLogin() { } } ...

What binary rewriter is used to implement Microsoft's Code Contracts?

I am talking about those Code Contracts that will end up in .NET 4.0. What binary rewriter do they use to inject the code that makes it all work and is it publicly available? I hope it's not just a compiler thing because I would love to be able to use their binary rewriter for AOP. ...