-
-
Notifications
You must be signed in to change notification settings - Fork 5
Sharing clients
Domino-rest works in both the browser and in a pure JVM, and the same generated rest-client can be used on both sides, so there is no need to generate different clients for the browser and JVM, this also includes Android applications - for android applications please checkout domino-rest-android.
Now assuming you have a GWT application that is split into 3 modules, client
, shared
, and server
, then you can use domino-rest in 3 modes, switching between the different mode is a matter of what/where dependencies are defined and where the service definition interface is defined :
To define the interface and use the generated rest-client from client code only use the following dependencies in the client module pom.xml
<!-- Lib dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-client</artifactId>
<version>1.0.0-RC3</version>
</dependency>
<!-- Annotation processor dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-processor</artifactId>
<version>1.0.0-RC3</version>
<scope>provided</scope>
</dependency>
also, define the service interface in the client module.
To define the interface and use the generated rest-client from server code only use the following dependencies in the server module pom.xml
<!-- Lib dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-jvm</artifactId>
<version>1.0.0-RC3</version>
</dependency>
<!-- Annotation processor dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-processor</artifactId>
<version>1.0.0-RC3</version>
<scope>provided</scope>
</dependency>
also, define the service interface in the server module.
To define the interface and use the same generated rest-client from both client module -browser- and server module distribute the dependencies as the following :
- in the client module pom.xml
<!-- Lib dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-client</artifactId>
<version>1.0.0-RC3</version>
</dependency>
- in the server module pom.xml
<!-- Lib dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-jvm</artifactId>
<version>1.0.0-RC3</version>
</dependency>
- in the shared module pom.xml
<!-- Lib dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-shared</artifactId>
<version>1.0.0-RC3</version>
</dependency>
<!-- Annotation processor dependency-->
<dependency>
<groupId>org.dominokit</groupId>
<artifactId>domino-rest-processor</artifactId>
<version>1.0.0-RC3</version>
<scope>provided</scope>
</dependency>
also, define the service interface in the shared module, and since both client and server depending on the shared module, you can use the same generated client on both modules.
- Home
- Quick start
- Sharing clients
-
Configuration
- Locating resource classes
- Service root
- Resource root
- Http methods
- Service method path mapping
- Service path
- Query parameters
- Path parameters
- Header parameters
- Date format
- Request body
- Request and Response mapping
- Produces and Consumes
- Success codes
- Timeout and maximum retries
- With credentials
- Custom request URL
- Global interceptors
- Default failed response handler
- Interface inheritance
- Multipart form data