Все вопросы: [aop]

167 вопросов

похожие теги: spring-aop
12
голосов
2ответов
2469 просмотров

Whats the difference between PostSharp and Castle Dynamic Proxy?

Just wondering what the main differences are between these libraries, how they differ in features and functionality. Hoping for more information than I could find with a Google query...

18
голосов
4ответов
7904 просмотров

Traditional logging vs AOP logging

I'm starting this new project and we are thrashing out our logging/debugging approach and I wanted to put the question to the rest of you on SO, given private final static Logger logger = LoggerFactory.getLogger(getClass()); ... public void doSumething(){ ... if(logger.isDebugEnabled()) logg...

3
голосов
1ответов
647 просмотров

Refactoring nasty legacy systems via AOP or other automated means?

I've recently been playing around with PostSharp, and it brought to mind a problem I faced a few years back: A client's developer had produced a web application, but they had not given a lot of thought to how they managed state information - storing it (don't ask me why) statically on the Applica...

0
голосов
2ответов
200 просмотров

Marking a 3rd party class property as required (Java/Spring)

Recently, I hit a very perplexing error while trying to clean up my spring configs. The exception was being thrown from deep within a third party library and was basically an obfuscated NPE. What I would like to be able to do is configure spring to require a specific field on this class as being...

11
голосов
1ответов
1729 просмотров

PostSharp: Custom attributes are removed when using OnMethodInvocationAspect

I've got some aspect like this: public class MyAttribute : OnMethodInvocationAspect { public int Offset { get; internal set; } public MyAttribute(int offset) { this.Offset = offset; } public override void OnInvocation(MethodInvocationEventArgs eventArgs) { ...

2
голосов
3ответов
286 просмотров

What is the best way to "adorn objects with functionality"?

I made the example below which enables a factory to pack objects with functionality, but the problem is that the functionality is divorced from the object. My ultimate goal is attach functionality such as log, and save and display which operates on the specific properties that each different ob...

0
голосов
3ответов
175 просмотров

Software Applications Designs

Is strict OOD/Interface-based design/Aspect oriented design is desirable in case of a software application development? Or, is it desirable to mix all of them for the ease of coding? Are all successful and highly maintainable software applications strictly Object oriented, or, strictly Interfac...

8
голосов
2ответов
2010 просмотров

Best Aspect Oriented Framework for features / build performances in .net

In various projects I worked with, we had to use some AOP or dependency injection framework. We used Enterprise LIbrary, Unity and PostSharp. For now, Postsharp is my best choice when it comes to the flexibiity I get over how I generate my aspects. The only problem is the build time required...

2
голосов
6ответов
350 просмотров

Config files containing environment-specific settings

In my organization we have multiple environments (Dev, QA, Stage, Prod, Disaster Recovery) and I would like my app/web.config files to contain no environment specific details in URIs, connections strings, etc. My preferred approach would be to perform run-time substitution, e.g. Instead of this: ...

2
голосов
3ответов
656 просмотров

Interesting AOP question on a cross cutting concern?

Consider a set of DOAs with methods similar to this public void addObject(Long sessionId, Long clientId, Dom obj){...} Now every domain pojo (Dom) has a sessionId property and for every insert, update or delete on a domain object a sessionId must be passed with setSessionId(Long sessionId)so w...

2
голосов
2ответов
117 просмотров

Monitoring Changes of a Bean to build deltas?

I have several Beans in my Application which getting updated regularly by the usual setter methods. I want to synchronize these beans with a remote application which has the same bean classes. In my case, bandwidth matters, so i have to keep the amount of transferred bytes as low as possible. My ...

0
голосов
1ответов
785 просмотров

Implementing INotifyPropertyChanged or similar custom event in base class

Is there a way to do this: I need to develop the easiest way to support registering to property changes of some class. Apart from manual way of adding INotifyProperyChanged support, is there a way to do it like this: class Base ... // all notification logic here class Child { public strin...

23
голосов
11ответов
5356 просмотров

Aspect-Oriented Objective-C Library?

Is there any Aspect-Oriented Objective-C library that I could perhaps use for iPhone development?

3
голосов
1ответов
1174 просмотров

How can I use a singleton class in AOP (aspect oriented programming)?

Language by choice is AspectJ but I am open for a generic answer.

3
голосов
1ответов
369 просмотров

Is it possible in Springframework 2.5.6 to have scope="session" create the object on session create

I've got a project using Jetspeed portal and Springframework 2.5.6 where I need a Jetspeed level service to be unique for each user logged in. This would be best done using Spring AOP and scope="session". The problem is, that these are behind the scenes beans that need to be running as soon as t...

1
голосов
1ответов
546 просмотров

NHibernate conversation with ASP.NET+IoC+PostSharp?

Does anybody know a good example of how an NHibernate conversation can be used in a Web context (ASP.NET or ASP.NET MVC) using an IoC container and AOP? Personally, I use Castle/Windsor and PostSharp, but I will appreciate everything that points me to the right direction.

0
голосов
3ответов
1634 просмотров

How can you handle cross-cutting conerns in JAX-WS without Spring or AOP? Handlers?

I do have something more specific in mind, however: Each web service method needs to be wrapped with some boiler place code (cross cutting concern, yes, spring AOP would work great here but it either doesn't work or unapproved by gov't architecture group). A simple service call is as follows: @...

2
голосов
1ответов
250 просмотров

AOP based object injection fails for class name starting with lower case

I am doing object injection using AOP. There exists a class which starts with samllcase (testClass) wherein the object is not getting injected. I converted the file name (legacy class) so that it starts with capital case (TestClass) and updated references in AOP.xml and spring-beans.xml containi...

3
голосов
4ответов
1170 просмотров

Aspect Oriented Programming: What do you use PostSharp for?

I would like to ask users of the AOP framework Postsharp, what specifically are you using the framework for? Also, I know it's use has a big negative impact on build times, but how about runtime performace? Is there much of a hit? Thanks, S

0
голосов
2ответов
220 просмотров

AOP can be use to share data among different running threads in application process?

UPDATE: I am 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. Can AOP be used to share data among different running threads in application process?

0
голосов
2ответов
252 просмотров

Adding aspect to an abstract method?

PostSharp gives this error: PostSharp: Cannot apply an OnMethodInvocation aspect (...) with target-site weaving on the abstract or external method "...". Consider excluding the aspect from this method or use call-site weaving. Suggested call-site weaving is not an appropriate solu...

12
голосов
8ответов
6589 просмотров

incompatible types found: required: default enums in annotations

[javac] C:\ws\galileo\test\Cacheable.java:13: incompatible types [javac] found : com.io.CacheType [javac] required: com.io.CacheType [javac] public CacheType id() default CacheType.COMMON; I really don't get this one. I have a project where I'm custom building a caching interceptor for Sprin...

1
голосов
1ответов
350 просмотров

Spring.NET does not use AOP AfterReturningAdvice

I am trying to use Spring.NET AOP in my project for logging purpose, and two advices work great, however, the third does not get used at all. Here is my wiring: <!-- the "After" Advice --> <object id="GraphicsContextManagerAfter" type="PicturetoolWeb.App.Advice.GraphicsContextManagerAf...

0
голосов
2ответов
2638 просмотров

PostSharp: OnMethodBoundaryAspect doesn't get called

I'm using PostSharp to apply a CompoundAspect to a ActiveRecord class (from CastleProject). The code looks like this: public override void ProvideAspects(object targetElement, LaosReflectionAspectCollection collection) { Type targetType = (Type)targetElement; RevertibleSubAspect revertib...

48
голосов
5ответов
37644 просмотров

Aspect Oriented Programming in C#

Are there any good resources to wrap my head around Aspect Oriented Programming? PS: I need to understand AO programming, not the libraries or frameworks available for .NET or C# :)

4
голосов
3ответов
2111 просмотров

Adding validations to Java Beans via Annotations

I want to add validations to a Java Bean. For example, I want to do the following: @MaxLength(50) @RequiredField public void setEmployeeName(String name){ ..... } I know I can write code that gets the validations for a specific method by calling method.getDeclaredAnnotation after all the b...

3
голосов
2ответов
343 просмотров

Aspect oriented programming in r: Any libraries available?

Are there any R-project packages that implement AOP? Or even better an example of an R package that uses any such AOP library.

15
голосов
3ответов
6204 просмотров

Mono Cecil vs. PostSharp Core vs. Microsoft CCI for implementing AOP framework

Which is the better in terms of capabilities, easy of use, documentation, samples, community/support, VS integration, known implementations, long-term viability, and build speed to implement a custom AOP framework? I'll start with what I know (I have only tried PostSharp to so far): Microsoft...

9
голосов
4ответов
1240 просмотров

Java: testing thread access to "not thread-safe" methods

My strategy for threading issues in a Swing Java app is to divide methods in three types: methods that should be accessed by the GUI thread. These methods should never block and may call swing methods. Not thread-safe. methods that should be accessed by non-GUI threads. Basically this goes for...

4
голосов
1ответов
700 просмотров

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.