An Extensible Compiler for Implementing Software Design Patterns as Concise Language Constructs

被引:1
|
作者
Ghaleb, Taher Ahmed [1 ]
Aljasser, Khalid [2 ]
Alturki, Musab A. [3 ,4 ]
机构
[1] Queens Univ, Sch Comp, Kingston, ON, Canada
[2] King Fahd Univ Petr & Minerals, Informat & Comp Sci Dept, Dhahran 31261, Saudi Arabia
[3] Runtime Verificat Inc, Urbana, IL 61801 USA
[4] King Fahd Univ Petr & Minerals, Dhahran 31261, Saudi Arabia
关键词
Design patterns; singleton; observer; decorator; aspect-oriented programming; extensible compiler; Polyglot; abc; CODE GENERATION;
D O I
10.1142/S0218194021500327
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Design patterns are generic solutions to common programming problems. Design patterns represent a typical example of design reuse. However, implementing design patterns can lead to several problems, such as programming overhead and traceability. Existing research introduced several approaches to alleviate the implementation issues of design patterns. Nevertheless, existing approaches pose different implementation restrictions and require programmers to be aware of how design patterns should be implemented. Such approaches make the source code more prone to faults and defects. In addition, existing design pattern implementation approaches limit programmers to apply specific scenarios of design patterns (e.g. class-level), while other approaches require scattering implementation code snippets throughout the program. Such restrictions negatively impact understanding, tracing, or reusing design patterns. In this paper, we propose a novel approach to support the implementation of software design patterns as an extensible Java compiler. Our approach allows developers to use concise, easy-to-use language constructs to apply design patterns in their code. In addition, our approach allows the application of design patterns in different scenarios. We illustrate our approach using three commonly used design patterns, namely Singleton, Observer and Decorator. We show, through illustrative examples, how our design pattern constructs can significantly simplify implementing design patterns in a flexible, reusable and traceable manner. Moreover, our design pattern constructs allow class-level and instance-level implementations of design patterns.
引用
收藏
页码:1043 / 1067
页数:25
相关论文
共 50 条
  • [21] Design and implementation of object description language compiler
    Inst of Software, Chinese Acad of Sciences, Beijing, China
    Ruan Jian Xue Bao, 7 (525-531):
  • [22] Using a Formal Language Constructs for Software Model Evolution
    Ajila, Samuel A.
    Alam, Shahid
    2009 IEEE THIRD INTERNATIONAL CONFERENCE ON SEMANTIC COMPUTING (ICSC 2009), 2009, : 390 - +
  • [23] Tool demonstration: Silver extensible compiler frameworks and modular language extensions for Java']Java and C
    Van Wyk, Eric
    Krishnan, Lijesh
    Bodin, Derek
    Johnson, Eric
    Schwerdfeger, August
    Russell, Phil
    SIXTH IEEE INTERNATIONAL WORKSHOP ON SOURCE CODE ANALYSIS AND MANIPULATION, PROCEEDINGS, 2006, : 161 - 161
  • [24] A LANGUAGE FOR IMPLEMENTING INFORMATION-RETRIEVAL SOFTWARE
    OKANE, KC
    ONLINE REVIEW, 1992, 16 (03): : 127 - 137
  • [25] Implementing design patterns as aspects
    Dinsoreanu, M
    Morar, D
    Salomie, I
    MODELLING AND SIMULATION 2005, 2005, : 185 - 189
  • [26] Implementing aspect-oriented programming constructs as modular language extensions
    Van Wyk, Eric
    SCIENCE OF COMPUTER PROGRAMMING, 2007, 68 (01) : 38 - 61
  • [27] An abstract, reusable, and extensible programming language design architecture
    Aït-Kaci, Hassan
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2013, 8000 : 112 - 166
  • [28] THE DESIGN OF EXPERIMENTS USING COMPILER LANGUAGE COMPUTER PROGRAMS
    KANE, JV
    NUCLEAR INSTRUMENTS & METHODS, 1964, 31 (01): : 83 - 86
  • [29] DESIGN AND CORRECTNESS OF A COMPILER FOR A NON-PROCEDURAL LANGUAGE
    HOFFMANN, CM
    ACTA INFORMATICA, 1978, 9 (03) : 217 - 241
  • [30] A compiler design for the agent-based programming language
    Zhao, W
    Jo, CH
    COMPUTERS AND THEIR APPLICATIONS, 2003, : 393 - 396