官术网_书友最值得收藏!

Project structure

The project contains two modules:

  • main module: This contains the development code
  • test module: This contains tests for the application

The main module contains:

  • Kotlin directory (similar to Java) where all the Kotlin is placed (note that it is not enforced that the Kotlin code goes into the Kotlin directory, but it is a good convention to follow. In case you place it under another directory, then make sure to make appropriate changes to build.gradle).
  • Resources directory contains static resources such as HTML, CSS, JS, and images for the web application.

Here is the package structure with the base package as com.book that we follow. Feel free to follow a similar structure in your projects:

  • db: This contains database related code (Exposed library code)
  • domain: This contains our data classes or model classes
  • repository: This contains our repository classes which abstract the database interaction
  • utils: This contains Extensions functions and some utility functions
  • web: This contains the URL controllers

The following screenshot shows the project structure:

For this project, we are going to use Kotlin v1.1.50, which is the latest version at the time of writing and IntelliJ IDEA to build the application.

主站蜘蛛池模板: 禹城市| 大姚县| 孝义市| 临湘市| 雷波县| 攀枝花市| 商河县| 北宁市| 明星| 卓尼县| 平顺县| 唐海县| 开江县| 池州市| 于都县| 奉化市| 弥勒县| 宣城市| 南溪县| 繁峙县| 佛山市| 高雄市| 内乡县| 寿阳县| 县级市| 石棉县| 泸西县| 峨眉山市| 昭平县| 普定县| 太原市| 安庆市| 鹿邑县| 揭东县| 凭祥市| 拉孜县| 邯郸市| 佛学| 罗源县| 铁力市| 田林县|