The Sequential Initializer Pattern
This paper describes the Sequential Initializer Pattern, a creational design pattern for programming. Creational design patterns deal with the creation and initialization of objects. The Sequential Initializer Pattern provides a way to initialize an object by enforcing a series of function calls which are responsible for the initialization of the semantically different parts of the complex object. This improves readability and writeability and reduces the cognitive load of the programmer.
The benefits of this pattern are numerous. It enforces correct usage by the developer, as there is only one way to initialize an object which is additionally enforced by the compiler. It is readable in a way that the intent of each passed parameter for initialization becomes clear. Dependencies and semantic connections between the parameters can be modeled as desired. We show that applying this pattern overcomes many of the hurdles of initialization of complex objects for a programmer.
Author(s): | Martin Eisemann, Anja Katharina Bertels, Dominik Deimel |
---|---|
Published: | July 2022 |
Type: | Article in conference proceedings |
Book: | Proc. European Conference on Pattern Languages of Programs (EuroPLoP) |
DOI: | https://doi.org/10.1145/35519 |
Presented at: | European Conference on Pattern Languages of Programs (EuroPLoP) 2022 |
Note: | Featured in ACM Showcase / Kudos |
@inproceedings{eisemann2022the, title = {The Sequential Initializer Pattern}, author = {Eisemann, Martin and Bertels, Anja Katharina and Deimel, Dominik}, booktitle = {Proc. European Conference on Pattern Languages of Programs (Euro{PL}oP)}, doi = { https://doi.org/10.1145/35519}, note = {Featured in {ACM} Showcase / Kudos}, month = {Jul}, year = {2022} }
Authors
Martin Eisemann
DirectorAnja Katharina Bertels
ExternalDominik Deimel
External