Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
스프링 AOP 애스팩트 관련 질문 있습니다~!
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
고종봉  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 9:23 pm
From: 고종봉 <mercujj...@gmail.com>
Date: Mon, 17 Jan 2011 11:23:56 +0900
Local: Sun, Jan 16 2011 9:23 pm
Subject: 스프링 AOP 애스팩트 관련 질문 있습니다~!

안녕하세요? 월요일을 힘차게 시작하고 계신지요?

오늘은 스프링 AOP 애스팩트와 관련된 질문을 올리고자 합니다.

<aop:config>
<aop:aspect id="xxxAspect" ref="yyyAspect">
<aop:around method="yyyAround" pointcut="execution(* com..*Logic.*(..))"/>
</aop:aspect>
</aop:config>
 <bean id="yyyAspect" class="com.my.YyyAspect">
</bean>
 <bean id="zzzLogic" class="com.my.ZzzLogic">
</bean>
위와 같이 zzzLogic에 yyyAspect의 yyyAround 어드바이스를 적용하고

zzzLogic의 a()라는 메서드에서 zzzLogic 내의 b()라는 메서드를 호출했을 시

전체적으로 yyyAround가 한번 적용될지, 두번 적용될지 궁금합니다.

혹시 관련되어 내용을 알고 계신 분 있으시면 도움 부탁드립니다. ^^

그럼, 오늘도 즐거운 하루 되세요~!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
백기선  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 10:34 pm
From: 백기선 <whiteship2...@gmail.com>
Date: Mon, 17 Jan 2011 12:34:22 +0900
Local: Sun, Jan 16 2011 10:34 pm
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

AOP 설정 의도에 따르면 두번 적용되야 맞는거지만, 프록시 기반 스프링 AOP 특성상 한번만 적용됩니다. 이에 대한 해결책이 있습니다.

http://static.springsource.org/spring/docs/3.0.x/spring-framework-ref...

여기 보시면 원인과 해결책이 잘 나와있으니 참고하세요.

2011년 1월 17일 오전 11:23, 고종봉 <mercujj...@gmail.com>님의 말:

--
좋은 하루 되세요~

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
고종봉  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 11:28 pm
From: 고종봉 <mercujj...@gmail.com>
Date: Mon, 17 Jan 2011 13:28:49 +0900
Local: Sun, Jan 16 2011 11:28 pm
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

답변 감사합니다. ^^

어차피 한번만 호출되길 바라기 때문에, 스프링 프록시 기반의 방식이 더 적합할 듯 보입니다.

2011년 1월 17일 오후 12:34, 백기선 <whiteship2...@gmail.com>님의 말:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
백기선  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 11:31 pm
From: 백기선 <whiteship2...@gmail.com>
Date: Mon, 17 Jan 2011 13:31:41 +0900
Local: Sun, Jan 16 2011 11:31 pm
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

구조적 문제에 의존하는 해결방법은 권하고 싶지 않군요.

포인트컷을 좀 더 세밀하게 설정하는게 좋치 않을까요.

2011년 1월 17일 오후 1:28, 고종봉 <mercujj...@gmail.com>님의 말:

--
좋은 하루 되세요~

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sewon Ann  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 11:40 pm
From: Sewon Ann <king...@gmail.com>
Date: Mon, 17 Jan 2011 13:40:08 +0900
Local: Sun, Jan 16 2011 11:40 pm
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

저도 기선님 의견에 동의합니다~

그런데 구체적인 방법에 무엇이 있을까요?

일단 생각나는 건 애노테이션을 붙이는 방법과 명명규칙이 생각나네요.

1. aop 대상 method에는 @AOPTarget (이름이야 더 잘 지어야겠지만) 등의 이름을 붙이고, bean 내부에서는 호출하지
않는다

2. aop 대상 method에는 ~~AOP (아, 이상하다..) 정도의 접미사를 붙이고, bean 내부에서는 호출하지 않는다?

그럼 이렇게 되겠네요.

class com.my.ZzzLogic {

@AOPTarget
a() {
 ~~
 b_for_inside();

}

@AOPTarget
b() {
 b_for_inside();

}
}

2011/1/17 백기선 <whiteship2...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
백기선  
View profile   Translate to Translated (View Original)
 More options Jan 16 2011, 11:44 pm
From: 백기선 <whiteship2...@gmail.com>
Date: Mon, 17 Jan 2011 13:44:34 +0900
Local: Sun, Jan 16 2011 11:44 pm
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

이 방법은 글쎄요... AOP 때문에 코드가 지져분해지는건 AOP 자체의 역할에도 위배되는것 아닐까요.

그냥 pointcut을 상세하게 적는게 좋을 듯 합니다. 예를들어, yyyLogic에 있는 a()는 public 메서드고 b()는
private이라면  public *..*Logic.*(..) 이런식으로 적을 수 있겠죠.

2011년 1월 17일 오후 1:40, Sewon Ann <king...@gmail.com>님의 말:

--
좋은 하루 되세요~

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sungchul Park  
View profile   Translate to Translated (View Original)
 More options Jan 17 2011, 12:05 am
From: Sungchul Park <gyu...@gmail.com>
Date: Mon, 17 Jan 2011 14:05:28 +0900
Local: Mon, Jan 17 2011 12:05 am
Subject: Re: 스프링 AOP 애스팩트 관련 질문 있습니다~!

> 어차피 한번만 호출되길 바라기 때문에, 스프링 프록시 기반의 방식이 더
> 적합할 듯 보입니다.

스프링 프록시 기반의 방식이 뭘 말하는 건가요? 그리고 더 적합하다는 건 무
엇과 비교해서 적합하다는 뜻인가요? 글타레를 읽다가 이 글 이후는 맥을 못
따라 가겠네요.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »