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

LPS-46105 The default settings should always be the last parameter. The first parameter should be the main source of information for the settings #3021

Closed
wants to merge 4 commits into from

Conversation

JorgeFerrer
Copy link

Resending without changes because I'd like to argue against your comments at brianchandotcom/liferay-portal#18066

The order of the parameters should be based on their meaning and not on their structure. The rules I think will work best are:

  1. First param should always be the source from which that Settings class will get the values. That source can be of different types including: PortletPreferences, Map, another Settings instance, etc.
  2. Second param should be the source from which to get the value if the main soruce does not have it. This will always be of type Settings. (This second param may not exist in some cases where defaults don't make sense)
  3. Any other parameter that control the behavior of the class (such as fall backs) go last.

I hope that makes sense to you.

@brianchandotcom
Copy link
Owner

Merged. Thank you.
View total diff: 0fd0eb7...bcd85c2

@brianchandotcom
Copy link
Owner

Ok. I merged it in as is. Thanks Jorge. I documented it in LPS-46105. Thx.

@JorgeFerrer
Copy link
Author

Thanks Brian

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