I’m facing some issues related to code duplication when following MVP architectural pattern in an Android project that I’m working with. My project structure is separated by packages: data, domain, infra, ui. Inside ui package there are another packages for each screen of the app. Most of them contains this structure:
- Contract: contains two interfaces, one for the view and another for the presenter;
- Activity: which inherits view interface and implements some methods;
- Presenter: contains very little business rules and communicates with my model;
I have another two interfaces (BaseView and BasePresenter) for the minimum of a View and a Presenter needs to implement.
Some of my screens has so much common code. They differ basically in layout and some specifics. This behavior occurs due to adoption of MVP rules (each view has its presenter).
I have found two answers for this issue on SO:
- How can one presenter be used for multiple views in MVP
- How to reuse common code between presenters
One suggests the creation of a base presenter class with common methods or an abstract class and the other accepts how the things are. I’m going to implement the base presenter or the abstract class, which leads to my question:
Based on the mentioned structure how can I achieve a good result without affecting or hurts a little this structure? Do I create a new package for this abstract class or base presenter? I believe this approach dirts the whole structure. So, what do I need to do?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!