Giter VIP home page Giter VIP logo

Comments (3)

konmik avatar konmik commented on August 21, 2024

Hi, what are PresenterHelper specific tasks? :)
For me this class looks like a collection of shortcuts to not bloat views.
This is why it keeps a reference to an activity.
Do you have a clearer definition for it?

from nucleus.

rharter avatar rharter commented on August 21, 2024

My thought was that, aside from the activity reference, this class is a really easy drop-it-anywhere helper for managing a presenter instance. User's can drop it in any type of class they want to have a managed presenter in, and all of the null safety checks and PresenterManager logic is abstracted.

The problem I see with helper keeping a reference to the activity and managing destroy based on that, is that that's the single piece of this class that prevents it from being general use. As an example, some project I've inherited use a single Activity model, where all navigation is done using Fragment transactions. The current PresenterHelper would be of no use there since if presenters were only destroyed when the Activity was finishing, they would never be destroyed until you leave the app.

What I would like to see is the activity.isFinishing() moved up to the Nucleus[Activity|Fragment|Layout] base classes as default functionality, thereby making the PresenterHelper a generally reusable class.

I think it's a fairly simple change, and I'm happy to make it if you agree, just wanted to open this ticket to foster discussion.

from nucleus.

konmik avatar konmik commented on August 21, 2024

This change will bloat existing classes to some degree, but the ability to reuse the helper looks good. OK.

from nucleus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.