In OpenSumi, a RemoteService is a specialized service designed exclusively for communication with the frontend. It acts similarly to a Controller in a layered architecture (Controller-Service-DAO), handling validation, logic, and scheduling for external requests.
Key Principles of Remote Services:
- 1-to-1 Communication: They facilitate direct communication between the frontend and backend.
- Lifecycle Management: A
RemoteService is instantiated only after a communication connection is established and cannot be re-instantiated. - Naming Convention: It is recommended that all
RemoteService classes end with the suffix RemoteService. - Isolation: Backend services (other than the frontend) are prohibited from referencing a
RemoteService via @Autowired to prevent state inconsistency and dependency issues.