aop

What are the functional differences between AspectJ and PostSharp?

Does anyone know what AOP features are different between AspectJ and PostSharp (yes I know they are for different languages and platforms)? I'm trying to understand what kind of things AspectJ would allow that PostSharp would not, and vice versa. ...

How to implement the Strategy Pattern in AOP

Can anyone tell me how to implement the Strategy Pattern in AOP? An example using Spring-AOP or AspectJ would be very helpful. ...

AOP with AbstractAction execute method

I was attempting to set up an aspect on one of the classes extending AbstractAction (SWF - package org.springframework.webflow.action) on the public final method execute. The execute is the only public method in the interface Action class It's signature is: public abstract Event execute(RequestContext requestcontext) throws Exception...

Spring - How 'multiple' AOP behaviors to sevices are resolved?

Hello, I want to know that whether we can apply 'multiple' AOP behaviors to our service classes or not? Lets just say, i do this to my BankServiceImpl class: @Transactional on top of one of the method, accountTransfer(), and and some custom <aop> pointcut on the execution of another method someOtherMethod(). Then will Spring be able...

Is AspectF (a Fluent Aspect Framework) an AOP-like design that can be used without much concern?

Omar Al Zabir is looking for "a simpler way to do AOP style coding". He created a framework called AspectF, which is "a fluent and simple way to add Aspects to your code". It is not true AOP, because it doesn't do any compile time or runtime weaving, but does it accomplish the same goals as AOP? Here's an example of AspectF usage: ...

Castle Windsor Interceptor for private/protected method

Hi all, Is it true that in order for castle windsor's interceptor to intercept a method, that method needs to be declare public? ...

My Spring AOP not working

I need help making AOP work. What am I missing here? <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2...

Why is this method call not getting intercepted?

Why doesn't DoIt() method call get intercepted? Should I use something other than InterfaceInterceptor to intercept the DoIt() method? How would you do it? using System; using Microsoft.Practices.Unity; using Microsoft.Practices.Unity.InterceptionExtension; namespace UnityTest { class Program { static void Main(string[] ar...

Use AOP in C# to detect if return value is used

This is related to my other question, but this time very specific. Is it possible, using AOP (PostSharp in particular) to detect if function's return value was used? For example var x = y.func(); // used y.func(); // not used Note that detection should be performed for this particular call, not for the function in general. I never u...

Spring - Aspect is not getting applied at runtime

I have the following configuration: @Aspect public class MyAspect { @Around(@annotation(SomeAnnotation)) public Object myMethod(ProceedingJoinPoint joinPoint) throws Throwable { System.out.println("Hello..."); } } And have the following beans definitions: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xs...

STS : Using JSF , Managed beans and Aspects

Main idea is to use JSF with Spring AOP for modularizing cross cutting concerns like logging. I am using STS (Spring tool suite) and have jsp page with jsf tags. These tags are reading data from a managed bean properties(getter). I have aspect configured for the getters. When i run application with Java/AspectJ getter is called and aspec...

JBoss Microcontainer + AOP in a standalone app

Hi everyone, I'm trying to create a standalone app using JBoss Microcontainer for IoC and JBoss AOP for, well, AOP. I've boot-strapped, deployed a descriptor with AOP XML, so far so good. But the aspect is not performed. Do I need to enable AOP plugin or something? Note that I don't want to add a build step - I want it to work like Spri...

Is there an AOP solution for Silverlight?

I see that there is PostSharp AOP support for Silverlight, but is there a product that works like the Castle DynamicProxy library, but in Silverlight? ...

Polluting domain types by implementing infrastructure-related interfaces

Hi all, Did about 30 minutes worth of searching, found lots of relevant info, but none that addresses this particular concern, hope I'm not repeating a common question. I would like to know what the general consensus is in regard to implementing infrastructure-related interfaces in domain types. Everything I've read about DDD leads me...

What are the different methods for injecting cross-cutting concerns?

What are the different methods for injecting cross-cutting concerns into a class so that I can minimize the coupling of the classes involved while keeping the code testable (TDD or otherwise)? For example, consider if I have a class that requires both logging functionality and centralized exception management. Should I use DIP and injec...

Preprocessing C# - Detecting Methods

Hey, I require the ability to preprocess a number of C# files as a prebuild step for a project, detect the start of methods, and insert generated code at the start of the method, before any existing code. I am, however, having a problem detecting the opening of a method. I initially tried a regular expression to match, but ended up wi...

Patterns for functional, dynamic and aspect-oriented programming

We have a very nice GoF book (Design Patterns: Elements of Reusable Object-Oriented Software) about patterns in Object Oriented Programming, and plenty of articles and resources in the web on this subject. Are there any books (articles, resources) on patterns(best practices) for functional programming? For dynamic programming in langua...

Dependency Injection - Who owns the Interface?

Assuming I want to use a dependency injection framework in an AOP approach, with the goal of producing code modules. What's the best practice for the ownership of the shared interfaces? By ownership I mean the body of code that needs to be referenced in order to use the interface. My first guess is that in AOP you would define a class...

Reduce PostSharp compile time overhead

We recently introduced PostSharp into our code base and the compile time of our ASP.NET MVC project has doubled to quadrupled. We have about 3 MVC projects and approximately 8 class library projects in our solution. Obviously there will be overhead associated with PostSharp since it is modifying the MSIL code. But a 2x to 4x overhead ...

How to get this really fast?

I have a framework that allows users to do queries to a specific datasource (the Football Manager 2010 ingame database, for those of you interested). In this framework, I have two different modes wherein my framework can run: realtime and cached mode. I want users who use this framework to be able to switch by just calling a different c...