The Stack Overflow podcast is back! Listen to an interview with our new CEO.
17

In my experience the only specific difference is that in most message passing systems, the sender of the message is aware of (and often declares) who the recipient of the message is. So instead of raising an event and anyone who is sucscribed to the event getting it, the sender defines some id of the intended recipient(s) or logical group of recipients and ...


15

In order to better understand Alan Kay's Messaging Metaphor, we have to look at a little bit of personal and historical context. Alan Kay's Bachelor degree is in Mathematics and Microbiology, and indeed, the idea of Messaging was influenced by the way biological cells interact with each other. At the same time Alan Kay worked on the foundations of OO, the ...


11

Much of the confusion between "message passing" and "event based" has to do with architectural vs. implementation details. I have seen (and written) event driven systems that actually use OS provided messages for their implementation. I am guessing you are really referring to architectural ideas. As many people have already pointed out "message passing" ...


5

Whether to provide 2 distinct methods : request_object (handle, obj) and modify_object (handle, obj, data) or use a generic method : msg_ioctl (handle, COMMANDE, var_args ...) Please use the former: two distinct methods. In software, the consuming client interface is critical.  While the IOCTL approach has (..arguably) some implementation advantages, ...


4

Both are variants of dynamic dispatch (aka overloading resolved at execution time). Overloading is for me (I'm not an original, that's Cardelli and Weger classification) a kind of polymorphism. I'm not sure I understand what could be meant here. If I'm guessing correctly, your citation is making a difference between "polymorphism" which would be overloading ...


4

message passing is a concept from object oriented programming No, message passing is not a concept from object oriented programming, and the Wikipedia article does not state this. Instead, the definition is message passing sends a message to a process (which may be an [...] object) and relies on the process and the supporting infrastructure to select and ...


4

Ideally, you don’t. This sort of approach is fraught with partial failure scenarios. What happens if B and C process, but D dies irrecocably? What happens when you get duplicate data from any of the workers? In general, you get a new service E which listens for results from BCD, writing the partial results to its own db. Potentially it could be a part of A -...


3

If you need to share (read and write) all the data and use transactions, when just use shared access to the database. If you need high availability, consider using master-slave replication. Don't just blindly go with master-master, think carefully about disadvantages: Most multi-master replication systems are only loosely consistent, i.e. lazy and ...


3

The key to Alan Kay's view is the reason why a message is sent. When an object of class A sends a message to an object of class B because A wants B to do something specific, that isn't OO (according to Kay's vision.) If A is sending the message to inform B that something has happened (rather than telling it to do something,) that is OO. A good example of ...


3

message passing is a concept from object oriented programming No, message passing is a concept in object-oriented programming, not from object-oriented programming. The term message passing has a general meaning outside of OOP, and in fact outside of programming in general. Alan Kay didn't invent the term message passing specifically for OOP, he simply ...


3

This problem has been faced may times when trying to build a reliable communication protocol on top of an unreliable one. That starts with TCP (as the underlying IP protocol is unreliable) and any protocol that uses UDP as transport mechanism. The basic idea is that each message/packet gets an identification number and the recipient sends an acknowledgment ...


3

In objective C, classes are objects, but what object owns the class objects? For an object to stay around it's not necessary to be owned by someone. They are just never released. The runtime of course has pointers to all classes, so in a way you could argue class objects are owned by the runtime. Where does the inheritance chain end? The inheritance ...


3

I get what you're asking but the implementation you're describing is remote authentication, not session state. Session state doesn't care whether the user is authenticated or not. You don't want sessions to require authentication generally. Regardless, back to the question: What you are interested in is Distributed Session State. Traditionally, this is ...


3

I have written a similar system about a month ago, and just like you I've discovered that this is best solved by a reliable queue technology with a redrive. While some might argue using SQL as your queue is not the most reliable way, it definitely works in many cases. The reason to use pub-sub systems is when you have multiple different things that need to ...


3

With an 'E' B, C, and D each publish their own completion event. E subscribes to those new events, collecting information from each and storing its state until it recognizes that it has received all the events, potentially in any order. Once it has received them all, it completes its own processing with all the information it needs, possibly publishing its ...


2

Quick answer to the question that you haven't asked yet: the entity ID tag is like the key to a database row in a table, you query the system(s) using that key and pluck out the info you need. Yes it is theoretically slower than storing pointers away. No, it is not as slow as you would think because systems can look up that key O(1). Another quick answer ...


2

Sounds like CQRS - Command Query Responsibility Segregation Here's Martin Fowler on the subject: http://martinfowler.com/bliki/CQRS.html


2

In Objective-C, by convention, you refer to properties with dot notation. Thus, you write myAppObject.theArray instead [myAppObject theArray]. In Objective-C the default getter is the name of the variable instead getVariable. For example, writing @property NSArray *theArray; creates an instance variable _theArray and generates the following accessor: -(...


2

The general solution to avoid repeating boilerplate is to pull it out into its own class. In this case, you would usually create a Publisher class that handles avoiding cycles for you. var tempoPublisher = new NumericPublisher(); tempoPublisher.onTempoChange(moveTempoSliderWidget); tempoPublisher.onTempoChange(changeSequencerTempo); tempoSliderWidget....


2

What probably happens right now is that some messages are processed by server A, and never delivered to B, and some are processed by B, but A never receives them. This is because you haven't specified the exchange: the default one is the direct exchange, meaning that messages are sent to one of the queues at a time, using round robin. In order for multiple ...


2

What AProgrammer said, with one crucial addition: message passing (a la Smalltalk, Objective-C, Ruby) permits the forwarding of a message (for transparent proxies) or even the runtime generation of a method implementing that message. I'm using Smalltalk terminology, where a message is the name of the function/method being invoked. Objective-C folk would ...


1

the blocking in Invoker the protocol is in Invoker, maybe I want to switch marshalling to something else the map as mean to get the correct response for a request the SIP abstract method looks strange No error handling No timeout Your channel by design is NON-BLOCKING. Your implementation with the while() loop makes it not. Employing callbacks ...


1

My experience with something like this comes from programming a controller for a quadcopter and we had a loop that polled all the sensors at something like 250Hz. We simply updated a massive struct of the state of the quad and passed that to the flight controller. I assume your Arduino code is doing the polling in its main loop then sending the data to the ...


1

I do not know what RPEP in detail is. This is a good starting point for this question. I imagine taking your library and programming my own communication mechanism, based on your protocol description. Here is what I understand: The situation is: two partners are in an established communication, and it is now about closing. In order to stick to your ...


1

Is this considered ugly and/or bad design? Yes. Should I [...] make more specific method calls - instead of passing constants that have to be interpreted with a bunch of ifs? Yes, that's exactly what you should do. Unless there is some reason not to. Given that you've already thought of this much cleaner option yourself, I suspect that there might be, ...


1

There are several choices here, in increasing order of preference (most preferable last): Bits (flags) in an integer. Can be confusing, but allows packing a lot of them into a single int. So DO_THIS = 1 DO_THAT = 2 DO_ANOTHER = 4 DO_ZING = 5 perform(DO_THIS | DO_THAT) if (command && DO_THIS{ doThis(); } ...etc Integer commands DO_THIS = 1 ...


Only top voted, non community-wiki answers of a minimum length are eligible