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

Consider making ColorScheme immutable #675

Closed
remkop opened this issue Apr 29, 2019 · 2 comments
Closed

Consider making ColorScheme immutable #675

remkop opened this issue Apr 29, 2019 · 2 comments
Labels
theme: compatibility Issues related to binary and source backwards compatibility type: API 🔌
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Apr 29, 2019

Following up on #516.

With the new execute API the ColorScheme class will start to play a more central role.

I’m considering making the ColorScheme class immutable. This will be a breaking API change. Should it be deprecated first, or not changed at all, or is the upcoming 4.0 release a good time to make breaking changes?

Feedback very welcome!

(cc @bobtiernay-okta @bbottema )

@remkop remkop added this to the 4.0-alpha-3 milestone Apr 29, 2019
@remkop remkop added the theme: compatibility Issues related to binary and source backwards compatibility label Apr 29, 2019
@remkop
Copy link
Owner Author

remkop commented Apr 29, 2019

(Thinking out loud, unsure if this could be made to work...)
One idea may be to introduce a superclass of ColorScheme, and make this superclass immutable. We would deprecate ColorScheme in 4.0, and make it final. In a future version we would remove ColorScheme and make its superclass final`.

Ideas for superclass names:

  • ColorTheme
  • ColorStyle
  • ColorTemplate
  • StyleTemplate
  • StyleSheet
  • TextStyle

@bobtiernay-okta
Copy link
Contributor

or is the upcoming 4.0 release a good time to make breaking changes?

Yes, I think it's a great opportunity personally.

On a related note, have you looked at the JLine3 abstractions in this area for inspiration? I'm not sure they are inline with what you are thinking, but there does look like some good thoughts here.

https://github.com/jline/jline3/tree/master/terminal/src/main/java/org/jline/utils

In particular the Attributed* classes. I'm not suggesting this naming, just might be useful to look at the decomposition and why.

@remkop remkop closed this as completed in 548a771 May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: compatibility Issues related to binary and source backwards compatibility type: API 🔌
Projects
None yet
Development

No branches or pull requests

2 participants