Skip to main content
added common and diffent things in presenter
Source Link

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). The common functionality includes

  1. Load XML data from URL
  2. Set the loading progress bar in activity
  3. Removing the progress bar.
  4. 50% methods for setting the activity views will be common.
  5. Call the xml parser

The differences will be view specific:

  1. The fields are only 50% common.
  2. the action on button click

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? WhatWhich is the right way to do it in MVP? Or all are correct. design strategy?:

  1. Shall I use helper class
  2. Shall both presenters have the same base class.
  3. Shall i use the startegy pattern? What is the right way to do it in MVP? Or all are correct.

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.

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). The common functionality includes

  1. Load XML data from URL
  2. Set the loading progress bar in activity
  3. Removing the progress bar.
  4. 50% methods for setting the activity views will be common.
  5. Call the xml parser

The differences will be view specific:

  1. The fields are only 50% common.
  2. the action on button click

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.

Which is the correct design strategy?:

  1. Shall I use helper class
  2. Shall both presenters have the same base class.
  3. Shall i use the startegy pattern? What is the right way to do it in MVP? Or all are correct.
Title changed
Source Link

Shall I use the same presenter for multiple views in MVP 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.

What is the right way in MVP. ShallShall 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.

Shall I use the same presenter for multiple views in MVP

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.

What is the right way in MVP. 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.

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.

added 81 characters in body
Source Link

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. While the url(The URL for both views is different). 

My doubt is shall I use 2 presenters or one presenter for both the views. manyMany methods are different , while many are same in the 2 presenters.

What is the right way in MVP. 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.

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. While the url for both 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. 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?

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.

What is the right way in MVP. 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.

Source Link
Loading