Chapter 14. Introducing Construction
When you create a C# class, you normally provide for the creation of objects of your class by supplying class constructors. Constructors are useful, though, only if clients know which class to construct and have values for the parameters that a constructor requires. Several design patterns address cases where these conditions or other circumstances of ordinary construction do not hold. Before examining designs for cases where ordinary construction is insufficient, it is useful to review ordinary construction in C#.
A Few Construction Challenges
C# constructors are special methods. In many respects, including access modifiers, overloading, and the syntax of parameter lists, constructors are like ordinary methods. ...
Get Design Patterns in C# now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.