tristaZero edited a comment on issue #5168: [DISCUSS] Simplify the configuration API of ShardingKeyGenerator on spring namespace URL: https://github.com/apache/incubator-shardingsphere/issues/5168#issuecomment-613183666 Hi I prefer the second one @kimmking mentioned, i.e, > <sharding:key-generator id="orderKeyGenerator" column="order_id" type="INCREMENT" /> Firstly, IMO, it is better to hide `org.apache.shardingsphere.shardingjdbc.spring.namespace.factorybean.KeyGenerateAlgorithmFactoryBean` which id internal class of ShardingSphere from user. Secondly, like the picture below shows, the beans of `ShardingAlgorithm` and `KeyGenerateAlgorithm` have a similar format but with a different meaning, which is likely to confuse the user. ```xml <bean id="preciseModuloDatabaseShardingAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.algorithm.PreciseModuloDatabaseShardingAlgorithm" /> <bean id="preciseModuloTableShardingAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.algorithm.PreciseModuloTableShardingAlgorithm" /> <bean id="rangeModuloTableShardingAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.algorithm.RangeModuloTableShardingAlgorithm" /> <bean id="defaultComplexKeysShardingAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.algorithm.DefaultComplexKeysShardingAlgorithm" /> <bean id="defaultHintShardingAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.algorithm.DefaultHintShardingAlgorithm" /> ------------------ <bean id="incrementAlgorithm" class="org.apache.shardingsphere.shardingjdbc.spring.namespace.factorybean.KeyGenerateAlgorithmFactoryBean"> <property name="type" value="INCREMENT" /> </bean> ``` 
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
