1. Building
The Codion framework is built with Gradle and includes the Gradle Wrapper with a toolchain defined, so assuming you have cloned the repository and worked your way into the project directory you can build the framework by running the following command.
gradlew build
Note
|
This may take a few minutes, depending on the machine. |
To install the Codion framework into your local Maven repository run the following command.
gradlew publishToMavenLocal
2. Running the demos
Note
|
The demos use an embedded in-memory database, so changes to data do not persist. |
2.1. Local database connection
You can start by running a client from one of the demo projects (employees, chinook, petstore or world) with a local database connection.
gradlew demo-chinook:runClientLocal
2.2. Remote database connection
In order to run a client with a remote or http connection the remote server must be started first.
gradlew demo-server:run
To run a demo client with a remote connection use the following command.
gradlew demo-chinook:runClientRMI
You can run the Server Monitor application to see how the server is behaving, with the following command.
gradlew demo-server-monitor:run
Note
|
The client handles server restarts gracefully, you can try shutting down the server via the Server Monitor, play around in the client until you get a 'Connection refused' exception. After you restart the server the client simply reconnects and behaves as if nothing happened. |
3. Code style
After having wrestled with many code formatters and never being fully satisfied with the result, I’ve wound up relying on IntelliJ for code formatting.
The project has a defined code style which can be found in the .idea/codeStyles
folder.