Form API: the next generation

Track: 
Coder
Experience: 
Advanced

Form API is perhaps the most loved and talked about API shipped with Drupal core. As such, it may very well be the most hated API too.

The API in its current form has been around for a while; we've been traversing hash-flagged array since time immemorial and AHAH has never really lived up to its name.

This session will demonstrate some of FAPI's shortcomings and those of the renderable array system on which it is built. Most of them can be changed without changing the architecture, but what if we do change the fundamentals of how forms are processed? Will that make us happier and Drupal better?

This session has no intention of showing the path to a better form API, but rather to demonstrate why we should think of updating the API, and shows ideas of how we might do that. A rough example module that incorporates some ideas can be found at http://github.com/bartfeenstra/fapitng.

Intended audience: 

Drupal core developers who want a cleaner and more flexible Form API.

Questions answered by this session
Question 1: 
How does form API depend on the renderable element API, and how should we keep these APIs separated?
Question 2: 
What are some of the simple shortcomings in form API?
Question 3: 
How can we make Form API cleaner without changing too much of its code?
Question 4: 
Does using classes in the renderable element API and Form API improve developer experience?
Question 5: 
What if we separate Form API into an input API and a stripped down FAPI, just to render input structures into forms?
3.42857
Your rating: None Average: 3.4 (35 votes)

Comments

Core conversations?

This might be good in Core Conversations if it doesn't get in as a session.

I now realise I should

I now realise I should rephrase the intended audience: this session is for all developers who use Form API, but specifically for those who want to work at getting a better one in core.

This means you're most welcome as a developer of contributed modules, because those modules probably use more advanced FAPI black magic than Drupal core does.

Good Core Conversations Topic

I feel this would be best served as a Core Conversations topic.

Diamond Sponsors

 
Palantir.net
VPS NET

Platinum sponsors

 
workhabit
Trellon

Gold Sponsors

 
HotDrupal.com
Treehouse Agency
Microsoft
NorthPoint
Duo
Drupal Connect
Chapter Three