You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/11 07:16:14 UTC

[GitHub] [shardingsphere] terrymanu opened a new issue #12366: Example need to improve

terrymanu opened a new issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366


   The current example is little mess. The structure is:
   
   ```
   example-core
   --config-utility
   --example-api
   --example-raw-jdbc
   --example-spring-jpa
   --example-spring-mybatis
   
   shardingsphere-parser-example
   
   shardingsphere-jdbc-example
   --sharding-example
   --transaction-example
   --other-feature-example
   --cluster-mode-example
   --cluster-mode-example
   
   shardingsphere-proxy-example
   --shardingsphere-proxy-hint-example
   --shardingsphere-proxy-boot-mybatis-example
   ```
   
   The disadvantages are:
   
   1. The category of example is not in same abstract level;
   2. The example is not clear enough, there are too common in `example-core` module, user do not need to understander them;
   3. Proxy do not need java connect example, config only is enough.
   
   It is better to make one example as independent, the lots of duplicated codes can consider about use code generation engine.
   
   It is better to adjust example structure as:
   
   ```
   to be continue...
   ```
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079719402


   @totalo Thank you for the great job!
   The example enhancement is completed nearly.
   
   There are still some tasks need to be done:
   
   1. `product`, `mode` and `transaction` in config.yaml could be use multiple values, it is better to name them as `products`, `modes` and `transactions`.
   2. I noticed that example of Proxy can not use mix rule configuration, maybe we can improve it to keep same as JDBC.
   3. The data model is for config loading and template together, we can consider about split them, just add a config object to load config.yaml only. The config.yaml can generate lots of examples, so the config object can derive lots of data model objects. 
   4. It is better to add verification for `config.yaml`, to reminder the config error to end users.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079953416


   And one more suggestion we can do:
   It is better to split `ExampleMain.ftl` as each framework keep one.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-919676405


   Welcome, we can discuss more about it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1002965688


   > @totalo I noticed that some of the new examples could not work well, I want to confirm whether you have tested them, or that the development is not completed now.
   
   Hi, @menghaoranss, this work is still in progress, and there may be some problems with each example. When it is officially launched and used, I will confirm again. In this process, if I have problems with understanding a certain function, please also point it out, thanks~


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu edited a comment on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu edited a comment on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079719402


   @totalo Thank you for the great job!
   The example enhancement is completed nearly.
   
   There are still some tasks need to be done:
   
   1. `product`, `mode` and `transaction` in config.yaml could be use multiple values, it is better to name them as `products`, `modes` and `transactions`.
   2. I noticed that example of Proxy can not use mix rule configuration, maybe we can improve it to keep same as JDBC.
   3. The data model is for config loading and template together, we can consider about split them, just add a config object to load config.yaml only. The config.yaml can generate lots of examples, so the config object can derive lots of data model objects. 
   4. It is better to add verification for `config.yaml`, to reminder the config error to end users.
   5. We can remove or deprecated the original example if our new example ready.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1081364303


   One more thing: we can consider about use template to generate test cases which can assert the data sources are connected and work fine.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-924850049


   After discussion with @terrymanu , there are mainly the following two parts
   1. The proxy uses the original yaml configuration, regardless of the way the template is generated.
   2. The jdbc repeated code uses a template method, and the metadata of the data model comes from the yaml configuration file. Users only need to modify yaml to generate sample code with one click.
   
   More suggestions?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079721715


   > @totalo Thank you for the great job! The example enhancement is completed nearly.
   > 
   > There are still some tasks need to be done:
   > 
   > 1. `product`, `mode` and `transaction` in config.yaml could be use multiple values, it is better to name them as `products`, `modes` and `transactions`.
   > 2. I noticed that example of Proxy can not use mix rule configuration, maybe we can improve it to keep same as JDBC.
   > 3. The data model is for config loading and template together, we can consider about split them, just add a config object to load config.yaml only. The config.yaml can generate lots of examples, so the config object can derive lots of data model objects.
   > 4. It is better to add verification for `config.yaml`, to reminder the config error to end users.
   > 5. We can remove or deprecated the original examples if our new examples are ready.
   
   It's my pleasure, I will continue to push forward and continue to improve related functions.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-918892840


   hi, I want to finish this job. plz assgin to me. thanks.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-924860780


   LGTM


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] totalo commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
totalo commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079958099


   > And one more suggestion we can do: It is better to split `ExampleMain.ftl` as each framework keep one.
   
   ok, i will do it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] menghaoranss commented on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1001849475


   @totalo I noticed that some of the new examples could not work well, I want to confirm whether you have tested them, or that the development is not completed now.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu edited a comment on issue #12366: Example improvement plan

Posted by GitBox <gi...@apache.org>.
terrymanu edited a comment on issue #12366:
URL: https://github.com/apache/shardingsphere/issues/12366#issuecomment-1079719402






-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org