apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

Home Page:https://seata.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SeataAutoDataSourceProxyCreator's override about AbstractAutoProxyCreator#wrapIfNecessary is unnecessary and non-compliant

PleaseGiveMeTheCoke opened this issue · comments

commented

The AbstractAutoProxyCreator's wrapIfNecessary method does not expect to be overridden by subclasses, whereas getAdvicesAndAdvisorsForBean and shouldSkip expect to be overridden by subclasses even more.
The logic of SeataAutoDataSourceProxyCreator's override of wrapIfNecessary can be done entirely in getAdvicesAndAdvisorsForBean and shouldSkip.

For example, the logic in the red box below can be done entirely in shouldSkip
image
Meanwhile, the following logic for SeataDataSourceProxy creation can be done entirely in getAdvicesAndAdvisorsForBean, passing the created proxy to SeataAutoDataSourceProxyAdvice via the constructor
image

This also means that the existence of the DataSourceProxyHolder is unnecessary