ctrl icon indicating copy to clipboard operation
ctrl copied to clipboard

Ctrl owns too much of the application

Open ychen-atlassian opened this issue 7 years ago • 2 comments

@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 avatar May 08 '18 09:05 ychen-atlassian

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

ychen-atlassian avatar May 08 '18 09:05 ychen-atlassian

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.

ash2k avatar May 08 '18 09:05 ash2k