|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
|
News |
|||
| Program Generators with XML and Java | Generative Programming Methods, Tools, and Applications | Code Generation in Action | Programming Language Processors in Java: Compilers and Interpreters |
Code generation (CG) might help to reduce programming repetition and error, and increase consistency and maintainability when writing in any computer language, but it is especially important when writing in scripting languages.
In some areas up to 60% of code can be generated by using custom code generation in scripting languages...
I suspect that all this noise about successful program generation using XML and Java is somewhat fake.
2 of 2 people found the following review helpful:
The ideas in the book are worth exploring, February 9, 2002
Reviewer:
Soumen Sarkar (see more about me) from Fremont, CA United States
Agreed that XML may not be the best language to capture domain specification
expressiveness. But use of XML/XSLT to do custom code generation has the
benifit of rapid application prototyping and development. The crucial
fact is that the domain specification is captured in XML only relatively few
times and project software developers mainly use the generated code. The question
is how many people in the project is exposed to 'ugliness' of XML and how many
times. The advantages of 'neat' code generation far outweigh the disadvantages
of 'ugliness' of domain specification in XML.
In a real Network Management Software development I achieved 60% of generated code (EJB, SNMP, Java utilities) by using custom code generation by XML/XSLT. Only myself dealt with XML other software developers happily used generated code. You can imagine the lead the project had and continues to have because of use of XML/XSLT in project specific custom code generation. The code generation system is stable now -- any new addition in EJB, SNMP model results in thousands of lines of Java/SQL/XML/SVG code without any additional effort.
I would, therefore, continue to recommend the book as worth exploring. This book really contributed new techniques in software development. More specically with XML/XSLT you have freely available tools to implement "model driven programming" in your software project.
So so, January 15, 2002
Reviewer: A reader from Victoria, Canada
While the book has interesting ideas, it ignores useful results of the domain-specific
language community. More important, it preaches to use XML as a domain-specific
language, which is in my opinion a disastrous idea.
Terence Parr (jGuru.com) provides an excellent argument why this is the case in his article "Answers to the question 'When shouldn't you use XML?'", August 2001, IBM developerWorks : XML zone : XML zone articles:
"XML is a poor human interface: Humans have an innate ability to apply structure to a stream of characters (sentences), therefore, adding markup symbols can only make it harder for us to read and more laborious to type. The problem is that most programmers have very little experience designing and parsing computer languages. Rather than spending the time to design and parse a human-friendly language, programmers are using the fastest path to providing a specification language and implementation: "Oh, use XML. Done." And that's OK, but I want programmers to recognize that they are providing an inferior interface when they take that easy route."
Besides, the book is poorly typeset. It appears that the font was increased until the book had more than 400 pages. I have never seen a bigger font in a computing book! I don't know why Prentice Hall endangers their good reputation with such a poorly typeset publication. Better try to borrow the book first before potentially wasting your money.
[Czarnecki_Eisenecker] Generative Programming Methods, Tools, and Applications
Krzysztof Czarnecki (Author), Ulrich Eisenecker (Author),
|
Chapter 1 "What is this book about?" - The authors describe GP. Short and sweet..... Chapter 2 "Domain Engineering" - A rather dry, pedantic review of current Domain Engineering methods. This chapter reads like a PHD lit review. Boring.... Chapter 3 "Domain Engineering and OO Analysis and Design" - Why OO Analysis isn't appropriate for designing reusable libraries and analysis methods that are more suitable for the task. Quick and painless.... Chapter 4 "Feature Modeling" - One of the high points of the book. For those of you who have been stymied by the inflexibility of UML, the authors introduce the technique of "feature diagrams" which allow library designers to defer decisions like inheritance vs. aggregation until later in the design. Potentially very useful. Chapter 5 "The Process of GP" - Describes how GP should work in an ideal world (which unfortunately doesn't exist yet). A bit too abstract..... Chapter 6 "Generic Programming" - Describes type based programming (i.e. C++ templates) and various languages support for Generic Programming. Java programmers won't like this one! Chapter 7 "Component-Oriented Template-Based C++ Programming Techniques" - The title pretty much says it all. Good introduction to C++ templates. Chapter 8 "Aspect-Oriented Programming" - Aspects are portions of code that have little to do with the actual intent of the code. Examples are synchronization and error handling. This chapter describes how messy aspects can make code and how to separate aspects from core functionality. Good stuff.... Chapter 9 "Generators" - Describes how ideal code Generators should work. Good introduction to the topic. Chapter 10 "Static Metaprogramming in C++" - For me this is the high point of the book. Compile time control structures such as IF<>, SWITCH<>, DO<> and WHILE<> are introduced. These can be used to generate configurable types as shown in later chapters. These structures are difficult to debug but if used conservatively are very powerful! Chapter 11 "Intentional Programming" - A description of Microsoft's Intentional Programming environment. IP is the ideal GP development environment that allows library designers to enhance the main IDE with domain specific libraries. Developers interact directly with the source parse trees that are rendered to the IDE in a domain specific manner. The description is interesting but the IP Software is potential Vaporware and I'm kinda sick of reading about MS development tools that will change the world (C# anyone????) Chapter 12-14 - The final chapters describe how to build template class generators that allow the application programming to specify functionality as a template parameter and the generator will build the type. It's as close to GP as we can get today. A list container class, bank account class and a highly optimized matrix library are designed using the GP methodology. It's nice to see the authors actually practicing what they preach. Aside from the overly academic feel to the book and touting Microsoft
fantasy-ware (which may become available... who knows?) this book offers
much food for thought for system designers and C++ library implementers.
The template tricks described are difficult to debug but with a little
luck future compilers will provide better support for this style of
compile time design. I look forward to the 2nd or 3rd edition of this
book when this stuff matures. |
[Herrington2003]
Code Generation in Action
by Jack Herrington
(Paperback)
|
|
Code Generation in Action is an A-to-Z guide covering building,
buying, deploying and using code generators. If you are a software
engineer-whether beginner or advanced-eager to become the "ideas
person," the mover-and-shaker on your development team, you should learn
CG techniques. This book will help you master them.
What's Inside:
|
Sorry, I can't jump on this bandwagon. |
The author's classification of various forms of active code generation clearly elucidates the potential of Code Generation. Usage of templates for code generation is an excellent suggestion. Explanations on various code snippets and regex macros are simply second to none. Chapters 3, 4, 5 and 10 are a must read for every developer. Having implemented a large-scale database conversion from IDMS to DB2 (schema, data dictionary, run time and programs) using home grown automated generators in the past, I really enjoyed reading Chapter 10. I completely agree with the assertions made there and I am impressed by the way the author addresses common concerns. This chapter documents a practical approach to ease the burden of writing repetitive code for code heavy frameworks. Schema Oriented Code Generation is a practical approach to code generation. I also find various references in this Chapter and others extremely valuable. The author has shown that with sufficient metadata about a system, a significant portion of the repetitive coding tasks relating to data access, user interface, test and documentation can be automated in a consistent manner using custom code generators. It is refreshing to see code snippets in Ruby. The author's selection of Ruby becomes self evident after reading the various code snippets. I find this to be a very compelling book and a must have for architects and seasoned developers! |
All the code snippets and regular expression samples are explained in a very clean, detailed way. I was pleased to see that many examples were non-trivial, covering concrete, real world, implementations. Herrington uses Ruby as an implementation language; you may like it or not, but what really matters here are the concepts, not the syntax and even if you don't know Ruby (like me), you will find the code pretty easy to follow. |
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: November 08, 2008