1 / 12

Metaprogramming and its relevance in Software Engineering

Metaprogramming and its relevance in Software Engineering. (CSC 532 Term Paper). By, Sucharitha Rodda. INTRODUCTION. Need for an evolution of Abstract Conceptual tools Metaprogramming is the art of programming programs that read, transform, or write other programs.

robertmann
Download Presentation

Metaprogramming and its relevance in Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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() «interface» MyComponent MyImpl

  6. Architecture «interface» Component +m1() +m2() «interface» MyComponent MyImpl MyStub +handle() «interface» 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 http://java.sun.com/products/ XML 1.0.http://www.w3.org/TR/ Simple Object Access Protocol (SOAP)http://www.w3.org/TR/

More Related