6 ms·
> Fundamentally, microservices allow you to isolate state. I can take two services and split them up - and now I've split their state spaces. I can put a queue
by a4isms 4y ago
> Fundamentally, microservices allow you to isolate state. I can take two services and split them up - and now I've split their state spaces. I can put a queue service between them and now I've sliced out the state of their communication.
Dr. Alan Kay would like a word. This is literally the premise behind OO:
> "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things."—Dr. Alan Kay
Outside of "extreme late-binding," which is a fascinating topic in its own right, isolating state is exactly the point of OOP. If we need microservices to accomplish isolation of state, that suggests we got OOP wrong, very wrong.
- mbrodersen 4y agoThe Erlang programming language is AFAIK the only programming language used in production that does what Alan Kay is talking about. So it is probably the only Object Oriented programming language used in production today.
- pixl97 4y agoThen I'll have to say that most get OOP very wrong, for example any time an application crashes for any reason.
- seti0Cha 4y agoArguably, we did. In large codebases worked on by multiple teams it's not unusual to see teams drilling holes in OO walls because they "just want to get their work done" and view the abstractions as barriers. Taken along with the unfortunate fact that the majority of engineers suck at decomposing things into objects and the result is people preferring to move stuff out of process to keep the code simple and make the encapsulation more effective. I don't really think that's a good thing, but that's been my observation.
- a4isms 4y agoErlang/Elixir feels like it strikes a middle ground, where every process behaves like one of Kay's objects, including the emphasis on message-passing rather than methods that behave like procedure calls.
- deleted 4y ago[deleted]
- geoffjentry 4y ago> that suggests we got OOP wrong, very wrong. It does, but that's because there are different flavors of OOP. Alan Kay's original take on OO was closer to the actor model than what grew into the mainstream spin on OOP with inheritance and the rest. If you take 10 steps back and squint, microservices & the actor model start to look pretty similar.
- dimitrios1 4y agoSo more like Erlang/OTP rather than Spring Boot Microservices?
- deleted 4y ago[deleted]
- staticassertion 4y agoI'm extremely aware of Alan Kay's statement, as well as the foundations of the actor model. The reality is that today that is not what OOP has become, and Alan Kay would agree. > that suggests we got OOP wrong, very wrong. Alan Kay very clearly states that people "got it wrong" and that OOP was supposed to be about messaging. ie: He intended for it to be one thing, but it isn't that thing. > I'm sorry that I long ago coined the term "objects" for this topic because it gets many people to focus on the lesser idea. The big idea is "messaging" > The key in making great and growable systems is much more to design how its modules communicate rather than what their internal properties and behaviors should be. [..] http://wiki.c2.com/?AlanKayOnMessaging http://wiki.c2.com/?AlanKayOnMessaging https://computinged.wordpress.com/2010/09/11/moti-asks-objects-never-well-hardly-ever/ https://computinged.wordpress.com/2010/09/11/moti-asks-objec...
- geoffjentry 4y ago> and that OOP was supposed to be about messaging I agree that these are Kay's thoughts and also agree with his take on what it should be. But I think the reality is more complicated than it simply being something that evolved away from his grand dream. It's more that there was a soup of ideas floating around during that time that came together as OOP and the combination that became dominant was something else. For instance Simula was already using inheritance prior to Kay's message passing proposal.
- staticassertion 4y agoI can agree with all of that, I wasn't trying to imply otherwise, more just explaining that stating that OOP means what Kay wanted it to mean is ignoring history, consensus, and Kay himself.
- a4isms 4y agoI’m very aware that we evolved things Kay may not have intended, and that doesn’t make it wrong. He may have coined the term, but he doesn’t own it, nor should we feel beholden to his vision dating back to 1972. What I said was if the primary reason for micro services is hiding of state, then we got OO wrong, because OO, even the much maligned J2EE style of OO, can do that for us if we want hiding of state and message passing. Another possibility is that microservices do much more for us than hiding of state and limiting communication to message-passing. At my 9-5, we use Elixir to write our services and have a few Actor-based Scala services too, so my feeling is that we actually are doing OO fine, and that there’s something else that makes microservices compelling at scale.
- jimbokun 4y ago> If we need microservices to accomplish isolation of state, that suggests we got OOP wrong, very wrong. I don't think there's any question about that. The only language that really seems to get this right is Erlang (and Elixir). And I suppose Smalltalk, but I don't think even Smalltalk takes it as far as the Erlang VM.
- arunix 4y agoWhat did he mean by "extreme late-binding of all things"?
- lolinder 4y agoHere's one explanation: https://softwareengineering.stackexchange.com/questions/301919/object-oriented-late-binding https://softwareengineering.stackexchange.com/questions/3019...
- arunix 4y agoThat seems to be equating it with message passing, but messaging is already the first item mentioned by Alan (messaging, local retention ...) so I thought it might mean something else.