-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate out semantics v. HTML/HTTP-specific bits of forms #21
Comments
I'm not sure what's left if you remove everything in some way web-connected. I mean:
Taking some specific points:
You can make an instance of the form with
I think the same answer as above applies.
We're not even doing HTML forms very completely yet: there needs to be a
This is technically possible today, although we should probably define a rather more proper DOM rather than the current array of hashes thing, and document it.
The aim is for
Hm, that's an interesting scenario; got any more concrete examples?
As noted at the start, it's not immediately clear to me what could be extracted for a context this different. I mean, I think taking the design idea/approach and applying it in those contexts could end well, but I don't know what code re-use could sensibly happen. |
That may be true now, but it's not clear it needs to be limited by design. We might want to later add additional layers of compound or custom controls and validation, e.g. allow a single attribute of the top-level form to have a type indicating it is a group of input controls (presumably represented by its own class), or even a list of same. A use case for this off the top of my head might be a financial app that needs a common concept of a "beneficiary" to be used for anything that might be paid out or transferred upon death, such as insurance, retirement plan, trust, etc. Top-level forms that need to include a list of beneficiaries and payout percentages don't really care if each entry is rendered individually as a div containing a select from a dropdown of known persons, plus a text entry for a percentage; or alternately a single big table with columns for name, birthdate, tax-id, payout-percent. The top-level form just wants to say
I thought the docs said this could fall afoul of
OK, that makes sense to me.
This is part of what I meant about breaking the layers apart -- having a defined, documented interface I could use to add my own rendering or parsing interface. I might have gone XY on the actual problem though, because for me it looked like there was enough promiscuous knowledge that there had to be a disentanglement pass first -- though I freely admit that could have been just a mistaken first impression.
YAY! Are you the translation files going to be compatible with some existing toolkit, or are we going for "level up the industry" here too? :-)
Yeah, I can understand that completely.
This is more looking for a general mechanism/hook than something I had a particular list of ideas for, but here are a few:
I was thinking recently about how to build a method for configuring my client/server games that would work no matter the client-side UI chosen, and I realized I needed to create some sort of standard schema for defining the things a player would need to choose -- a selection for difficulty level, a bounded Int for max number of players joined into a single game, a list of friends to invite, a short Str for game instance name, an invite message, etc. These all make semantic sense whether the UI type is CLI, TUI, GTK, WebSPA, WebCanvas, etc. And then I saw Cro::WebApp::Form and went "THAT. I need exactly that. Now how do I separate the semantics, including attribute traits, validation model, etc. from the HTML renderer without massive copy/paste?" |
The semantic bits of the forms implementation are valuable separately from the HTML/HTTP-specific bits. For example, it would be useful to be able to:
Please break the existing monolithic form implementation into semantic versus HTML/HTTP-specific layers to support the above.
The text was updated successfully, but these errors were encountered: