Morning (from Denmark) guys. Quick question regard...
# android
Morning (from Denmark) guys. Quick question regarding "best practices". Would you add your business logic to an activity rather than a fragment? I'm talking specifically about making an HTTP request to fetch data, which are displayed in only 1 fragment. (List of students). Other two fragments don't use these data, but will perform different HTTP requests in the future. Therefore, in my opinion it would make sense to separate this logic between fragments instead of keeping everything in the MainActivity. I'll be happy to hear your opinions. Cheers.
Business logic shouldn't be in the activity nor in the fragment. Both of those classes are meant to deal with the display of information. The business logic should be in a separate class called by your fragments.
👍🏼 4
👍🏼 1
I thought we went back to previous Android 4.0.3
Bussiness Logic should never be in neither. Put it in a ViewModel, or Presenter
👍🏼 3