Why is this poor design

  • Thread starter Thread starter Nick Weekes
  • Start date Start date
N

Nick Weekes

Morning all,

Ive read a few posts regarding the manipulation of form controls from
one class to another etc, and the opinion is that it is considered poor
design to set the instanciation of controlX to Public, so its
accessible from other classes, rather than create FormY.ControlX public
properties, thus leaving the base control alone.

Im not sure why one is preferable to the other, any comments?
 
If you set the control to public. All of its members are public. Also those
you don't need / want to be public.
Therefore it's considered better to only expose those members that you realy
need to be exposed.
 
Back
Top