Is this a well known design pattern? what is it's name
Posted
by GenEric35
on Stack Overflow
See other posts from Stack Overflow
or by GenEric35
Published on 2010-04-14T12:25:21Z
Indexed on
2010/04/14
12:33 UTC
Read the original article
Hit count: 314
Hi I have seen this often in code, but when I speak of it i don't know the name of such 'pattern'
I have a method with 2 arguments that calls an overloaded method that has 3 arguments and intentionality sets the 3rd one to empty string.
public DoWork(string name, string phoneNumber)
{
CreateContact(name, phoneNumber, string.Empty)
}
public DoWork(string name, string phoneNumber, string emailAddress)
{
//do the work
}
The reason I'm doing this is I to not duplicate code, and allow the existing callers to still call the method that has only 2 parameters.
I have associate a few tags to this question, but it probably fit in more categories of questions.
Is this a pattern, and does it have a name?
© Stack Overflow or respective owner