The purpose of the State Design Pattern is allow an object to modify its behaviour when its internal state changes. Although this can often be solved with a boolean or using constants, this usually ends up with a lot of if-else, unreadable code and difficulty in maintenance.
The adapter pattern is definitely one of the most used design patterns in software development. As per GOF guys, Adapter pattern is defined as the following: “Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.”
Another day, another Design Pattern, in this article I will explain the Strategy Design Pattern.
The Strategy pattern allows you to define an algorithm separately and select the algorithm dynamically at run time. This pattern defines a set of algorithms, encapsulates each one of them and makes them interchangeable. It allows the algorithm to vary independently of the clients that use it.
The Façade Pattern it is a very simple pattern, it seeks to simplify the system, from the point of view of the client, by providing a unified interface for a set of subsystems, defining a higher level interface. This makes the system easier to use. The GOF book says the Facade Pattern should “Provide a unified interface to a set of interfaces in a system. It defines a high level interface that makes the subsystem easier to use”.
The Template Method design pattern is part of the so-called behaviour pattern family. These patterns help solve problems of interaction between classes and objects. This pattern arises from the need to extend certain behaviours within the same algorithm by different entities. That is, different entities have a similar behaviour but differ in certain specific aspects depending on the particular entity.
Recently I have started to use SonarQube and I have to say that I like it. In this post I will talk about this tool and the process of installation and configuration. My objective is to analyse C# projects.
SonarQube is an open source platform for continuous inspection of code quality. It uses various static source code analysis tools like Checkstyle, PMD or FindBugs to obtain metrics that can help improve the quality of our programs’ code.
With Angular 1.5 we can divide our application into components, making use of the .component () method. Before we could do it by using directives but this way the code is better adapted and prepares us for the jump to Angular 2.
The fundamental difference between directives and components is that, while directives receive a function, just like controllers or factories, the components receive an object. It really is similar in the sense that the directives at the end should return an object and the components directly serve that object to the component () method.