Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    -1: In theory this makes sense. It practice it doesn't; at least on the Android side of things. For instance, where do services and broadcast receivers come into the mix? How do you save state when the phone's orientation changes or when the user switches to another task? Are you really going to shoehorn all of that logic into a model so that it remains device-agnostic? And are you preaching from an ivory tower or have you actually shipped iOS and Android apps? If you haven't actually shipped any apps, then you really shouldn't be recommending best practices. Commented Dec 30, 2013 at 2:35
  • I agree with you Jim regarding the business that is put in the model but I would also like to see what is your general approach on this? I don't want to see some sort of miracle code that fits with all the mobile projects, but I do consider that a low level architecture pattern should still be available for most of the projects. Thank you! Commented Dec 30, 2013 at 9:47
  • 2
    @JimG. I’ve updated my answer. I hope I’ve addressed your concerns. Commented Dec 30, 2013 at 16:00
  • @JefferyThomas can you please elaborate little more on how to achieve your approach on this Model data and Business Logic?As you have said, Model must be able to encapsulate data related to an entity of the application we build, plus be able to validate data when it's used to contain data or transport data. In code level how to do this? Do you do the data validation within the model and passes the errors to the view if the validation failed? I can agree with you, but the question for me is how to achieve this in the code level when it's on iOS! Please guide! Commented Mar 16, 2015 at 18:30
  • @Vishman I hope my Objective C examples helps. Commented Mar 17, 2015 at 11:12