Skip to content

Instantly share code, notes, and snippets.

@nasrabadiAM
Last active January 27, 2019 19:25
Show Gist options
  • Save nasrabadiAM/48b74b3f429f50a9b720d952dba0bc7a to your computer and use it in GitHub Desktop.
Save nasrabadiAM/48b74b3f429f50a9b720d952dba0bc7a to your computer and use it in GitHub Desktop.
Single Responsibility Principle contradict
class Text {
String text;
String author;
int length;
String getText() { ... }
void setText(String s) { ... }
String getAuthor() { ... }
void setAuthor(String s) { ... }
int getLength() { ... }
void setLength(int k) { ... }
/*methods that change the text*/
void allLettersToUpperCase() { ... }
void findSubTextAndDelete(String s) { ... }
/*method for formatting output*/
void printText() { ... }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment