Skip to content

Instantly share code, notes, and snippets.

@mauricioaniche
Created November 12, 2010 13:46
Show Gist options
  • Save mauricioaniche/674096 to your computer and use it in GitHub Desktop.
Save mauricioaniche/674096 to your computer and use it in GitHub Desktop.
CalculadoraDeSalario - Exemplo 1
public class CalculoDeSalario {
public CalculoDeSalario(RegrasFiscais regrasFiscais, ...) {
// ...
}
public double calcula(Funcionario f) {
if(f.getCargo() == Cargo.VENDEDOR) {
// calcula salario do vendedor usando regras fiscais, etc
}
if(f.getCargo() == Cargo.GERENTE) {
// calcula salario do gerente usando regras fiscais, etc
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment