Resultful distributed architecture

1. Create a new project [micro] module, the module provides API classes, including: public interface, DTO classes.

2. Create a DTO DTO of such information, such composition and the same class structure vo. (If the current project using MyBatis, so for the current DTO design is relatively tasteless, but if we want to use is SpringDataJPA, then DTO class can help users hide the PO class (there are a number of important notes) of compositional structure.)

package com.yootk.dto;
import java.io.Serializable;
public class DeptDTO implements Serializable {
    private  Long deptno;
    private String dname;
    private String loc;
//setter(),getter(),toString()方法略...
}

3. [micro] pom modify files, configuration dependencies additionally api module: definition of the dependencies into micro-api, facilitate the introduction behind the other modules in the module.

4. [micro] create "micro-provider-dept-8001" micro-services, and the introduction of the corresponding dependent libraries.

5. [micro-provider-dept-8001] create vo class description sector, the vo class only survive in the current RPC server

Guess you like

Origin www.cnblogs.com/wxl123/p/11257683.html