生命周期组件框架:生命周期描述语言——复合状态机示例 博客分类: 软件设计 JavaLifecycle状态机生命周期生命周期描述语言
程序员文章站
2024-03-20 23:54:16
...
@StateMachine static interface OrderLifecycle { @StateSet static interface States { @Initial @Function(transition = Transitions.Start.class, value = Started.class) static interface Created {} @CompositeState @Function(transition = Transitions.Cancel.class, value = Canceled.class) static interface Started { @StateSet static interface SubStates { @Initial @Function(transition = OrderLifecycle.States.Started.SubTransitions.DoProduce.class, value = Producing.class) static interface OrderCreated {} @Function(transition = OrderLifecycle.States.Started.SubTransitions.DoDeliver.class, value = Delivering.class) static interface Producing {} @Function(transition = OrderLifecycle.States.Started.SubTransitions.ConfirmComplete.class, value = Done.class) static interface Delivering {} @End @ShortCut(OrderLifecycle.States.Finished.class) static interface Done {} } @TransitionSet static interface SubTransitions { static interface DoProduce {} static interface DoDeliver {} static interface ConfirmComplete {} } } @End static interface Finished {} @End static interface Canceled {} } @TransitionSet static interface Transitions { static interface Start {} static interface Cancel {} } } public abstract static class ProductBase extends ReactiveObject {} @LifecycleMeta(OrderLifecycle.class) public static class ProductOrder extends ProductBase { public ProductOrder() { initialState(OrderLifecycle.States.Created.class.getSimpleName()); } @Transition public void start() {} @Transition public void cancel() {} @Transition public void doProduce() {} @Transition public void doDeliver() {} @Transition public void confirmComplete() {} }
下一篇: tensorflow构造线性回归模型
推荐阅读
-
生命周期组件框架:带有多状态机的单实现类 博客分类: 软件设计 JavaLifecycleStateMachine状态机生命周期
-
生命周期组件框架:生命周期描述语言——复合状态机示例 博客分类: 软件设计 JavaLifecycle状态机生命周期生命周期描述语言
-
生命周期组件框架:生命周期描述语言——复合状态机示例 博客分类: 软件设计 JavaLifecycle状态机生命周期生命周期描述语言
-
生命周期组件框架:生命周期描述语言——生命周期事件示例 博客分类: 软件设计 javaLifecycleState Machine状态机生命周期
-
生命周期组件框架:加强版 UML State Machine:关系型复合状态机服务 示例 博客分类: 软件设计 Java生命周期设计状态转换图框架
-
生命周期组件框架:带有多状态机的单实现类 博客分类: 软件设计 JavaLifecycleStateMachine状态机生命周期
-
生命周期组件框架:加强版 UML State Machine:关系型复合状态机服务 示例 博客分类: 软件设计 Java生命周期设计状态转换图框架