Quick search:

What is scaffolding

generation of user interface components and/or behavior from reflection, meta data, defaults and specifications.

Scaffolding is often done by model-view-controller frameworks by the generation of application code for creating, reading, updating and deleting database entries (CRUD). Scaffolding was popularized by the Ruby on Rails framework. Rails does both static scaffolding (code generation) and dynamic scaffolding (generates behavior on the flight), but its native scaffolding is currently limited to what can be done from database meta data.

Extended scaffolding takes the domain model meta data as its starting point so that it can can not only scaffold the traditional Create, Read, Edit, and Delete actions, but also relations and searches. PhpPeanuts has been doing extended scaffolding since its very first version that was released (march 2004). It dynamically scaffolds not only CRUD and  generates and validates the corresponding forms but also hyperlinks, select and  dialog widgets, and dialogs and property pages for navigating and editing relationships. It scaffolds filters for SQL generation that are used by search pages for query by example. It does not need to be told to do so, scaffolding happens automatically when the respective pages are requested from the web server or submitted forms are received*.

PhpPeanuts does in general not generate code. Code generation is out of line with the 'once and only once' principle: it produces sort of the same code over and over. This would not be so if the generated code would not be maintained by humans, but if the code is modfied manually, maintenance will have to be manual too. And if it is not to be modified manually, why generate it in the first place?

So instead phpPeanuts simply produces the required behavior directly. The design of phpPeanuts includes several seams where the application developer can override the scaffolded (and other), default behavior. The overrides do use parameterization, but most of it is done by overriding methods. In his overriding methods the application developer is free to program whatever he wants, so that he is not limitied to what the parameterization of phpPeanuts can do and can not do.

Because everyting is initially dynamic those parts of user interfaces that are scaffolded by phpPeanuts will adapt with each request to changes made in the meta data. This is great for prototyping the domain model and getting early customer feedback. As the application development continues the developer will add more specifications and override the default user interface behavior. This will generallly make the user interface more targeted to specific tasks but less responsive to changes in the domain model.


* except for the scaffolding of propertydescriptors from database meta data, which has to be actively initiated by the application developer, see How to add field properties for database columns automatically.