|
From: Alexandru P. <the...@gm...> - 2005-08-29 12:34:43
|
#: Eugene Kuleshov changed the world a bit at a time by saying on 8/29/2005 2:06 PM :# > Alexandru Popescu wrote: > >>> After returning advice is indeed processed in the opposite order. >>> Since the method invocation moves back up the advisor chain the last >>> advisor is processed first, then the second to last and so on until >>> all advisors have been processed. >>> >>> If you would chain an number of around advices (method interceptors) >>> they would also be processed in the inverse order once the target >>> method exits although they have been called in the expected order when >>> the method invocation starts. >> >> This looks to me pretty unintuitive, because we are talking about >> after advices. The rules you are exposing are correct, but they apply >> to around advice. I imagine that this is caused by the fact that >> Spring doesn't have real before and after advices, but rather it is >> emulating them using always around (this is true for all proxy based >> aop solutions). > > First of all there are explicit Before and After advices semantically > possible with Spring. It has very little todo that actual implementation > is using proxy, which is always gives an around advice. imo it doesn't matter that you are implementing Before or After as long as you refere to them as advices/interceptors and they are proxies. You will always have this ordering, because they are in fact around advices and the rules for around advices are those exposed before. this is just my opinion and I don't see any gain from continuing an argument on this matter :-). take care, :alex |.::the_mindstorm::.| > Note, that nothing actually stops user to implement Before and After > interfaces in the same class and put it into the list of advices (even > mixed with around advices). So, current behavior seems very logical if > you'll take this fact into the account. > > regards, > Eugene > |