Home // ICSEA 2015, The Tenth International Conference on Software Engineering Advances // View article
Implementing the Observer Design Pattern as an Expressive Language Construct
Authors:
Taher Ghaleb
Khalid Aljasser
Musab Al-Turki
Keywords: Design Patterns; Aspect-Oriented Programming; Extensible Compiler; Language Extension; Observer Pattern.
Abstract:
Observer is a commonly used design pattern as it carries a lot of reusability and modularity concerns in object-oriented programming and represents a good example of design reuse. Implementing the observer design pattern (and several other design patterns) is known to typically cause several problems such as implementation overhead and traceability. In the literature, several approaches have been proposed to alleviate such problems. However, these approaches only considered the implementation of a specific scenario of the observer pattern, which is concerned with having a single subject with multiple observers. In addition, the code used to implement this pattern was scattered throughout the program, which complicated implementing, tracing and reusing them. In this paper, we: A) provide a systematic classification of all possible scenarios of the observer design pattern and B) introduce a novel approach to implement them using an expressive and easy-to-use construct in Java. The proposed observer construct is built as a language extension using the abc extensible compiler. We illustrate through several observer scenarios how the construct significantly simplifies the implementation and improves reusability.
Pages: 463 to 469
Copyright: Copyright (c) IARIA, 2015
Publication date: November 15, 2015
Published in: conference
ISSN: 2308-4235
ISBN: 978-1-61208-438-1
Location: Barcelona, Spain
Dates: from November 15, 2015 to November 20, 2015