Skip to content

Instantly share code, notes, and snippets.

@matiasdim
Last active December 2, 2020 20:22
Show Gist options
  • Save matiasdim/8d9feab56e9537f102b28711ebbcf95f to your computer and use it in GitHub Desktop.
Save matiasdim/8d9feab56e9537f102b28711ebbcf95f to your computer and use it in GitHub Desktop.
Single-Responsability(Broken)
class Employee {
let name: String
let email: String
init(_ name: String, _ email: String) {
self.name = name
self.email = email
}
func getInfo() -> String {
return "Employee named \(name) has email \(email)"
}
func validateEmail() -> Boo {
// Code that validates email
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment