3 ms·
I like your article a lot. I do have a hard time to map the layers you've described (Application, Logic, Infrastructure) to a mobile/frontend/ui application. F
by miensol 9y ago
I like your article a lot. I do have a hard time to map the layers you've described (Application, Logic, Infrastructure) to a mobile/frontend/ui application.
For instance in Android we've Activities/Fragments (and less commonly Views) as the entry points to the application code. From there we might have [View Models](https://developer.android.com/topic/libraries/architecture/viewmodel https://developer.android.com/topic/libraries/architecture/v...) and External API clients that are clearly infrastructure.
From what I've seen it is common to call the External API clients from ViewModels directly. (This is so we can test more logic outside of Android runtime, AFAIK.)
If I get the layers you've described we should instead let Activity/Fragment ask the ViewModel for some data and then use it to call the External API, correct?
- jdlshore 9y agoThanks, I'm glad you like it. I haven't done any Android work, so I'm not sure how the A-Frame Architecture applies. From my quick glance at the ViewModel documentation you linked, that looks like Application layer code: in the first example in that document, the `loadUsers()` call would turn around and call the actual a specific Infrastructure Wrapper responsible for communicating with the service that provides the users.