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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top