Log in Sign up
2 Matching Annotations
  1. Jun 2023
  2. stackoverflow.com stackoverflow.com
    Are protected members/fields really that bad?
    2
    1. TylerRick 19 Jun 2023
      in Public
      Using a property or a method to access the field enables you to maintain encapsulation, and fulfill the contract of the declaring class.
      properties vs. direct access to instance variables using properties to abstract, encapsulate, and control access to private instance variables/data encapsulation (programming) contract (programming)
    2. TylerRick 19 Jun 2023
      in Public
      Exposing properties gives you a way to hide the implementation. It also allows you to change the implementation without changing the code that uses it (e.g. if you decide to change the way data are stored in the class)
      encapsulation (programming) using properties to abstract, encapsulate, and control access to private instance variables/data good point +0.9
    Visit annotations in context

    Tags

    • encapsulation (programming)
    • +0.9
    • using properties to abstract, encapsulate, and control access to private instance variables/data
    • contract (programming)
    • good point
    • properties vs. direct access to instance variables

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/3182653/are-protected-members-fields-really-that-bad
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy