Download presentation
Presentation is loading. Please wait.
Published byRachel Bryan Modified over 6 years ago
1
Metaprogramming and its relevance in Software Engineering
(CSC 532 Term Paper) By, Sucharitha Rodda
2
INTRODUCTION Need for an evolution of Abstract Conceptual tools
Metaprogramming is the art of programming programs that read, transform, or write other programs
3
Metaprogramming in everyday life
Input -> Output 0 -> 0 : Normal program 1 -> 0 : Interpreter 0 -> 1 : Data Pre-Compiler 1 -> 1 : Automatic translator 2 -> 0 : Metainterpreter 2 -> 1 : Code walker 1 -> 2 : Phase splitter
4
Significance of Metaprogramming in Software Engineering
Enables Software Reuseability Enforces Consistency Performs semi automatic programming Helps in inexpensive maintenance of software
5
Metaprogramming applied to Web Component Deployment
«interface» Component +m1() +m2() MyComponent MyImpl
6
Architecture «interface» Component +m1() +m2() MyComponent
MyImpl MyStub +handle() Skeleton MySkeleton
7
abstract class A { int i; A a; }
interface B { } class C extends A { float f; B b; } class X extends C implements B { X x; } class Y extends X { boolean[] b; } class Z implements B { X x; } XMLSerializer: public static void serializeClassY(XMLSerializerStream s, Y o) { if(s.serializeReference(o)) return; o.serializeXML(s); // o may be of type Y or any // subtype thereof }
8
public void serializeXML(XMLSerializerStream s) {
s.openingTag("<classY>"); serializeBodyClassY(s); s.closingTag("</classY>"); } protected final void serializeBodyClassY(XMLSerializerStream s) { serializeBodyClassX(s); // superclass data layout XMLSerializer.serializeArrayOfBoolean(s, this.b); // boolean[] b;
9
Implementation Analysis Transformation
10
Why are metaprogramming techniques not used commonly?
Consist precisely in not using the studied language, but another language, through metaprograms Lack of a formal encoding Lack of a general approach Lack of a metaprogramming notation
11
Conclusion Computing today has to face two challenges, metaprogramming and the free availability of source code of software. Practitioners of computing arts should free themselves from slogans like multimedia, object-oriented, design-pattern, virtual machine, intelligent network, etc, and should rather adopt a scientific attitude.
12
References: http://www.erlang.org http://www.tunes.org
XML Simple Object Access Protocol (SOAP)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.