Hello
Le 2024-08-16 à 09 h 51, Andreas Sewe a écrit :
Maven has two *orthogonal* ways how to projects can relate to each
other: aggregation and inheritance. (…snip…) I don't think using the
term "Maven sub-project" improves things. In fact, it makes it even
easier to mistake a module (aggregation) for a child project
(inheritance), as the difference between sub-project and child project
is very subtle. I would hence restrict the use of "sub-something" to
inheritance (think "sub-class") and never use it to discussion
aggregation.
While "sub" can mean "below" as in "subway", the usages I can think of
in mathematics and programming are more about "sub" as in "subset" or
"sub-group". So "sub-class" can be understood as "the class which is
drawn below another class in a UML diagram", but can also be understood
as "a class identifying a subset of the instances identified by the
parent class", i.e. a sub-group. The latter definition is mathematical,
while the former depends on drawing conventions. Object-oriented
programming (OOP) encourages substitutability (Liskov substitution
principle [1]), which is based on the mathematical interpretation. For
example, a Circle is a sub-class of Ellipse rather than the other way
around, even though this is counterintuitive to the idea that
sub-classes are more complex than their super-classes (an idea
encouraged by the "drawing" interpretation, as more and more properties
are added as we go down in a UML).
"Sub-project" follows this principle. It a subset of the work done by
the aggregator project, and generates a subset of the artifacts. It is
consistent with above interpretation of "sub-class" as "sub-group",
which I think is the interpretation intended by OOP according the
substitutability principle.
Martin
[1]https://en.wikipedia.org/wiki/Liskov_substitution_principle