How dinokey/simple-grpc-server works
Main Components
• gRPC Server: This is the central component where the application runs. Represent it as a primary container.
• Service Layer:
• Employee Service: Represent the business logic encapsulated in EmployeeService.java and its related proto definition (employeeService.proto).
• Salary Service: Represent the business logic encapsulated in SalaryService.java and its related proto definition (salaryService.proto).
• Protocol Buffers Definitions: Indicate the proto files (under src/main/proto) which define the gRPC service contracts and message types (employee.proto and salary.proto). This identification shows the contract between the client and the server.
• Application Entry Point: DemoApplication.java acts as the bootstrap for the server initialization.
• Configuration and Resources: The application.properties in src/main/resources holds configuration settings for the server.
• Build and Deployment: Represent Gradle build scripts and wrapper files showing the build and dependency management aspect.
Depicting Relationships and Interactions
• A connection from each service back to the respective proto definitions to illustrate that the service layer relies on the pre-defined Protocol Buffers contracts.
• A testing block that connects to the gRPC Server, representing the integration tests (DemoApplicationTests.java).
Important Architectural Patterns
• Separation of Concerns: The system design clearly separates the API specification (proto files) from the business logic implementation (service classes) and the application bootstrapping (DemoApplication).
• Standard Build Process: Include the Gradle build process as an integral part of deployment preparation.