TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Stop using REST for state synchronization (2024)

2 pointsby mbid8 months ago

1 comment

FrankWilhoit8 months ago
The distinction between transfer and synchronization is right and important. But two problems remain.<p>The first is that the requirement for synchronization is an architecture smell, and a really bad one. It means that two or more actors have the same responsibilities. It creates incentives to overload types, and type overloading is the ultimate antipattern.<p>The second is that what is needed is state <i>evolution</i>, where each step of evolution grants access to a new role and revokes the access of a previous role.<p>Inheritance is the solution to both of these problems: each step inherits from the step before, and each new derived type is visible only to its own roles.<p>But while an object is in flight, it has only one (self-describing) type: the state is transferred, and the behavior is what is done to it by the recipient: tantamount to running the constructor of the derived type.