Design Pattern for Reusing Immutable Methods in Object-Oriented Languages. Flageol, W., Gu�h�neuc, Y., Badri, M., & Monnier, S. In Proceedings of the 28<sup>th</sup> European Conference on Pattern Languages of Programs (EuroPLoP), pages 1–9, July, 2023. ACM Press. 9 pages.
Paper abstract bibtex Context. Features and styles inspired by functional programming have grown in popularity in the world of object-oriented programming. Immutability is a core concept of functional programming, which brings advantages to software development. However, introducing immutability in object-oriented programming presents some challenges. Problem. One of these challenges is method overriding. When inheriting non-destructive mutators (methods used on immutable objects which return a new object instead of modifying the receiver), a naive approach generates code duplication and has scalability issues. Contribution. We analyse an example of this overriding problem and propose a solution in a new design pattern based on the factory method pattern. We also discuss the advantages and limitations of this pattern, as well as implementations in Clojure, Java, and Kotlin. We also identify and discuss the language features that mostly affect the implementation of this pattern. Conclusion. Our proposed design pattern helps mitigate some of the code duplication and scalability problems of a naive approach. However, the inclusion of a functional updating language feature is required to completely remove the scalability issues.
@INPROCEEDINGS{Flageol23-EuroPLoP-APsforMLS,
AUTHOR = {William Flageol and Yann-Ga�l Gu�h�neuc and Mourad Badri and
Stefan Monnier},
BOOKTITLE = {Proceedings of the 28<sup>th</sup> European Conference on Pattern Languages of Programs (EuroPLoP)},
TITLE = {Design Pattern for Reusing Immutable Methods in
Object-Oriented Languages},
YEAR = {2023},
OPTADDRESS = {},
OPTCROSSREF = {},
EDITOR = {Cesare Pautasso},
MONTH = {July},
NOTE = {9 pages.},
OPTNUMBER = {},
OPTORGANIZATION = {},
PAGES = {1–9},
PUBLISHER = {ACM Press},
OPTSERIES = {},
OPTVOLUME = {},
KEYWORDS = {Topic: <b>Design patterns</b>,
Rubrique : <b>patrons de conception</b>, Conference: PLoP},
URL = {http://www.ptidej.net/publications/documents/EuroPLoP23.doc.pdf},
ABSTRACT = {Context. Features and styles inspired by functional
programming have grown in popularity in the world of object-oriented
programming. Immutability is a core concept of functional
programming, which brings advantages to software development.
However, introducing immutability in object-oriented programming
presents some challenges. Problem. One of these challenges is method
overriding. When inheriting non-destructive mutators (methods used on
immutable objects which return a new object instead of modifying the
receiver), a naive approach generates code duplication and has
scalability issues. Contribution. We analyse an example of this
overriding problem and propose a solution in a new design pattern
based on the factory method pattern. We also discuss the advantages
and limitations of this pattern, as well as implementations in
Clojure, Java, and Kotlin. We also identify and discuss the language
features that mostly affect the implementation of this pattern.
Conclusion. Our proposed design pattern helps mitigate some of the
code duplication and scalability problems of a naive approach.
However, the inclusion of a functional updating language feature is
required to completely remove the scalability issues.}
}
Downloads: 0
{"_id":"p2iCng9EGxkx33LvM","bibbaseid":"flageol-guhneuc-badri-monnier-designpatternforreusingimmutablemethodsinobjectorientedlanguages-2023","author_short":["Flageol, W.","Gu�h�neuc, Y.","Badri, M.","Monnier, S."],"bibdata":{"bibtype":"inproceedings","type":"inproceedings","author":[{"firstnames":["William"],"propositions":[],"lastnames":["Flageol"],"suffixes":[]},{"firstnames":["Yann-Ga�l"],"propositions":[],"lastnames":["Gu�h�neuc"],"suffixes":[]},{"firstnames":["Mourad"],"propositions":[],"lastnames":["Badri"],"suffixes":[]},{"firstnames":["Stefan"],"propositions":[],"lastnames":["Monnier"],"suffixes":[]}],"booktitle":"Proceedings of the 28<sup>th</sup> European Conference on Pattern Languages of Programs (EuroPLoP)","title":"Design Pattern for Reusing Immutable Methods in Object-Oriented Languages","year":"2023","optaddress":"","optcrossref":"","editor":[{"firstnames":["Cesare"],"propositions":[],"lastnames":["Pautasso"],"suffixes":[]}],"month":"July","note":"9 pages.","optnumber":"","optorganization":"","pages":"1–9","publisher":"ACM Press","optseries":"","optvolume":"","keywords":"Topic: <b>Design patterns</b>, Rubrique : <b>patrons de conception</b>, Conference: PLoP","url":"http://www.ptidej.net/publications/documents/EuroPLoP23.doc.pdf","abstract":"Context. Features and styles inspired by functional programming have grown in popularity in the world of object-oriented programming. Immutability is a core concept of functional programming, which brings advantages to software development. However, introducing immutability in object-oriented programming presents some challenges. Problem. One of these challenges is method overriding. When inheriting non-destructive mutators (methods used on immutable objects which return a new object instead of modifying the receiver), a naive approach generates code duplication and has scalability issues. Contribution. We analyse an example of this overriding problem and propose a solution in a new design pattern based on the factory method pattern. We also discuss the advantages and limitations of this pattern, as well as implementations in Clojure, Java, and Kotlin. We also identify and discuss the language features that mostly affect the implementation of this pattern. Conclusion. Our proposed design pattern helps mitigate some of the code duplication and scalability problems of a naive approach. However, the inclusion of a functional updating language feature is required to completely remove the scalability issues.","bibtex":"@INPROCEEDINGS{Flageol23-EuroPLoP-APsforMLS,\r\n AUTHOR = {William Flageol and Yann-Ga�l Gu�h�neuc and Mourad Badri and \r\n Stefan Monnier},\r\n BOOKTITLE = {Proceedings of the 28<sup>th</sup> European Conference on Pattern Languages of Programs (EuroPLoP)},\r\n TITLE = {Design Pattern for Reusing Immutable Methods in \r\n Object-Oriented Languages},\r\n YEAR = {2023},\r\n OPTADDRESS = {},\r\n OPTCROSSREF = {},\r\n EDITOR = {Cesare Pautasso},\r\n MONTH = {July},\r\n NOTE = {9 pages.},\r\n OPTNUMBER = {},\r\n OPTORGANIZATION = {},\r\n PAGES = {1–9},\r\n PUBLISHER = {ACM Press},\r\n OPTSERIES = {},\r\n OPTVOLUME = {},\r\n KEYWORDS = {Topic: <b>Design patterns</b>, \r\n Rubrique : <b>patrons de conception</b>, Conference: PLoP},\r\n URL = {http://www.ptidej.net/publications/documents/EuroPLoP23.doc.pdf},\r\n ABSTRACT = {Context. Features and styles inspired by functional \r\n programming have grown in popularity in the world of object-oriented \r\n programming. Immutability is a core concept of functional \r\n programming, which brings advantages to software development. \r\n However, introducing immutability in object-oriented programming \r\n presents some challenges. Problem. One of these challenges is method \r\n overriding. When inheriting non-destructive mutators (methods used on \r\n immutable objects which return a new object instead of modifying the \r\n receiver), a naive approach generates code duplication and has \r\n scalability issues. Contribution. We analyse an example of this \r\n overriding problem and propose a solution in a new design pattern \r\n based on the factory method pattern. We also discuss the advantages \r\n and limitations of this pattern, as well as implementations in \r\n Clojure, Java, and Kotlin. We also identify and discuss the language \r\n features that mostly affect the implementation of this pattern. \r\n Conclusion. Our proposed design pattern helps mitigate some of the \r\n code duplication and scalability problems of a naive approach. \r\n However, the inclusion of a functional updating language feature is \r\n required to completely remove the scalability issues.}\r\n}\r\n\r\n","author_short":["Flageol, W.","Gu�h�neuc, Y.","Badri, M.","Monnier, S."],"editor_short":["Pautasso, C."],"key":"Flageol23-EuroPLoP-APsforMLS","id":"Flageol23-EuroPLoP-APsforMLS","bibbaseid":"flageol-guhneuc-badri-monnier-designpatternforreusingimmutablemethodsinobjectorientedlanguages-2023","role":"author","urls":{"Paper":"http://www.ptidej.net/publications/documents/EuroPLoP23.doc.pdf"},"keyword":["Topic: <b>Design patterns</b>","Rubrique : <b>patrons de conception</b>","Conference: PLoP"],"metadata":{"authorlinks":{}}},"bibtype":"inproceedings","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>","conference: plop"],"search_terms":["design","pattern","reusing","immutable","methods","object","oriented","languages","flageol","gu�h�neuc","badri","monnier"],"title":"Design Pattern for Reusing Immutable Methods in Object-Oriented Languages","year":2023}