What are modules in programming?

5

I know there is this question: What are modules ?
But the explanation did not go straight to the point and it left me confused, as well as properties, methods, arguments and other words I've already seen quite the use of the word modules .

I'd really like to know the definition of the modules , a very simple explanation. Just like saying métodos são funções de classes associadas a um objeto, etc... with a small example.

    
asked by anonymous 18.05.2016 / 19:52

2 answers

6

There is no single definition. Each context, each technology can define it in a different way. So the dictionary definition can help more than a specific definition. It can be viewed at Priberam or Michaelis . So it would be something measured in a small and harmonious way?

There are modules that do not have these names. And there are things called modules that may not undergo a rigorous inspection of the term.

Note that there is not even a definition of the size of this module. He may have a very specific responsibility or a more general responsibility. While it is true that it does not correspond to the whole, it is a part of the whole.

Anyway, there is not a good canonical definition of what this is. You have to analyze the context to better define what you are talking about.

Modular programming

There is modular programming that proposes to create applications divided into small parts. What these parts are is not well defined. A module in this context can be a method, it can be a class, it can be a source file, it can be an executable, it can be a package, whatever that means in each situation, it may be some other grouping of other smaller parts still .

Static classes

In fact it has language that calls a module a class that only has static members.

Grouping of types and other constructions

It has language that groups several types (represented by classes, for example) within it. Some of these look like a namepace , others to a compilation unit, usually even blending the two concepts.

PHP

In PHP the term is used for things that are not of the programming itself.

Out of schedule

I did not even come close to talking about the modules used in anything in the professional developer cycle but it is not related to the programming itself.

Mathematics

I did not mention the module that is the operation of obtaining the rest of an entire division. I guess that's not the point of the question.

    
18.05.2016 / 20:09
4

Module is a generic term to define a unit code or artifact with a specific purpose, the basic idea is to join certain elements by some criterion ex cohesion. Once grouped these elements can be distributed and easily integrated into other systems, examples are dlls, jars and even plugins. In other words modules are subsystems that can be added to other systems.

A class can be 'module' in the sense that its responsibility is to solve a well-defined problem. A namespace or package would be an example of a set of classes or functions (depending on technology) that combined solve certain tasks.

    
18.05.2016 / 20:08