Do private classes need to be accessed by properties?
Posted
by
Andy
on Stack Overflow
See other posts from Stack Overflow
or by Andy
Published on 2011-01-02T13:46:12Z
Indexed on
2011/01/02
13:53 UTC
Read the original article
Hit count: 180
I am using an instance of a private class as the state object supplied to a stream.BeginRead operation. (The class is private to my main stream reading/writing class.)
public class MainClass
{
// ...
private class ResponseState
{
public IResponse response;
public Stream stream;
public byte[] buffer = new byte[1024];
}
}
Access to the class is via the fields directly. Should I really be providing access to the class via properties in this case, even though it is only to be used for holding state?
Interested to know what others do.
© Stack Overflow or respective owner