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

Objects and Data Structures - The Law of Demeter #30

Open
jnguyen095 opened this issue Jul 24, 2017 · 0 comments
Open

Objects and Data Structures - The Law of Demeter #30

jnguyen095 opened this issue Jul 24, 2017 · 0 comments

Comments

@jnguyen095
Copy link
Owner

  • The method should not invoke methods on objects that are returned by any of the allowed functions. In other words, talk to friends, not to strangers
final String outputDir = ctxt.getOptions().getScratchDir().getAbsolutePath();
  • It is usually best to split them up as follows:
Options opts = ctxt.getOptions();
File scratchDir = opts.getScratchDir();
final String outputDir = scratchDir.getAbsolutePath();
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

1 participant