Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Ctrl owns too much of the application #5

Open
ychen-atlassian opened this issue May 8, 2018 · 2 comments
Open

Ctrl owns too much of the application #5

ychen-atlassian opened this issue May 8, 2018 · 2 comments

Comments

@ychen-atlassian
Copy link
Contributor

@wryun and I had a chat and we figured that Ctrl "owns" too much. Right now, if we want to spin up any additional components alongside the controller, and they require flags, we always need to do one of:

  1. Pulling the Logger out, pull the flags out of the constructor after the App has been NewFromFlags' and having the init code alongside the App, which feels a bit wrong.
  2. Have all the init live inside the ControllerConstructor (which feels like the "owner" is wrong")

Maybe it would be better to have the ownership of flags and loggers be separate to Ctrl. That way, users can decide how the application is started up.

The current method is nice however, since we basically don't need to worry about writing any sort of init code, but it means things are a bit opaque unless you understand what Ctrl is doing.

@ychen-atlassian
Copy link
Contributor Author

Although given stuff like https://github.com/atlassian/ctrl/pull/4/files, maybe this is totally fine

@ash2k
Copy link
Contributor

ash2k commented May 8, 2018

Yeah, I see what you mean. I think we should get that PR merged and then think about restructuring the project to make it more like a library rather than like a framework. And maybe there is room for both approaches.

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

No branches or pull requests

2 participants