Constructor with side effects

Overview

The act of creation of an object should not alter data on the server-side or have any other significant side-effect. For this reason, using DML statements inside constructors is considered unsafe.

Business Impact

Decreased operational efficiency, increased potential for human error, delayed time-to-market, and decreased employee satisfaction.

Resources

Frequent

Incidence

How common is this issue?
22%8%
arrow down13%
lower

Exposure

How long do organizations remain exposed before fixing the problem?
2 years7 months
arrow down78%
shorter
BenchmarkWith Clayton

Frameworks

EasyiconAutomatediconData IntegrityiconData HandlingiconA04:2021 – Insecure Designicon