Android MVP – Should avoid using R.string references in presenter?

I consider that there’s no reason to call any android code in Presenter (But you always can do it). So in your case: View / activity onCreate() calls -> presenter.onCreate(); Presenter onCreate() calls -> view.setTextLabel() or whatever you want in the view. Always decouple Android SDK from presenters. In Github, you can find some examples … Read more

Show Dialog from ViewModel in Android MVVM Architecture

UI-related actions like opening new activities or showing dialogs are triggered from the view (an activity or fragment), not from a ViewModel. The ViewModel doesn’t have a reference to the view to prevent leaks and keep the presentation layer “reactive”. You can subscribe your view (activity or fragment) to an observable in the ViewModel so … Read more

Ruby on Rails patterns – decorator vs presenter

A decorator is more of a “let’s add some functionality to this entity”. A presenter is more of a “let’s build a bridge between the model/backend and view”. The presenter pattern has several interpretations. Decorators are generic/general purpose. Presenters have a narrower range of responsibilities/uses. Decorators are used across domains, presenters are almost always related … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)