Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 0.8.2
-
Fix Version/s: 0.9
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Currently the default visibility for fields in boo is protected.
This is not considered a proper OOP practice and as such get caught by static analysis tools such as Gendarme (rule: AvoidVisibleFields) or FXCop (rule: CA1051-DoNotDeclareVisibleInstanceFields).
Indeed, fields should be local implementation details only. A protected field publishes its interface outside the assembly and thus can be used as such by derived types outside of the assembly, which obviously causes bad coupling and can cause unnoticed/unwanted breakage when the implementation detail in the 'mother' assembly changed.
Since 0.9 will be a slightly "breaking" release already (ambiguous syntax for generic declarations, among other minor things I guess), I think we should take the opportunity to also do this change.
The change will almost be non-breaking anyway since any current field with default protected will work as well when changed to internal. It would break only code if any using protected fields from another assembly, which would be something nice to notice/fix anyway.
Thoughts?
No comment means no strong opinion against this?