Frame Technology

FrameTechnology (FT) is a staged, template-based approach to code reuse developed initially by Paul G. Bassett in the 80s.

In its original formulation, a 'frame' is essentially an abstract block of code that provides some default functionality. A frame may add, delete, or replace chunks of code within the frames it composes. The output of an FT program is a concrete program in the target language. In this sense, FrameTechnology serves a purpose very similar to RealMacros or MetaProgramming. Similar to ObjectOriented or AspectOriented programming, FT provides much freedom to override named chunks of code (insert before, after, or instead-of) - that is, the 'higher level' frame can override defaults in the 'lower level' frame. Some degree of computation is supported during frame construction.

Essentially, FT attempts to be reusable by being re-editable. Rather than invoking a frame with a huge number of parameters, one incrementally transforms a frame by adjusting parameters, overrides, and inserts. The incremental nature of frames reduces the burden on developers, allows reuse without resulting in a ton of explicit parameters or a large number of macro wrappers. But developers require greater knowledge of the internal structure, of the names used within invoked frames, at a level similar to directly editing the code. This is considered, by many, to be a worthy trade-off. The widely respected DonaldKnuth was quoted as saying: "I also must confess to a strong bias against the fashion for reusable code. To me, “re-editable code” is much, much better than an untouchable black box or toolkit. I could go on and on about this. If you’re totally convinced that reusable code is wonderful, I probably won’t be able to sway you anyway, but you’ll never convince me that reusable code isn’t mostly a menace."

Frames themselves are untyped. However, the generated program may still be analyzed for safety, optimized, et cetera before runtime. Unless the FrameTechnology is well-integrated with the toolchain, FT leads to many of the same difficulties seen with macro and template systems, where it becomes unclear how errors relate to the source text. This suggests that there should be at least some integration in the toolchains, i.e. ideally an FT IntegratedDevelopmentEnvironment would support debugging and provide warning and error messages in terms of the original FT source. This is beyond difficult unless the language or its main implementations are designed for effective integration with some form of FT in the first place.

FrameTechnology for several languages is supported by the OpenSource XVCL (http://xvcl.comp.nus.edu.sg/overview_brochure.php).


See: RealMacros, MetaProgramming, TemplateMetaprogramming, AspectOrientedProgramming


EditText of this page (last edited December 1, 2010) or FindPage with title or text search