DEV Community

LiHan
LiHan

Posted on • Edited on

[Android] UserListApp - Folder Create - Part2

Package

  • feature_user
    • data
      • repository
      • local
        • model
      • remote
        • model
    • domain
      • model
      • repository
    • di
    • presentation

Data

  • local -> Roomdatabase (Android內建的資料庫)
    model -> XXXEntity.class

  • remote -> Retrofit (需要調用網路)
    model -> XXXDto.class

  • repository -> “實作”獲取資料的介面Interface


Domain

  • model -> 主要是內部使用的class(用來顯示的類別)
  • repository -> 獲取資料的介面Interface
  • util -> mapper (Dto , Entity to Model) ex: UserDto , UserEntity -> User

Presentation
-> Screen(Compose)
-> ViewModel
-> Component

Top comments (0)