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

2.17 Nested case classes? #43

Open
macalinao opened this issue Dec 12, 2016 · 1 comment
Open

2.17 Nested case classes? #43

macalinao opened this issue Dec 12, 2016 · 1 comment

Comments

@macalinao
Copy link

SHOULD NOT define case classes nested in other classes

Are nested case classes a problem? There's quite a few instances where you might need them, e.g. representing database rows that may have serialized columns.

@alexandru
Copy link
Owner

The rule is with a SHOULD NOT, meaning that it is optional - like something dangerous, that might prove useful in certain contexts, but you need to be aware of it. This style guide uses MUST NOT for rules that shouldn't be broken.

Speaking of which, nesting case classes in other classes can be dangerous because they are serializable themselves and by nesting them you break Java's serialization.

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

2 participants