JackEblan / Geto

Apply custom settings to your apps.
GNU General Public License v3.0
253 stars 9 forks source link

Restructure the modules #222

Closed JackEblan closed 23 hours ago

JackEblan commented 2 days ago

Move this to a read only property

https://github.com/JackEblan/Geto/blob/250114fea36b485c5754c3bae25a9193887e2ea3/foreground-service/src/main/kotlin/com/android/geto/foregroundservice/AndroidForegroundServiceManager.kt#L63

JackEblan commented 2 days ago

I think it's time for me to follow the clean architecture. Move all the contracts to the domain layer. It seems that I am struggling to structure my architecture right now.

JackEblan commented 2 days ago

I think it's time for me to follow the clean architecture. Move all the contracts to the domain layer. It seems that I am struggling to structure my architecture right now.

Why? For example in this function https://github.com/JackEblan/Geto/blob/250114fea36b485c5754c3bae25a9193887e2ea3/feature/service/src/main/kotlin/com/android/geto/feature/service/ServiceViewModel.kt#L45 I am forced to put a business logic inside the view model. This is from the frameworks and not the UI logic so view model should not handle this. I can't just put this to the domain layer as it will lead to circular dependencies because foreground-service module also depends on the domain module.

The best way to solve this is to move all the interfaces from frameworks to data into the domain layer. This way, I can make use cases more easily as I don't need to just import dependencies. Also domain should not depend on the outside, it's a standalone layer.