Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ensureRequiredConstructor() to "protected" #572

Open
StephanSchuster opened this issue Nov 10, 2019 · 1 comment
Open

Change ensureRequiredConstructor() to "protected" #572

StephanSchuster opened this issue Nov 10, 2019 · 1 comment

Comments

@StephanSchuster
Copy link
Contributor

Quite often I don't want my apps to restore their last controller hierarchy after being killed on process death. Usually because I think the user wants to start fresh anyways and doesn't know where he left hours before.

I do this by calling Conductor.attachRouter(this, rootContainer, **null**) whenever I detect process death. Of course, instance state is saved anyways but I just ignore it on next start. So far so good.

Unfortunately, Conductor is not aware of this and still forces my controllers to have a default and a bundle constructor which I don't need/want in my case because my controllers do not need to be restored. The first enforcement is done by conductor-lint which I can luckily circumvent by having the two required constructors as protected in my BaseController. Okay.

The second and only thing left is that on creation of each controller ensureRequiredConstructor() is called at runtime and checks my controllers for these two constructors. If this method would be protected instead of private I could also override it in my BaseController which is aware of how I "configured" conductor and therefore can prevent these checks.

Is there any chance that ensureRequiredConstructor() can be changed to "protected"?
Or do you even plan to provide other options to configure conductor the way I want?

@StephanSchuster
Copy link
Contributor Author

@EricKuck: Any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant