Project introduction

Get the specified data source content, through the relevant rules for data extraction, and then write into the database.

Strategic design

Field division

Subdomain Partitioning (Download Domain)

  • Core Subdomain (Download)

    Getting the contents of the corresponding data source is the goal of the current realm

  • Common domain (proxy)

    Proxy services can be used not only by the current domain, but also by providing services to others

  • Supporting subdomains (filtering, validation)

    Assist in getting content

Aggregate partitioning (download domain)

  • An aggregation of HTTP downloads composed of HttpEntity (HTTP web content download), HttpCommandValObj (download rules), FilterEntity (filter rules), ProxyEntity(proxy), and HttpCheckEntity (HTTP content validation) , the whole entity method invocation process is arranged, processed uniformly by HttpAggregate, and external domain services are provided.
  • Aggregations and subdomains are divided into domains from two perspectives: subdomains are divided vertically and aggregates are divided horizontally (process invocation).
  • Entities are stateful, they are guaranteed to be unique by their IDs, they are described by their properties by value objects, and they provide methods to change their contents. Value objects are stateless and unique by their attributes. They are immutable. The external methods are only data processing and extraction.

Strategic design

The code structure
Interfaces # # interface layer HTTP HTTP interface dto assembler # converter - > do dto controller mq... Service # is called to the interface layer with the parameter "do". Down to encapsulate field service domain # # # entity domain entity valobj value object factory # create entity factory service # # field service infrastructure base layer util config # configuration code # Generic Tools

Data transmission process

  • Clients interact with the interface layer, and they transfer data through DTOs
  • The interface layer converts DTOs into DOs through adapters and transmits them to the application layer
  • The application layer receives the DO, so I think the application layer should be domain-oriented, or the first domain in the process, so it can receive a value object for the main domain, a value object conversion between domains, you can add an adapter to the application layer, and the adapter recommends using a MapStruct
  • The domain layer interacts with the application layer through domain services, and value objects are transferred between them