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

ok to consolidate classes? #17

Open
ghoneycutt opened this issue Nov 1, 2016 · 9 comments
Open

ok to consolidate classes? #17

ghoneycutt opened this issue Nov 1, 2016 · 9 comments

Comments

@ghoneycutt
Copy link
Member

Hi @dhoppe

The module currently separates out functionality that should be in one class (fail2ban) into many subclasses (install, config, service). Each class should provide functionality on its own without having to chain them together with the anchor pattern, which has come to be an anti-pattern in puppet coding. I'm looking at adding support for EL6 and ensuring there is full spec coverage and wondering if it would be OK to refactor the module to get rid of the anchor pattern and subclasses.

Best regards,
-g

@dhoppe
Copy link
Member

dhoppe commented Nov 1, 2016

@ghoneycutt Sure, I would appreciate your help. Just send me a PR and I am glad to merge your changes.

@ghoneycutt
Copy link
Member Author

Thank you!

CC: @Phil-Friderici

@ghoneycutt
Copy link
Member Author

Hi @dhoppe

@Phil-Friderici was able to consolidate in PR #21. Could you please merge?

@dhoppe
Copy link
Member

dhoppe commented Nov 19, 2016

@ghoneycutt I need some more days to take look at this pull request. Right now I am at a tropical island (honeymoon).

@Phil-Friderici
Copy link

@dhoppe happy honeymoon !!!

@Phil-Friderici
Copy link

Comment from @dhoppe in PR #21 (comment) :

@Phil-Friderici I know that this module need to be refactored and that the best practices change over time, but could you explain to me why you made these changes? I really do not like to put all the code into one file.

If I take a look at the PuppetConf talks the params.pp might be obsolete, but install/config/service is still valid and the differences between operating systems might be put into single files which are included if necessary.

@ghoneycutt
Copy link
Member Author

ghoneycutt commented Nov 28, 2016

Hi @dhoppe

I thought we were all on the same page for consolidating classes and the benefits from my original question above. We put a lot of resources into this based on your response and would very much appreciate it if you could merge PR #21

@dhoppe
Copy link
Member

dhoppe commented Nov 29, 2016

Hi @ghoneycutt

I am sorry we misunderstood. I have not read the text thoroughly enough and thought it was about the changes regarding Puppet 4. For example osfammily based manifest instead of params.pp and contain instead of the anchor pattern. I see no reason to put everything into one manifest because install.pp, config.pp, service.pp have established over time and in my opinion belong to the best practices.

@ghoneycutt
Copy link
Member Author

Hi @dhoppe

Each class should provide functionality on its own. Breaking a class up into subclasses only makes the code harder to read. Since the subclasses do not stand on their own and only make sense between other classes, you end up having to go through all of them to understand what is happening. Sadly this approach was printed in a Puppet book and has since taken off from there.

While we differ on methods, I'm hoping that the simplified approach in the PR is still of enough value for you to accept the work and merge it.

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

No branches or pull requests

3 participants