0

Given the following design from clean architecture in which layer would you put overall application state?

In each state a subset of use cases are allowed to be invoked. For example if application is in "Updating" state invoking AddNewParameterUseCase is not allowed.enter image description here

lennon310
  • 3,242
hamid
  • 9

1 Answers1

2

Well, if by "Application State" you mean:

Application State (also known as Program State) represents the totality of everything necessary to keep your application running. When we refer to application state we are normally referring to the state of the program as it exists in the contents of its memory.

What is State and Why Does it Matter? - thedaylightstudio.com

Then for the most part you'll find your Application State is not on your diagram. It's over here where the Entities live:

enter image description here

That being said, every layer holds some state. Even if it's mostly just configuration info.

However, some applications go out of their way to eliminate "Application State". They're called stateless.= They push all responsibility for knowing things onto the DB. That way the application doesn't change from request to request. Makes it easy to know if it's in a good state since it only has one.

candied_orange
  • 119,268