Hi guys,
When should we implement a private constructor?
MSDN states that we should use one when a class is declared as static.
However the SqlDataReader class seems to have a "Private" constructor. And to top it the SqlCommand object is able to instantiate it! (ExecuteReader is returning an instance of the SqlDataReader object)
My queries:
a. How is this done technically?
b. What kind of a design pattern is this?
Known is handfull, Unknown is worldfull
When should we implement a private constructor?
MSDN states that we should use one when a class is declared as static.
However the SqlDataReader class seems to have a "Private" constructor. And to top it the SqlCommand object is able to instantiate it! (ExecuteReader is returning an instance of the SqlDataReader object)
My queries:
a. How is this done technically?
b. What kind of a design pattern is this?
Known is handfull, Unknown is worldfull