Skip to content

Instantly share code, notes, and snippets.

@jaykz52
Created December 14, 2010 02:33
Show Gist options
  • Save jaykz52/739919 to your computer and use it in GitHub Desktop.
Save jaykz52/739919 to your computer and use it in GitHub Desktop.
An example of place where constructors don't allow us full control over a class's behavior
public class DBConnection
{
private const int MAXCONNECTIONS = 5; // arbitrary
public DBConnection()
{
// Oh no, what if we're over the max allowed connections!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment