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

Usage of static fields #12

Open
eugene-nikolaev opened this issue Sep 5, 2017 · 11 comments
Open

Usage of static fields #12

eugene-nikolaev opened this issue Sep 5, 2017 · 11 comments

Comments

@eugene-nikolaev
Copy link
Contributor

eugene-nikolaev commented Sep 5, 2017

@yegor256, I cannot figure out what are criteria for making a field static or not.
E.g.

    final class TkBadge implements Take {

    /**
     * XSL.
     */
    private static final XSL SVG = XSLDocument.make(
        TkBadge.class.getResourceAsStream("badge.xsl")
    );

After reading your books I often hesitate to make something static but sometimes pretty constant non-static fields looks weird.
Where is the line which should be drawn?

I think it is more like OK than not?:

private static final String REV = Manifests.read("Rehttp-Revision");

Bit why this isn't really a ctor?

/**
     * Ctor.
     * @param base Base
     * @return App
     * @throws IOException If fails
     */
    private static Take app(final Base base) throws IOException {

Well, I guess it should be fixed as long as the methods aren't being used in a static context or in this(...):

    // DyTake.java 
    private static int code(final Response response) throws IOException {
    private static Request request(final Request req, final URI uri) 

So, what is a legal use of static fields? Is it OK for really definitions which are unlikely will need to be overriden (say even in the unit-tests)?

@0crat
Copy link
Collaborator

0crat commented Sep 5, 2017

@eugene-nikolaev I'm not managing this repo, remove the webhook or contact me in Slack //cc @yegor256

@0crat
Copy link
Collaborator

0crat commented Jun 21, 2019

Job #12 is now in scope, role is DEV

@0crat
Copy link
Collaborator

0crat commented Jun 21, 2019

Thanks for your contribution, @eugene-nikolaev/z! If you would be a member of the project, you would now earn +15 reputation points, as explained in §29. You can join and apply to it, see §2.

@0crat
Copy link
Collaborator

0crat commented Jun 21, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jun 26, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 1, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 6, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 11, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 16, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 21, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

@0crat
Copy link
Collaborator

0crat commented Jul 26, 2019

@yegor256/z everybody who has role DEV is banned at #12; I won't be able to assign anyone automatically; consider assigning someone manually (as in §19), or invite more people (as in §51), or remove the job from the scope (as in §14)

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

3 participants