Framework is an English term that is frequently used in our language . It can be translated as "work framework or environment " and refers to a set of ideas, guidelines and actions that allow addressing a certain problem .
A framework, therefore, works as a reference . The notion usually appears in the field of technology , especially in software development.
The framework in software development
For programming , a framework is a conceptual structure that helps organize the development of computer programs. It usually consists of an interpreted language, libraries and other resources that facilitate the joining of the different elements of a project.
In addition to providing a structure and constituting itself as an architecture , the framework provides a work methodology . It is based on development patterns and favors good practices.
By using a framework to program, you avoid writing repetitive code. This tool also helps minimize programming time by enabling data reuse.
A generic base
It can be said that a framework is a kind of generic application . The user is able to add the lines of code needed to program a specific application, completing it. Thus, the framework helps programming by writing fewer lines of code .
Let's take the case of PHP , a programming language that is often used in web development. Programmers generally turn to Zend , Laravel or Symfony , among other frameworks, which simplify the task of programming in PHP and avoid having to start programming from scratch.
Sometimes it is difficult to choose a particular framework, especially if many of the available ones receive good ratings from users. For this reason, it is recommended to try more than one until you find our favorite. Choosing one does not mean that we despise the alternatives, but in some cases it is a question of "chemistry" that leads us to make the decision, because we understand its structure better or simply because it makes us feel more comfortable.
Components of a framework
One of the essential components of a framework is the so-called code library , which is also known as a library in some Spanish-speaking regions, although the latter name is less correct. Its definition is quite simple: a collection of code and data that is created with the purpose of being reused. But what does this mean exactly?
Let's think about a mathematics library, something very common in frameworks dedicated to video game development, for example. In the code it contains there may be variables such as "the value of pi" or "the constant to convert degrees to radians" , and also functions that allow us to "calculate the square root" or "round a number up or down" , among many other useful tools .
If every time a software developer needs to calculate a root they had to write all the code necessary for the calculation, it would take a long time and take up a lot of disk space; With the right framework this is summarized in a very short line of code. Other of the most common components of the framework can be specific tools that are very useful for the development of a particular type of program, such as interfaces for adding audio or creating windows.
It is important to note that, fundamentally, all of these issues rely on libraries , regardless of the way in which we interact with them. For example, even if we have a tools panel that allows us to create and modify windows for our application using the mouse, this also uses a library and we could achieve the same results through code. However, the key to the framework is convenience.
Your advantages
It can be said, in summary, that a framework offers a series of conventions and guidelines that are used for faster and more efficient production of applications. It is a framework that provides an elementary structure as a starting point and that helps in solving common problems when programming.
The advantages of a framework can be summarized this way:
- Optimizes development times (provides an already established structure).
- Increases efficiency (allows standardization of processes).
- Promotes collaboration and flexibility (it is useful for teamwork).
- Increases quality (by providing a standardized framework , it is simpler to achieve a result consistent with the stated objective).
Architecture of a framework
The framework can be based on different design patterns . Generally the chosen software architecture is the model-view-controller (MVC) .
The MVC establishes a separation of the data and what is known as business logic with the representation and the module that manages communications. Therefore, it defines how information is represented on the one hand, while on the other it takes care of user interaction.