MetaMask / metamask-android-sdk

MetaMask SDK for Android
Other
36 stars 14 forks source link

[Android] Implementing a Pure Model Layer Object as an Option for Developers #37

Closed ezgi-cengiz closed 9 months ago

ezgi-cengiz commented 9 months ago

Description:

The current Android SDK design requires developers to access SDK components through the EthereumViewModel. While ViewModel is a powerful component for UI-related data management, it's more aligned with the presentation layer. Given that the SDK doesn't always add UI to the Dapp, this design decision can be more flexible. Developers should be given an option to interact with purely model layer objects, ensuring a clear separation of concerns and better architectural layering.

Task:

Introduce a pure model layer object in the Android SDK that allows developers to interact with SDK components without going through EthereumViewModel. This will allow developers to maintain a clear separation between the model, view, and controller layers. Developers can handle UI and other app-specific logic independently if they want to.

Acceptance Criteria:

The SDK should provide as an option a pure model layer object that's decoupled from ViewModel. Developers should be able to access all necessary SDK components and functionalities through this model layer object if they want to. The existing EthereumViewModel design should remain intact for developers who prefer that approach.

amuyu commented 9 months ago

I also use the SDK, but I couldn't use it because Dagger-Hilt and ViewModel dependencies were tightly coupled. (My app is already built and follows a different architecture. For instance, I use Koin instead of Hilt.) It would be great if they could be separated into modules (core, ViewModel, etc.) for selective usage.