You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/16 10:01:18 UTC

[GitHub] [dubbo] wxbty opened a new issue, #10946: URL code optimization

wxbty opened a new issue, #10946:
URL: https://github.com/apache/dubbo/issues/10946

   In the url part of dubbo, I saw some unreasonable designs, maybe we can refactor and optimize it.
   
   For example, the most basic parent class URL should ensure the integrity of its own attributes. See #10921.
   
   There are some others, such as:
   
   1. Single attribute principle. 
      ![image](https://user-images.githubusercontent.com/38374721/202143365-f0396960-d13e-43b9-8bb6-8981c640567f.png)
      There are multiple attributes here including host and port. Do we only need one host and port? Other places use the method to obtain, so when you want to dynamically modify the ip and port, only change one place instead of traversing
   2. Too much Overload does not look concise enough, although this is one of the characteristics of java
      Is it better to use the builder mode and load on demand?
   ![image](https://user-images.githubusercontent.com/38374721/202149674-12610c81-d839-448c-8c8f-b6162019d31f.png)
   3. The URL should only contain necessary attributes, such as host and port (maybe more, looks a bit like the first point), and cannot be overridden. The form of an abstract class may be better (it is meaningless to use it alone), and additional interface is also necessary
   


-- 
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@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wxbty commented on issue #10946: URL code optimization

Posted by GitBox <gi...@apache.org>.
wxbty commented on issue #10946:
URL: https://github.com/apache/dubbo/issues/10946#issuecomment-1319673201

   Ok, I will learn this and try to optimize it, thank you for your reply


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wxbty commented on issue #10946: URL code optimization

Posted by GitBox <gi...@apache.org>.
wxbty commented on issue #10946:
URL: https://github.com/apache/dubbo/issues/10946#issuecomment-1316858739

   If the discussion leads to a conclusion, I hope to try


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10946: URL code optimization

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10946:
URL: https://github.com/apache/dubbo/issues/10946#issuecomment-1319464851

   1. The role of many repeated attributes in the URL is to improve performance, and to get the ultimate performance experience by exchanging space for time
   2. `InstanceAddressURL` is a highly reusable object, which greatly reduces memory usage by sharing one object with multiple targets. See https://dubbo.apache.org/zh/docs3-v2/java-sdk/concepts-and-architecture/service-discovery/
   3. URLs are currently divided into `ServiceConfigURL` for configuration and `DubboServiceAddressURL` and `InstanceAddressURL` for recording server information according to usage scenarios. There will be a `consumerURL` attribute for configuring read priority configuration for recording server information. The difference between `DubboServiceAddressURL` and `InstanceAddressURL` is mainly at the interface level and application level.
   4. Based on the above situation, I think our more feasible way is to completely empty the URL into a strict interface, and let `ServiceConfigURL`, `DubboServiceAddressURL`, and `InstanceAddressURL` implement all functions correspondingly.


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org