aop

Other than logging, and transaction management what are some practical applications of AOP?

I understand the principles but i have a hard time seeing where the practical applications are outside of a few. Please enlighten me ;) ...

We treat interfaces and implementations like we treat content and styling, so why not handle it similarly?

I've used Spring, and I've looked into Guice, and I think that these are both rather obtrusive extensions to languages. I firmly believe that programming languages themselves need to adapt to patterns more cohesive to dependency injection, testing, etc., so why not gravitate to a stylesheet based approach? By allowing multiple "stylings,...

configurable vs component with spring and aspectj

When using aspectj, why use @Component over @Configurable. I've got spring and aspectj setup for @Transactional support, aspects on self-invocation, and injection into JPA entities. This works great. I'm using @Component for most classes that need injection, and thus either having them injected into their dependencies. Or, when I can'...

How does one manage object pooling in Spring?

It's my understanding that in Spring, all objects are treated by default as singletons. If singleton is set to false, then a new object will be served at each request. But what if I wanted to pool objects? Say set a range from a min of 1 to a max of 10 instances? Is this possible using Spring? ...

AOP Dirty Tracking

In the past I have used a few different methods for doing dirty checking on my entities. I have been entertaining the idea of using AOP to accomplish this on a new a project. This would require me to add an attribute on every proptery in my classes where I want to invoke the dirty flag logic when the property is set. If I have to add an ...

Why doesn't AspectJ compile-time weaving of Spring's @Configurable work?

Update 5: I've downloaded the latest Spring ToolsSuite IDE based on the latest Eclipse. When I import my project as a Maven project, Eclipse/STS appears to use the Maven goals for building my project. This means AspectJ finally works correctly in Eclipse. Update 4: I have ended up just using Maven + AspectJ plugin for compile-time weavi...

Whats wrong with this aspect

I only want this invoked when a property is set. Why is this not working? [DirtyTrackingAttribute(AttributeTargetElements = PostSharp.Extensibility.MulticastTargets.Property)] class Program { public static string Test { get; set; } static void Main(string[] args) { TestIt(); Test = "foo"; Console...

Spring-AOP

i have configured a Spring-AOP on a bean. When i access this bean it returns me a spring proxy class instead of the actual bean. Is there any way i can get the actual bean. ApplicationContext.xml bean id = "abc" class = "abc.java" some.java abc a = (abc)applicationContext.getBean("abc") this throws: java.lang.ClassCastException: $Pr...

Postsharp - Get Calling Assembly?

When using a Postsharp OnMethodBoundaryAspect, is there some way to get the calling assembly that initiated the call to a given method? GetCallingAssembly just returns the assembly that the method being called is in. Note - I am having trouble with the postsharp forums, otherwise I would have posted it there. ...

PostSharp for an object mapper

I'm considering using PostSharp for entity-to-DTO and DTO-to-entity mapper. To do that task manualy for about a 100 entities would be a maintenence nightmare. I've looked at AutoMapper on codeplex, but i think the overhead might be a serious problem in my case, besides i feel that PostSharp could give me some extra control over the mappi...

Getting rid of the burden of checking for a setting's value every time an object is used

Imagine an application based on options. I want to add an exclamation mark to the end of every string (itself, an extremely easy task). However, I have an option in web.config or an XML file, so if the option is true, the exclamation is appended, otherwise it isn't. I know how to check web.config or an xml file for the setting's value,...

Delphi Prism Cirrus accessing and setting the Result of a function

Background This question relates to the new Cirrus infrastructure for Aspect Oriented Programming in Delphi Prism. I currently have an aspect which I am Auto-Injecting into a class and am attempting to modify the target code using aMethod.SetBody function. I have structured my code thus far using the Logging example code found on the C...

Future of Aspect Oriented Programming

I am a newbie in the area of AOP. The first time I coded something applying concepts of AOP, I was thrilled to understand how aspects eliminate cross cutting patterns in your application. I was overwhelmed by the thought of solving cross cutting patterns like security, logging, transactions, auditing and etc applying AOP. However, when ...

EJB Interceptors in Weblogic

I have an EJB in Weblogic 10.3 that has en EJB interceptor defined for it like such: @Stateless(name="MyEJB") @Interceptors ({AuditInterceptor.class}) public class MyEJBImpl extends BaseEJB implements MyEJB It appears as if the interceptor advice is only being applied to certain methods in the EJB. I am using the @AroundInvoke annota...

How to: compile generated C++ source files?

Hi, so I'm writing a VS2008 C# Add-In to automate AspectC++ weaving in C++ projects. I'm generating the C++ source files (now woven with aspects), but I can't figure out how to compile them as part of the pre-build step. Is there a convenient way to specify new source within the IDTExtensibility2, EnvDTE90, or VslangProj90 namespaces? ...

Accessing HttpServletRequest from AOP advice in Spring 2.5 with annotations

Hi All, I have tried to find the answer to this question on both the Spring forum and by searching StackOverflow. I have found a lot of pages describing horrible architectures and asking for about the same thing as I do, but my intended usage is different so please bear with me :-) I have a Spring 2.5 project using annotation based for...

AOP, Spring and transaction scoping

Hi, imagine a transactional, multithreaded java application using spring, jdbc and aop with n classes in m packages all taking part in database transations. Now let's say there is the need to scope an arbitrary set of classes within one transaction. Furthermore there is always one class T within the scope that commits the transaction whe...

What's aopalliance all about? And why is guice using it?

I'm using guice for dependency injection with aop from aopalliance. I can't quite figure out what's aopalliance all about and who implemented the version (dated from 2004) that's on their sourceforge page. Why is guice using this version instead of a more known package such as AspectJ? Also, do you know of any tutorials on the aopallian...

Javascript AOP libraries

Which Javascript AOP library do you use, and what are its key features ? ...

Can I inject code in spring using AOP annotations?

Is it possible to do something like the following: public void doStuff(@RequirePrivilege("foo") User user) { // ... } and have it effectively run as if it were the following? public void doStuff(User user) { if(!user.hasPrivilege("foo")) throw new UserHasInsufficientPrivileges(); // this is a RuntimeException // ... } I ...