Is there a design template (for example, visitor, strategy, state, etc.) or some other design principle to help develop a good solution for modeling flow in states for an object, such as Task .
The task starts with the status New , then goes to the status of BeingHandled , then WaitingForApproval , and then it can be moved to Finish or NotApproved , which essentially refers to BeingHandled with additional information, saying that it has returned from WaitingForApproval .
So, in the general case, we have a common flow, and then there can be some internal flow inside it.
Thanks,
ashilon
This is not a template, but a concept: a finite state machine .
Thus, it is a finite state machine that can only have an active state at a time.
See what the Wikipedia article says in its first paragraph:
(FSM) ( : ), , , , . , . ; , , . , ; . FSM , .
, - .
/ /. , WaitingForApproval, , NotApproved ..
, ( ) , /, - .
, , State Base. , "" , . IllegalOperations . currentState state-handler.
, , , currentState- . factory .
, ... , ... , - .
, , - http://www.javabrahman.com/design-patterns/state-design-pattern-in-java/
"", "", "", "" " ", "" , , WaitingForApproval.
, (FSM) - , . - , , , .
, FSM ( ), , , , . , . PlantUML PlantText.com , .
- ( ), . , , New BeingHandled , , . , BeingHandled WaitingForApproval , , , - / . .
New
BeingHandled
WaitingForApproval
, , ( ). , ( , , ). FSM . FSM- Java Google.
Source: https://habr.com/ru/post/1615210/More articles:Is the next oneton implementation thread safe? - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1615206/need-help-getting-started-converting-raw-g3-fax-files-to-tiff-format-via-java&usg=ALkJrhiGV83YwlcXQOEik_BWW6u-4mv24wSingleton Pattern Performance Problem - c ++Delphi - built-in application scrollbars not visible - delphiпрерывания при создании библиотеки arduino - c++java.lang.NullPointerException: attempt to call a virtual method to reference a null object to select sqlite - nullpointerexceptionCheck if an item exists in the database using Slick 3 and Play - scalaWrite .TIFF with JAI - javaWhy is this supported combination of CGBitmapContextCreate parameters rejected as unsupported? - swiftSpring Does JPA data require Eclipse and Hibernate reference? - javaAll Articles