Deficient Encapsulation

Written by

in

Description

This Smell occurs when an abstraction makes its members accessible to other abstractions in a more permissive way, which is not necessarily required. In the EA domain, particularly in the ArchiMate modeling language there are no access modifiers. As a result, we need to slightly adjust the definition to apply this concept to ArchiMate. Instead of modifiers, we try to identify sources of information that contain sensitive data while the rules for accessing those data are more lenient than necessary.

Context

Derived from: “Deficient Encapsulation”
Components have too deep insight into unimportant details of other elements, making their work harder.

Cause

Keep a close eye on components that spend too much time together. Good elements should know as little about each other as possible. Such elements are easier to maintain and reuse.

Consequences

Not restricted sensitive data can be retrieved and modified by other abstractions unintentionally or imperceptibly.

Detection

In ArchiMate, Business Objects, Data Objects and Artifacts serve as data source representations. However, there is no distinction made between sensitive and non-sensitive data sources. To address this, we can explore identifying a property that designates a data source as confidential. Additionally, we can establish a threshold for permissible access to sensitive data. If the number of accesses exceeds this threshold, we may interpret it as an indication of a Deficient Encapsulation EA Smell.

Solution

Try to hide as much unneeded information as possible. Integrate functionality into components that use that functionality. This is only possible if the first component truly does not need these parts.

Cypher query

MATCH (n) <br /> WHERE n.ClassName ='DataObject' or n.ClassName='BusinessObject' or n.ClassName='Artifact' <br /> WITH n <br /> WHERE ANY (x in keys(n) WHERE n[x] IN $sensitiveProperties OR toLower(x) IN $sensitiveProperties) <br /> WITH  n <br /> MATCH (n)-[r:AccessRelationship]-(m) <br /> WITH n, COUNT (r) as accessCount <br /> MATCH p = (n)-[r:AccessRelationship]-(m) <br /> WHERE accessCount > $permissibleCount <br /> RETURN p

Cypher count query

MATCH (n) WHERE n.ClassName ='DataObject' or n.ClassName='BusinessObject' or n.ClassName='Artifact' <br /> WITH n WHERE ANY (x in keys(n) WHERE n[x] IN  ["confident", "sensible", "sensitive"] OR toLower(x) IN ["confident", "sensible", "sensitive"]) WITH n MATCH (n)-[r:AccessRelationship]-(m) WITH n, COUNT (r) as accessCount MATCH p = (n)-[r:AccessRelationship]-(m) WHERE accessCount > 3 RETURN count (distinct n)

Diagram

Diagram for Deficient Encapsulation

Aliases

Too Much Information

Tags

soa, microservices, business, application, technology, The Couplers, between elements

Query parameters

[
    {
        "name": "sensitiveProperties",
        "type": "list",
        "default": [
            "confident",
            "sensible",
            "classified",
            "sensitive"
        ],
        "description": "The property values specifying an element as confidential."
    },
    {
        "name": "permissibleCount",
        "type": "number",
        "default": "2",
        "description": "The permissible number of elements for accessing a confidential data source."
    }
]

Related smells

    All smells