Skip to content

Instantly share code, notes, and snippets.

@xpostudio4
Created October 4, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpostudio4/e27f707fdff31d2781e408820dc1fa37 to your computer and use it in GitHub Desktop.
Save xpostudio4/e27f707fdff31d2781e408820dc1fa37 to your computer and use it in GitHub Desktop.
Refactoring: Growing Software like a Gardener
class Person..
public String getName(){
return _name;
}
public String getTelephoneNumber() {
return ("(" + _officeAreaCode + ")" + _officeNumber);
}
public getOfficeAreaCode(){
return _officeAreaCode;
}
void setOfficeAreaCode(String arg){
_officeAreaCode = arg;
}
String getOfficeNumber(){
return _officeNumber;
}
void setOfficeNumber(String arg){
_officeNumber = arg;
}
private String _name;
private String _officeAreaCode;
private String _officeNumber;
class Person..{
public String getName(){
return _name;
}
public String getTelephoneNumber(){
return _officeTelephoneNumber(){
return _officeTelephone.getTelephoneNumber();
}
}
TelephoneNumber getOfficeNumber() {
return _officeTelephone;
}
private String _name;
private TelephoneNumber _officeTelephone = new TelephoneNumber();
}
class TelephoneNumber{
public String getTelephoneNumber() {
return ("(" + _AreaCode + ")" + _number);
}
public getAreaCode(){
return _AreaCode;
}
void setAreaCode(String arg){
_officeAreaCode = arg;
}
String getNumber(){
return _number;
}
void setNumber(String arg){
_number = arg;
}
private String _name;
private String _areaCode;
private String _number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment