| Sign In/My Account | View Cart |
| Article: |
An Introduction to Aspect-Oriented Programming with the Spring Framework, Part 1 | |
| Subject: | The diagrams are wrong? | |
| Date: | 2004-08-19 04:44:10 | |
| From: | patrickchaumette | |
|
Hello Russ,
|
||
Showing messages 1 through 6 of 6.
The diagrams are wrong?
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"> <ref local="sessionFactory" /> </property>
</bean>
<bean id="loggingThrowsAdvice" class="com.myapp.aop.LoggingThrowsAdvice">
</bean>
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
<property name="preInterceptors">
<list>
<ref local="loggingThrowsAdvice" />
</list>
</property>
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"> <ref local="sessionFactory" /> </property>
</bean>
<bean id="loggingThrowsAdvice" class="com.myapp.aop.LoggingThrowsAdvice">
</bean>
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
<property name="preInterceptors">
<list>
<ref local="loggingThrowsAdvice" />
</list>
</property>
</bean>
hmmm, don't think you're necessarily wrong but I believe that conceptually (from an AOP view but not exactly how Spring implements things) the before() advice is executed before the call to the foo() method (this may and is indeed achieved using proxies in Spring, so you're spot on) but I was really aiming at getting the AOP principles across without getting too detailed on how Spring achieves this.
This is a practice that is getting to be more and more common in the AOP field, focussing on what the AOP directives are specifying and losing some of the focus on the particulars of how a specific implementation would achieve those directives. So I think you're right but I think the concepts the diagrams are putting across are still valid.
Hope that clears things up a bit and thanks for the comment :)
Cheers