Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any math approaches to state management of complex objects?

I usually use ASP.net web forms for GUI, maybe one of most "stateful" technologies. But it applies to any technology which has states. Sometimes forms are tricky and complex, with >30 elements and > 3 states of each element. Intuitive way of designing such a form usually works for 90%. Other 10% usually find testers or end-users:).

The problem as i see it that we should imagine a lot of scenarios on the same object, which is much harder than a consequence of independent operations.

From functional programming courses I know that best way is not to use state management and use pure functions and variable passing by value and all these stuff, which is greatly formalized. Sometimes, we cannot avoid it.

Do you use any math formalisms and approaches to state management of complex objects? Not like monads in Haskell, but which can be used in more traditional business applications and languages - Java, C#, C++.

It may be not Turing-complete formalism, but 99% will be great also:).

Sorry if it is just another tumbleweed question:)

like image 322
rudnev Avatar asked Nov 15 '22 12:11

rudnev


1 Answers

Use message-passing as an abstraction. Advantages:

  1. The difficulty with complex state is complex interactions, which are especially hairy in concurrent systems like typical GUIs. Message-passing, by eliminating shared state, stops the complexity of state in one process from being infectious.
  2. Message-passing concurrency has nice foundational models: e.g., the Actor model, CSP, both of which influenced Erlang.
  3. It integrates well with functional programming: check out Erlang again. Peter van Roy's book *Concepts, Techniques, and Models of Computer Programming is an excellent text that shows the fundamental ingredients of programming languages, such as pure functions, and message-passing, and how they can be combined. The text is avilable as a free PDF.
like image 186
Charles Stewart Avatar answered Dec 05 '22 12:12

Charles Stewart