loading
Papers Papers/2022 Papers Papers/2022

Research.Publish.Connect.

Paper

Paper Unlock

Author: Virginia Niculescu

Affiliation: Faculty of Mathematics and Computer Science, Babeş-Bolyai University, 1 M. Kogalniceanu, Cluj-Napoca, Romania

Keyword(s): Decorator, Patterns, Templates, Policy, Accessibility, Extensibility, Interfaces, C++.

Abstract: C++ Policies represent an interesting metaprogramming mechanism that allows behavior infusion in a class. In this paper, we will investigate the possibility of using them for the implementation of some extended Decorator pattern variants. For the MixDecorator variant, policies are used to simulate extension methods, which are needed for implementation. Beside this, other two alternatives for Decorator pattern are proposed: one purely based on inheritance, and another that is a hybrid one; the last one wraps an object with decorations defined as a linear hierarchy of classes – introduced using policies. This is possible since a policy introduces a kind of recursive definition for inheritance. The advantages and disadvantages of these variants are analyzed on concrete examples. The hybrid variant presents many important advantages that qualify it as a valid and efficient Decorator pattern variant – HybridDecorator.

CC BY-NC-ND 4.0

Sign In Guest: Register as new SciTePress user now for free.

Sign In SciTePress user: please login.

PDF ImageMy Papers

You are not signed in, therefore limits apply to your IP address 18.191.135.224

In the current month:
Recent papers: 100 available of 100 total
2+ years older papers: 200 available of 200 total

Paper citation in several formats:
Niculescu, V. (2020). Efficient Decorator Pattern Variants through C++ Policies. In Proceedings of the 15th International Conference on Evaluation of Novel Approaches to Software Engineering - ENASE; ISBN 978-989-758-421-3; ISSN 2184-4895, SciTePress, pages 281-288. DOI: 10.5220/0009342802810288

@conference{enase20,
author={Virginia Niculescu.},
title={Efficient Decorator Pattern Variants through C++ Policies},
booktitle={Proceedings of the 15th International Conference on Evaluation of Novel Approaches to Software Engineering - ENASE},
year={2020},
pages={281-288},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0009342802810288},
isbn={978-989-758-421-3},
issn={2184-4895},
}

TY - CONF

JO - Proceedings of the 15th International Conference on Evaluation of Novel Approaches to Software Engineering - ENASE
TI - Efficient Decorator Pattern Variants through C++ Policies
SN - 978-989-758-421-3
IS - 2184-4895
AU - Niculescu, V.
PY - 2020
SP - 281
EP - 288
DO - 10.5220/0009342802810288
PB - SciTePress