Summary
In this chapter, we’ve developed a thoroughly tested service using Kotlin, employing the Ktor framework for web functionalities and Exposed for database operations. We delved into Ktor’s use of design patterns, such as Factory, Singleton, and Bridge, which offer a flexible and well-organized framework for our code.
We delved into database interaction using the Exposed framework, learning how to declare, create, and drop tables, as well as how to insert, fetch, and delete entities. Additionally, we’ve seen the application of Ktor’s HTTP client to make requests to external services, enriched by its support for JSON serialization and asynchronous operations.
We briefly touched on the Exposed framework’s features. Apart from the DSL API used in this chapter, Exposed also offers a DAO API, allowing interaction with objects instead of writing DSL queries. For further reading, see https://github.com/JetBrains/Exposed/wiki.
Moreover,...