Skip to main content
3 of 4
Title changed

How to reuse common code between presenters

In my application there are 2 views both have 70% common fields like name, icon etc. One view is about list( contains 2-3 fields). On clicking the list , the next view which is the details should be called.

Other functionality in both views is same. e.g while loading , presenter will be called to load data from the url. (The URL for both views is different).

My doubt is shall I use 2 presenters or one presenter for both the views. Many methods are different , while many are same in the 2 presenters. I am planning to use 2 presenters. But many code is same for both presenters. How to reuse code between presenters.

Shall I use helper class, or shall both presenter have the same base class. Or shall i use the startegy pattern? What is the right way to do it in MVP? Or all are correct.