-
Notifications
You must be signed in to change notification settings - Fork 18
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
Used UserStorage delegation instead of inheritance #3
base: master
Are you sure you want to change the base?
Conversation
I like the idea, but I don't like the way you implemented it in DI. I'd rather prefer it to do automatically. If you need a custom storage, you replace default nette's in config by changing nette.userStorage. I think it could be still automated (but I am not sure whether that will be applied before loadConfiguration() is called). This should be just an internal decorator. |
Fixed |
There is more problems, but in Nette. Even though Nette relies only on IUserStorage (in User), it calls methods which are not defined in that interface, but only in UserStorage (methods getNamespace and setNamespace). Thus decorator is not a simple forwarding through interface, it is just hackish shit. How typical in Nette. |
I kinda reworked your concept and fixed compatibility with User (as mentioned above). Could you please try and test branch feature/storage-decorated? (I'm currently not developing any application where I could test this thoroughly.) |
Bump? |
Seems working for me .) |
👍 Composition over inheritance |
Changed UserStorage inheritance to delegation for case when custom (basic) UserStorage is used.
To set custom parent UserStorage is necessary to set userStorage service in nette namespace.