Introduction to WebMacro Programming
Here's an overview of WebMacro's programming framework. You can also:
- download WebMacro here.
- Go back to Script or on to Design
- Browse WebMacro's JavaDoc API
Servlet Programming
The script language is built on top of a highly effective introspection engine, which makes life easy for the back-end programmer.Here are all the steps required to make data available to the template script:
WebMacro's powerful introspection engine takes care of the rest--examining your object to determine what properties and fields it contains, and making those available as template script variables. There are no special superclasses required, no object descriptions needed. It works with any Java class.
- Put the object in a hashtable
In the above template example, WebMacro might determine that $Customer.Name corresponds to Customer.getName() and that $order.Item.Name resolves to Order.getItem(String name). You'll also notice that, should the introspector prove inadequate, you can just call methods as is the case with $Accounting.findAccount($Customer). In general, though, it's preferable to stick to regular introspection where possible.
In addition to this, WebMacro's framework takes care of many servlet "housekeeping tasks", and provides access to a back-end component system capable of loading and caching objects.
In fact, you can register your own components with the back-end system, re-implementing some of WebMacro's core functionality to your own liking, and extending it with classes of your own.
You can view the API documentation online to learn more about it--but the best way to find out how it works is to download WebMacro and try it out!
On to WebMacro Design
api | design | faq | goals | links | license | othertech | quickstart | script | status