0

I need an example to understand more clearly, How can I create a class with out getter and setter. So to implement a better design and adapt below mentioned principle:

  • Keeping code more object oriented and avoid procedural style coding
  • Reduce Law Of Demeter
  • Do not violate DRY principle
  • How to keep details of a class hidden from other classes
  • So that the calling class (client class) will not be created containing procedural methods which will make decision based on the state of my class.
4

1 回答 1

0

我认为访问修饰符的知识将帮助您回答自己的问题。请检查。

http://www.codeproject.com/Articles/25078/C-Access-Modifiers-Quick-Reference

于 2012-10-17T06:08:37.457 回答