Missing Abstraction

Written by

in

Description

Architects tend to make every functionality or data element a separate component, ignoring the benefits of abstractions altogether. In the EA domain, the model should also contain abstract elements to illustrate a more general point of view. The absence of such elements may indicate that the model suffers from Missing Abstraction EA Smell.

Context

Derived from: “Functional Decomposition” and “Primitive Obsession”
The EA model should give a more abstract insight and, thus, provide also more general components. Inside those abstractions further elements can be introduced to enable extensive description of the architecture.

Cause

Lack of architecture enforcement. Sometimes, those who generate specifications and requirements don’t necessarily have real experience with those EA systems. Creating a simple element is so much easier than making a whole new extended component, right?

Consequences

The model is hard to read, complex and very confusing.

Detection

Many rather small components exist that are not aggregated into encompassing superelements. Count separate elements that are not encapsulated in a component. Candidates for the smell could be identified by Clustering-Algorithms.

Solution

If the component has a single responsibility, try to better model it as part of an existing component. Frequently, components designed as helper elements to another components are better off being combined into the base component they assist. Attempt to logically combine several elements into a new component that satisfies a design objective with a broader domain concept than the previous fine-grained ones.

Example

A Business Object consisting of multiple elements is not encapsulated in an abstraction. Instead of modelling contracts and customers together, only separate data objects exist that clutter the model. A concrete example, consider the elements in graphical example as a cluster. This cluster suffers from Missing Abstraction EA Smell, as many services and components are present but are not aggregated into a more general element.

Cypher query

MATCH (n) <br /> WITH count (n) as nodes, n.ClassName as label, n.community as communities <br /> WHERE nodes > $countOfNodesOfSameType <br /> WITH communities <br /> MATCH (t)-[st]->(s) <br /> WHERE t.community=s.community and t.community in communities <br /> WITH count (st) as relcount, communities <br /> MATCH (a)-[r]->(b) <br /> WHERE relcount > $relationsCount and a.community=b.community and b.community in communities <br />  optional MATCH p1=(s)-[r:CompositionRelationship|AggregationRelationship]->(t) <br /> WHERE s.community=t.community and s.community in communities <br /> WITH count (p1) as aggCnt, relcount, communities <br /> MATCH p=(a)-[r1]->(b) <br /> WHERE a.community=b.community and a.community in <br /> communities and (aggCnt=0 or  relcount/aggCnt > $ratio)  <br /> RETURN p

Cypher count query

MATCH (n) <br /> WITH count (n) as nodes, n.ClassName as label, n.community as communities <br /> WHERE nodes > $countOfNodesOfSameType <br /> WITH communities <br /> MATCH (t)-[st]->(s) <br /> WHERE t.community=s.community and t.community in communities <br /> WITH count (st) as relcount, communities <br /> MATCH (a)-[r]->(b) <br /> WHERE relcount > $relationsCount and a.community=b.community and b.community in communities <br />  optional MATCH p1=(s)-[r:CompositionRelationship|AggregationRelationship]->(t) <br /> WHERE s.community=t.community and s.community in communities <br /> WITH count (p1) as aggCnt, relcount, communities <br /> MATCH p=(a)-[r1]->(b) <br /> WHERE a.community=b.community and a.community in <br /> communities and (aggCnt=0 or  relcount/aggCnt > $ratio)  <br /> RETURN COUNT (distinct a.community)

Diagram

Diagram for Missing Abstraction

Aliases

Decomposition

Tags

soa, microservices, business, application, technology, abstraction, The Bloaters, between elements

Query parameters

[
    {
        "name": "countOfNodesOfSameType",
        "type": "number",
        "default": 3,
        "description": "Minimum number of nodes of the same type within a community."
    },
    {
        "name": "relationsCount",
        "type": "number",
        "default": 10,
        "description": "Minimum number of relations within a comminity."
    },
    {
        "name": "ratio",
        "type": "number",
        "default": 3,
        "description": "Ratio threshold"
    }
]

Related smells

All smells