Understanding the encapsulation is easy: your objects and methods must hide the implementation. You have to look at the methods name and understand "what it does" but never "how it does". Rules, variables or instances which are necessary to do what is being done must to be hidden in a method; It helps to reuse … Continue lendo SOLID – Focusing on Encapsulation
Categoria: Software Engineering
SOLID is not About How to Make your Code Beautiful!
SOLID was created because engineers were concerned about code quality and they focused on abstraction, cohesion and encapsulation to reach the quality. But it's not merely about how make code beautiful, actually, they create it because maintenance it the biggest fase of software development and modify a code with a bad design can break it … Continue lendo SOLID is not About How to Make your Code Beautiful!
SOLID – Focusing on Abstraction
I think I've never written about SOLID Principles here, in my blog. So, I will do it trying to be simple, and focusing on abstractions. Single Responsibility Simple, a classe must have only one responsibility. A classe or interface must be cohesive. DIP - Dependence Inversion Principle Each modifications in a class is propagated to … Continue lendo SOLID – Focusing on Abstraction
Recursão em Cauda
A recursão de cauda é um tipo especial de recursão, no qual não existe processamento a ser feito depois de encerrada a chamada recursiva. Sendo assim, não é necessário guardar o estado do processamento no momento da chamada recursiva. Um compilador ou interpretador pode (se for construído assim) detectar a ocorrência de recursão de cauda … Continue lendo Recursão em Cauda
Princípio do Aberto Fechado
Todo software sofre evolução. É difícil pensar em um software que seja feito e nunca receba algum tipo de manutenção. Então, estamos sempre pensando em adicionar uma nova funcionalidade em nosso software e, sendo assim, pensamos logo em modificarmos o código para acrescentar o que é necessário, mas evitar modificações é uma boa prática. Quanto … Continue lendo Princípio do Aberto Fechado