zhengyangyong commented on a change in pull request #40: Using java chassis in
spring boot dir translation
URL:
https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211842895
##########
File path:
java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md
##########
@@ -1,73 +1,73 @@
-java chassis支持使用Spring
MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java
chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring
MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。
-* 服务声明方式
+Java chassis supports the use of the label
\(org.springframework.web.bind.annotation\) provided by Spring MVC to declare
the REST interface, but the two are independent implementations and have
different design goals. The goal of the java chassis is to provide a
cross-language framework that supports multiple communication protocols.
Therefore, some features of Spring MVC that are not very good for
cross-language support are removed, and features that are strongly related to a
specific running framework are not supported, such as direct access to the
Servlet protocol definition. HttpServletRequest. Here are some notable
differences.
-Spring MVC使用@RestController声明服务,而java
chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring
MVC的标签还是使用JAX RS的标签。
+* Service declaration method
+
+Spring MVC uses @RestController to declare the service, and java chassis uses
@RestSchema to declare the service and needs to display the service path using
@RequestMapping to distinguish whether the service uses Spring MVC tags or JAX
RS tags.
```
@RestSchema(schemaId = "hello")
@RequestMapping(path = "/")
```
-Schema是java
chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。
+The schema is the service contract of java chassis, which is the basis of
service runtime. Service management, codec and so on are all based on contract.
In a cross-language scenario, the contract also defines the parts of the
language that can be understood simultaneously.
-* 数据类型支持
+* Data type support
-采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如:
+With Spring MVC, you can use multiple data types in a service definition as
long as it can be serialized and deserialized by json. Such as:
```
-// 抽象类型
-public void postData(@RequestBody Object data)
-// 接口定义
-public void postData(@RequestBody IPerson interfaceData)
-// 没指定类型的泛型
-public void postData(@RequestBody Map rawData)
-// 具体协议相关的类型
-public void postData(HttpServletRequest rquest)
+// abstract type
+Public void postData(@RequestBody Object data)
+// Interface definition
+Public void postData(@RequestBody IPerson interfaceData)
+// no generic type of the specified type
Review comment:
no generic type of the specified type 这个是机翻,直接generic type就可以了
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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