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

Lack of Encapsulation #79

Open
ipz234 opened this issue Feb 4, 2025 · 0 comments
Open

Lack of Encapsulation #79

ipz234 opened this issue Feb 4, 2025 · 0 comments

Comments

@ipz234
Copy link

ipz234 commented Feb 4, 2025

File: Program.cs
Problem:

  • All properties of the Something class are public, which allows you to change them directly.

  • Guid.NewGuid().ToString("N") is generated in the constructor, but there is no guarantee that the Id will not change after initialization.

  • DateTime.Now in Date creates a variable that changes on each new instance, which can be undesirable behavior.

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

1 participant