On Github mooreniemi / hyper_lightning_talk
How do the server and client share understanding of data types?
Profiles, and registered media types.
Where do we get our standardized interface?
Our types, and our protocol.
But HTTP sux. :c
That's just one protocol. Don't let it box you in! (Also: no it doesn't.)
How can we expose alternative state transitions in the current set of representations?
Hypermedia.
Hypermedia is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Distributed hypermedia allows the presentation and control information to be stored at remote locations. We're doing something fundamentally different here. We're saying expose data with context about how it can be used.When you have relatively little control over your clients, ie., can't expect them to update (mobile).
When you need properties like dynamic dispatch (associating an implementation with an operation) and dynamic binding (associating a name with an operation) in your program.
Hypermedia requires the client to work with a certain granularity of programmatically generatable interaction units.
This would make working with Storyboard driven development in iOS difficult and maybe impossible.
In Android, activities need to be declared in the manifest at compile time, but fragments could be generated during runtime.
Our new mental model: Graphs
Importantly, the client can request different sized "graphs" based on a set of tradeoffs like no network requests vs flexibility.
Want to minimize requests? Grab the biggest possible representation of application state with controls embedded of other potential application states, cache it, and move on.
Want to allow flexibility? Grab the smallest representation of application state with minimal controls linking (referencing, like reference types) to other potential application states.
* if the client supports meta-programming or polymorphic representation of untyped data (like maps) hypermedia can solve this problem. yes, static langs can be meta-programmed. no, i have not lost my mind. 😅
the constraints a client needs to accept to solve the first problem involve some tradeoffs. i think ideally, truly responsive clients with a shared understanding of controls and data types could work this way. in the real world, my guess is that this would best serve as a way to decouple server and client release cycles, for example, you could release on the server a change that is handled programmatically by the client until the client has time to flesh out the actual functionality via its own release. think MVP. you might not want to expose the user to anything less than the best possible UI. that's something to keep in mind as a trade off.All of these correspond to adding new nodes or edges to our graph. Done right the "hypermedia way" these can be done without the client needing to ever release a change.
this means:
😑 idgi...
Check out my extended presentation on hypermedia, discuss in #rest on freenode, or if all else fails, ask me. 😁