Tag : Actor Model (1)

Actor Model - Microsoft Orleans

ChatGPT is used in this post to correct the text and make it more fluent.

Object-oriented programming (OOP) is based on four fundamental concepts. These are: encapsulation, abstraction, inheritance, and polymorphism. Of these, encapsulation is the most important. It means that the internal data of an object can't be accessed from outside.

Imagine a product object with a stock property. To decrease the stock, we will need a DecreaseStock method. The stock cannot be manipulated from outside, and will be decreased using the DecreaseStock method, which has business rules. But what happens if multiple threads enter the DecreaseStock method at the same time? No one knows how much stock will be decreased.

The reason for this is the shared memory problem, which is the biggest disadvantage of OOP. Of course, there are many ways and approaches to overcome this. The classic method is the locking mechanism, but since it is a very costly operation, it is necessary to avoid it. The Actor model not only saves us from the locking cost, but also allows us to develop in a distributed environment as if it were not distributed. But how does it do this?

Read more
Made with ASP.NET Core