-
Notifications
You must be signed in to change notification settings - Fork 103
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
Make all methods protected, not private #72
Comments
You can implement your own deployer class by extending |
While that's true, if I only want to change one method from the DefaultDeployer, then why rewrite the whole class? What's the reason for wanting to keep the methods private? The DefaultDeployer has a load of useful methods and it would be great to keep them. |
The reason is the "open-closed-principle" which states that classes should be open for extension but closed for modification. To make this happen more extension points are needed. Unless they are provided, you have limited options:
|
The extension point is protected method. The original class is not modifying. The principle is not violated. |
Hi there,
I've been using your deployer for a while now and its fantastic - but it would be great to make all of the methods in the DefaultDeployer protected instead of private - that way we can easily override them if we need to.
For example, I was having trouble with the doResetOpCache function.
Inserting a 1 second sleep between writing the file and wgetting the file has solved this problem, but I cannot override the class method!
Thanks!
The text was updated successfully, but these errors were encountered: