Design pattern for reusing immutable methods in object-oriented languages. Flageol, W., Gu�h�neuc, Y., Monnier, S., & Badri, M. Journal of Computer Languages (COLA), 86:101385, Elsevier, February, 2026. 25 pages.
Paper abstract bibtex Programming concepts from functional programming have grown in popularity and have been introduced in object-oriented programming. Among these concepts, immutability is a core concept of functional programming, which brings advantages to software development. However, introducing immutability in object-oriented programming languages presents some challenges. Problem: One of these challenges, in the concept of inheritance, is overriding of non-destructive mutators. Mutators are necessary for updating data as a software is running. Non-destructive mutators are mutators on immutable objects, which return new objects instead of modifying the receiver. When inheriting non-destructive mutators, a naive implementation will yield code duplication and have code scalability issues. Contribution: We analyze an example of overriding non-destructive mutators, discuss the challenges, and propose a solution that takes the form of a new design pattern, inspired from the Factory Method pattern. We also discuss the advantages and limitations of this pattern, as well as implementations in eight languages (Clojure, Common Lisp, C#, Java, Kotlin, OCaml, Rust, and Scala). We finally identify and discuss the language features that mostly affect the implementation of this pattern, and present a language extension to Common Lisp to demonstrate the effects of those features on the implementation. Conclusion: Our proposed design pattern helps reduce the code duplication and improve the code scalability of a naive implementation of inherited non-destructive mutators. However, using a language which includes features for functional updating is required to completely remove the code scalability issues of the implementation. We conclude that object-oriented programming languages should consider adding functional updating to their language features to better support their new functional programming features.
@ARTICLE{Flageol26-COLA-ImmutableMethodsDP,
AUTHOR = {William Flageol and Yann-Ga�l Gu�h�neuc and
Stefan Monnier and Mourad Badri},
JOURNAL = {Journal of Computer Languages (COLA)},
TITLE = {Design pattern for reusing immutable methods in
object-oriented languages},
YEAR = {2026},
MONTH = {February},
NOTE = {25 pages.},
OPTNUMBER = {},
PAGES = {101385},
VOLUME = {86},
EDITOR = {Marjan Mernik},
KEYWORDS = {Topic: <b>Design patterns</b>,
Rubrique : <b>patrons de conception</b>, Journal: <b>COLA</b>},
PUBLISHER = {Elsevier},
URL = {http://www.ptidej.net/publications/documents/COLA26a.doc.pdf},
ABSTRACT = {Programming concepts from functional programming have
grown in popularity and have been introduced in object-oriented
programming. Among these concepts, immutability is a core concept of
functional programming, which brings advantages to software
development. However, introducing immutability in object-oriented
programming languages presents some challenges. Problem: One of these
challenges, in the concept of inheritance, is overriding of
non-destructive mutators. Mutators are necessary for updating data as
a software is running. Non-destructive mutators are mutators on
immutable objects, which return new objects instead of modifying the
receiver. When inheriting non-destructive mutators, a naive
implementation will yield code duplication and have code scalability
issues. Contribution: We analyze an example of overriding
non-destructive mutators, discuss the challenges, and propose a
solution that takes the form of a new design pattern, inspired from
the Factory Method pattern. We also discuss the advantages and
limitations of this pattern, as well as implementations in eight
languages (Clojure, Common Lisp, C#, Java, Kotlin, OCaml, Rust, and
Scala). We finally identify and discuss the language features that
mostly affect the implementation of this pattern, and present a
language extension to Common Lisp to demonstrate the effects of those
features on the implementation. Conclusion: Our proposed design
pattern helps reduce the code duplication and improve the code
scalability of a naive implementation of inherited non-destructive
mutators. However, using a language which includes features for
functional updating is required to completely remove the code
scalability issues of the implementation. We conclude that
object-oriented programming languages should consider adding
functional updating to their language features to better support
their new functional programming features.}
}
Downloads: 0
{"_id":"E6bxrdA3u5Aw2Tku4","bibbaseid":"flageol-guhneuc-monnier-badri-designpatternforreusingimmutablemethodsinobjectorientedlanguages-2026","author_short":["Flageol, W.","Gu�h�neuc, Y.","Monnier, S.","Badri, M."],"bibdata":{"bibtype":"article","type":"article","author":[{"firstnames":["William"],"propositions":[],"lastnames":["Flageol"],"suffixes":[]},{"firstnames":["Yann-Ga�l"],"propositions":[],"lastnames":["Gu�h�neuc"],"suffixes":[]},{"firstnames":["Stefan"],"propositions":[],"lastnames":["Monnier"],"suffixes":[]},{"firstnames":["Mourad"],"propositions":[],"lastnames":["Badri"],"suffixes":[]}],"journal":"Journal of Computer Languages (COLA)","title":"Design pattern for reusing immutable methods in object-oriented languages","year":"2026","month":"February","note":"25 pages.","optnumber":"","pages":"101385","volume":"86","editor":[{"firstnames":["Marjan"],"propositions":[],"lastnames":["Mernik"],"suffixes":[]}],"keywords":"Topic: <b>Design patterns</b>, Rubrique : <b>patrons de conception</b>, Journal: <b>COLA</b>","publisher":"Elsevier","url":"http://www.ptidej.net/publications/documents/COLA26a.doc.pdf","abstract":"Programming concepts from functional programming have grown in popularity and have been introduced in object-oriented programming. Among these concepts, immutability is a core concept of functional programming, which brings advantages to software development. However, introducing immutability in object-oriented programming languages presents some challenges. Problem: One of these challenges, in the concept of inheritance, is overriding of non-destructive mutators. Mutators are necessary for updating data as a software is running. Non-destructive mutators are mutators on immutable objects, which return new objects instead of modifying the receiver. When inheriting non-destructive mutators, a naive implementation will yield code duplication and have code scalability issues. Contribution: We analyze an example of overriding non-destructive mutators, discuss the challenges, and propose a solution that takes the form of a new design pattern, inspired from the Factory Method pattern. We also discuss the advantages and limitations of this pattern, as well as implementations in eight languages (Clojure, Common Lisp, C#, Java, Kotlin, OCaml, Rust, and Scala). We finally identify and discuss the language features that mostly affect the implementation of this pattern, and present a language extension to Common Lisp to demonstrate the effects of those features on the implementation. Conclusion: Our proposed design pattern helps reduce the code duplication and improve the code scalability of a naive implementation of inherited non-destructive mutators. However, using a language which includes features for functional updating is required to completely remove the code scalability issues of the implementation. We conclude that object-oriented programming languages should consider adding functional updating to their language features to better support their new functional programming features.","bibtex":"@ARTICLE{Flageol26-COLA-ImmutableMethodsDP,\r\n AUTHOR = {William Flageol and Yann-Ga�l Gu�h�neuc and \r\n Stefan Monnier and Mourad Badri},\r\n JOURNAL = {Journal of Computer Languages (COLA)},\r\n TITLE = {Design pattern for reusing immutable methods in \r\n object-oriented languages},\r\n YEAR = {2026},\r\n MONTH = {February},\r\n NOTE = {25 pages.},\r\n OPTNUMBER = {},\r\n PAGES = {101385},\r\n VOLUME = {86},\r\n EDITOR = {Marjan Mernik},\r\n KEYWORDS = {Topic: <b>Design patterns</b>, \r\n Rubrique : <b>patrons de conception</b>, Journal: <b>COLA</b>},\r\n PUBLISHER = {Elsevier},\r\n URL = {http://www.ptidej.net/publications/documents/COLA26a.doc.pdf},\r\n ABSTRACT = {Programming concepts from functional programming have \r\n grown in popularity and have been introduced in object-oriented \r\n programming. Among these concepts, immutability is a core concept of \r\n functional programming, which brings advantages to software \r\n development. However, introducing immutability in object-oriented \r\n programming languages presents some challenges. Problem: One of these \r\n challenges, in the concept of inheritance, is overriding of \r\n non-destructive mutators. Mutators are necessary for updating data as \r\n a software is running. Non-destructive mutators are mutators on \r\n immutable objects, which return new objects instead of modifying the \r\n receiver. When inheriting non-destructive mutators, a naive \r\n implementation will yield code duplication and have code scalability \r\n issues. Contribution: We analyze an example of overriding \r\n non-destructive mutators, discuss the challenges, and propose a \r\n solution that takes the form of a new design pattern, inspired from \r\n the Factory Method pattern. We also discuss the advantages and \r\n limitations of this pattern, as well as implementations in eight \r\n languages (Clojure, Common Lisp, C#, Java, Kotlin, OCaml, Rust, and \r\n Scala). We finally identify and discuss the language features that \r\n mostly affect the implementation of this pattern, and present a \r\n language extension to Common Lisp to demonstrate the effects of those \r\n features on the implementation. Conclusion: Our proposed design \r\n pattern helps reduce the code duplication and improve the code \r\n scalability of a naive implementation of inherited non-destructive \r\n mutators. However, using a language which includes features for \r\n functional updating is required to completely remove the code \r\n scalability issues of the implementation. We conclude that \r\n object-oriented programming languages should consider adding \r\n functional updating to their language features to better support \r\n their new functional programming features.}\r\n}\r\n\r\n","author_short":["Flageol, W.","Gu�h�neuc, Y.","Monnier, S.","Badri, M."],"editor_short":["Mernik, M."],"key":"Flageol26-COLA-ImmutableMethodsDP","id":"Flageol26-COLA-ImmutableMethodsDP","bibbaseid":"flageol-guhneuc-monnier-badri-designpatternforreusingimmutablemethodsinobjectorientedlanguages-2026","role":"author","urls":{"Paper":"http://www.ptidej.net/publications/documents/COLA26a.doc.pdf"},"keyword":["Topic: <b>Design patterns</b>","Rubrique : <b>patrons de conception</b>","Journal: <b>COLA</b>"],"metadata":{"authorlinks":{}}},"bibtype":"article","biburl":"http://www.yann-gael.gueheneuc.net/Work/Publications/Biblio/complete-bibliography.bib","dataSources":["8vn5MSGYWB4fAx9Z4"],"keywords":["topic: <b>design patterns</b>","rubrique : <b>patrons de conception</b>","journal: <b>cola</b>"],"search_terms":["design","pattern","reusing","immutable","methods","object","oriented","languages","flageol","gu�h�neuc","monnier","badri"],"title":"Design pattern for reusing immutable methods in object-oriented languages","year":2026}