??Java??????????
?????????????????? ???????[ 2017/3/31 10:33:32 ] ????????Java ???????????
????д?????
??????????????????????????????????????Щ?????????????η????Щ?????????????????????????????????????Java?????????????????????????????????????
????????????????????????
ShareChannelManager.java
publicResultDO<String>shareChannel(intshareCode){
if(ShareCodeUtil.share2A(shareCode)){
//TODO???????A????????????????
}
if(ShareCodeUtil.share2B(shareCode)){
//TODO???????B????????????????
}
...????n...
}
????shareChannel???????????????????????????·???????????????????????д????????????????棬??ú????????????????????????????????????????????????????????????????????????????????????Υ????Java??????????
??????????Java??????????
????Java????????????????????ì???feel????????????????????????????????????????????????**????**&***???**??Java????????????????????????????????????????????????????·??????????????????????????????????????????????????????????????????????0??1?????????????????????????????????????????????????????????????????????????б?????????????
?????????Java??????????????????????
????-?????????????
????-????????????
?????????????????????????????????????????
?????·???????????????????????á?????????????????????????????????????
?????????????????
publicclassShareChannelChain{
privatefinalLoggerLOG=LoggerFactory.getLogger(this.getClass());
/**
*??????????
*/
privateList<ShareChannel>shareChannels;
publicResultDO<String>share(intshareCode){
for(ShareChannels:shareChannels){
ResultDO<String>r=s.share(shareCode);
}
}
???????????????????
????publicinterfaceShareChannel{
????publicResultDO<String>share(intshareCod);
????}
????A????????
publicclassAChannelimplementsShareChannel{
@Override
publicResultDO<String>share(intshareCode){
//TODO????A???????
}
}
????B????????
publicclassBChannelimplementsShareChannel{
@Override
publicResultDO<String>share(intshareCode){
//TODO????B???????
}
}
??????AChannel??BChannel??????????????ShareChannelChain??
<beanid="AChannel"class="com.test.AChannel">
</bean>
<beanid="BChannel"class="com.test.BChannel">
</bean>
<beanid="shareChannelChain"class="com.test.ShareChannelChain">
<propertyname="shareChannels">
<list>
<reflocal="AChannel"/>
<reflocal="BChannel"/>
</list>
</property>
</bean>
??????????????????
????ShareChannelManager.java
????publicResultDO<String>shareChannel(intshareCode){
????ShareChannelChain.share(shareCode);
????}
????????????£?????????????????????
???????????μ????????????????CChannel???????????????????β?????ShareChannelManager??????????????????????CChannel?????ShareChannel???share?????????????xml???ɡ???????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11