- Year not given · 4 marks
Reuse framework versus program generator
Short answer
An application framework is a reusable skeleton extended by subclassing, giving high flexibility but needing knowledge of internals. A program generator produces code from a domain description, giving high productivity in narrow domains but limited flexibility. Frameworks use inversion of control; generators create programs with normal control flow.
Compare reuse framework and pattern generator.
Both are reuse approaches that reuse more than single components. An application (reuse) framework is a set of abstract and concrete classes and interfaces that forms the skeleton of an application; developers reuse it by extending it with their own subclasses. A program generator captures domain knowledge in a tool: developers write a short description in a domain-oriented language, and the generator produces the code automatically.
| Point | Application framework | Program generator |
|---|---|---|
| What is reused | Design and code of an application skeleton | Domain knowledge built into the generator |
| How it is used | Subclass and add code at "hot spots" | Write a specification or use an interactive tool |
| Output | Running system = framework + developer's code | Generated source code (sometimes edited further) |
| Control flow | Inversion of control: framework calls developer code | Generated program has its own normal control flow |
| Skill needed | Good OO programming and knowledge of framework internals | Knowledge of the domain and the description language |
| Range of use | Fairly wide (web apps, GUIs, middleware) | Narrow, well-understood domains only |
| Flexibility | High: any behaviour can be coded in subclasses | Limited to what the generator supports |
| Examples | Spring, Django, .NET, Java Swing | yacc/lex, report generators, CASE code generators, GUI builders |
In short: a framework gives a partly built program that developers complete by programming, while a generator lets developers describe what they want and builds the program for them. Generators give higher productivity in a narrow domain; frameworks give more flexibility across a wider range of applications.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- Application framework versus component reuse · Software Engineering, chapter 5
- Short note: generator-based reuse · Software Engineering, chapter 5
- Framework and design pattern with example · Object Oriented Analysis and Design, chapter 3
- Pattern vs framework; GRASP patterns · Object Oriented Analysis and Design, chapter 3
- Pyramid pattern output program · Object Oriented Programming, chapter 8
- Numerical: co-channel distance for 7-cell reuse · Wireless Communication, chapter 2