In this article, I would like to show one of the most convenient ways to manage the state of an object using a protocol-oriented approach and generics. This approach is widely used in marketplaces, the banking environment, the service sector, and so on, and assumes that for each state of…