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

Rename USER scope to LOCAL #23

Open
Nyholm opened this issue Mar 24, 2015 · 14 comments
Open

Rename USER scope to LOCAL #23

Nyholm opened this issue Mar 24, 2015 · 14 comments
Milestone

Comments

@Nyholm
Copy link
Collaborator

Nyholm commented Mar 24, 2015

It make no sense anymore to have a User scope. We should consider renaming it to Local.

@dmishh
Copy link
Collaborator

dmishh commented Mar 29, 2015

I agree with you about renaming, but Local isn't a perfect choice, as for me.
Let's think about alternatives: Person, Identity, Owner, Private, etc

@Nyholm
Copy link
Collaborator Author

Nyholm commented Mar 29, 2015

Hm, you might be right. I thought of Local as contrary to Global. I don't like a scope name like Person because it implies that a SettingOwner shoud be a user when it could be any object.

Let's see what the different scope really does:

  • All => This setting is applicable to all scopes, but it is really "scope free".
  • Global => This setting can not be tied to a SettingOwner.
  • User => This setting must be tied to a SettingOwner.

I suggest the follwing change:
All => None
Global => Public
User => Private

Or if you rather prefer:
All => None
User => Local

@dmishh
Copy link
Collaborator

dmishh commented Mar 29, 2015

I think we should rename User => Private and keep Global. My concern is that private and public are very similar, it seems they are related to the same entity (like methods of a class, etc) but the global scope is totally independent from owner. What do you think?

@Nyholm
Copy link
Collaborator Author

Nyholm commented Mar 30, 2015

My concern is that private and public are very similar, it seems they are related to the same entity (like methods of a class, etc)

Okey. Hm, But you do also have a global and local (function) scope of variables.

I feel that the names All (1), Global (2), Private (3) are a bit strange. Since 2 is the opposite to 3 they should be named with words that are generally know as opposites...

Reading futher.. Wikipedia about scopes refers to:

  • Expression scope
  • Block scope
  • Function scope
  • File scope
  • Module scope
  • Global scope

They don't really mention private.

I can't really make upp my mind. I know that user is no good. Maybe we should consider something else like: model, objector settingOwner. They make it all clear that the setting must be tied to an object.

@dmishh
Copy link
Collaborator

dmishh commented Apr 4, 2015

Referring to the SettingsOwnerInterface we could rename private => owner and it will have better match to the meaning.
Final list: ALL, GLOBAL, OWNER
What's your point on this, @Nyholm ?

@Nyholm
Copy link
Collaborator Author

Nyholm commented May 7, 2015

Sure, it makes sense. Let's have GLOBAL and OWNER.

I suggest to rename ALL to NONE. I believe this is a scope independent setting. Consider the following:

Scope Settings
ALL foo
GLOBAL bar
OWNER baz

I have declared foo to ALL. Is that all scopes? Or "all" what? If we want to fetch settings in the OWNER scope. What should be returned?

  • A) baz
  • B) baz and foo

Since A is correct it seams weird that foo is in all scopes since it clearly is not in OWNER... I believe the name ALL is confusing. I would prefer NONE.

@dmishh dmishh added this to the 2.0.* milestone Jun 14, 2015
@rvanlaak
Copy link
Owner

I think within the scope there should also be a separation on Section. That way a user can have settings per module.

@Nyholm
Copy link
Collaborator Author

Nyholm commented Jun 22, 2015

👍 Interesting idea!
Could you please elaborate this a little bit. Give some use cases and/or examples.

@rvanlaak
Copy link
Owner

Well, I'm implementing this bundle as a replacement of the CraueConfigBundle because it seems to have more advanced options. My use-case for switching to this bundle is the user scope, I'd like to introduce a setting (internal counter) for a user that keeps track of the number of times it opened a "tour".

Great about the sections in that bundle is that it allows me as an admin/developer to group settings. In the near future this will allow me to visually make tabs of all sections in my backend config for the "global" parameters. By introducing the sections, this allows me to get rid of the "prefixes" in the setting names. You could even think of configuring validation based on these sections.

Another question @Nyholm , does the bundle allow me to edit all global settings without having to define all my current settings in a config file?

@Nyholm
Copy link
Collaborator Author

Nyholm commented Jun 22, 2015

So the section is nothing but a label you attach that allows you group settings? That is a feature I also would like to see. I'm sure @dmishh are happy to see a PR. =)

Another question @Nyholm , does the bundle allow me to edit all global settings without having to define all my current settings in a config file?

I'm not too sure what you mean. If I assume that the "current settings" are settings defined in CraueConfigBundle, then no. They store their settings differently. Aslo we need the config of "valid" settings.

@rvanlaak
Copy link
Owner

Okay, then I'd propose a way to lower the bar for developers to use this bundle. I do not want to define all settings in a yml file, they simply are a way to toggle certain features within my application and I'm the only one that will change them 😉

I can think of letting them fall under a certain "admin" section, and if only that section has a configuration, that's fine. Ofcourse the settings themselves could override the section configuration. 👍

@dmishh
Copy link
Collaborator

dmishh commented Jun 29, 2015

they simply are a way to toggle certain features within my application and I'm the only one that will change them

@rvanlaak certain is key here. You don't have unlimited or random features, do you? In that case, you always can be precise with the features list. Of course, adding all of them to the config file is a bit burdening, but I'm considering it as a good practice.

As for the Settings' sections, we have an issue #3 created already

@dmishh
Copy link
Collaborator

dmishh commented Jun 29, 2015

@Nyholm
NONE means to me like something is turned off, isn't active, empty, unfulfilled. But the meaning should be: covers all, includes all possible states, gives the ability to use all possible features/options/etc

@dmishh dmishh modified the milestones: 2.1, 2.0 Aug 24, 2015
@jewome62
Copy link

jewome62 commented Oct 5, 2015

👍

I want use the "User Scope" to save locale (and have setting by locale)
I think scope private is better than scope user

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

No branches or pull requests

4 participants