Dubbo Interface Design principle, service System Division __dubbo

Source: Internet
Author: User
Tags error code throw exception
Interface Design principle interface type
Simple data query interface: Action, façade, DAO with business logic data query interface: Action, façade, biz, DAO simple Data Write interface: Action, façade, DAO with business logic data write interface: action, Façade, biz, DAO Synchronous Interface design principles for asynchronous interfaces
Interface coarse grained an interface represents a complete business function
Reduce network interaction between systems to prevent the number of business interfaces explosion solve the problem of Dubbo interface. Interface version <dubbo:service interface= "com. Xxservice "version=" 1.0 "/>
Provides possible interface compatibility for late-stage incompatible upgrades
Compatible to:
Add method service model increase field incompatibility need to change version number
Delete method Delete model field Enum type new field is also incompatible with exception handling
Use throw exception to report error instead of return error code, exception information can carry
More information, and more semantically friendly.
If you are concerned about performance problems, if necessary, you can get rid of the exception class by override
The Fillinstacktrace () method is an empty method so that it does not copy stack information. The query method does not recommend throwing checked exceptions, otherwise the caller will
Many try...catch, and can not be effectively processed. Necessary interface input parameter verification

Configure consumer-side properties as much as possible on the provider
As a service provider, clearer service performance parameters than service consumers, such as timeout for calls, reasonable number of retries, etc.
After the provider configuration, consumer does not configure the provider configuration value, that is, the provider configuration can be used as the default value for consumer. Otherwise, consumer will use
Global settings for the consumer end, which are not controllable for provider, and are often unreasonable.

Service System Division Vertical division of the book according to business independence Notice of no status

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.