-
Notifications
You must be signed in to change notification settings - Fork 12
Commanding methods #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commanding methods #804
Conversation
Also: rename `Commander` -> `AbstractCommander`
... to be inline with `SubscribingClass`.
Codecov Report
@@ Coverage Diff @@
## master #804 +/- ##
============================================
+ Coverage 93.19% 93.28% +0.08%
- Complexity 3431 3548 +117
============================================
Files 437 462 +25
Lines 11629 11956 +327
Branches 697 705 +8
============================================
+ Hits 10838 11153 +315
- Misses 589 599 +10
- Partials 202 204 +2 |
Also: fix split generation, introduce abstract base for event-caused command sequence.
@armiol, PTAL. @mdrachuk, @vlad-lubenskyi, @dmdashenkov, you are welcome to review and comment too. You recently updated parts of the system which this PR modifies. |
.idea/dictionaries/common.xml
Outdated
@@ -19,7 +18,7 @@ | |||
<w>flushables</w> | |||
<w>googleapis</w> | |||
<w>gradle</w> | |||
<w>grpc</w> | |||
<w>grpc</w> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a redundant change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-yevsyukov LGTM in general. Please see my comments.
* @author Alexander Yevsyukov | ||
*/ | ||
@Internal | ||
public class OneCommand extends OnEvent<MarkCausedCommand, MarkCausedCommand.Builder, OneCommand> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be SingleCommand
? I understand that's longer, but "one command" may mean a particular item from the list of items.
E.g. "I have one command that creates projects" means "I have plenty of commands, and one of them creates projects". But "I have a single command that creates project" means "There is exactly one command ...".
* @author Alexander Yevsyukov | ||
*/ | ||
@Immutable(containerOf = "M") | ||
public class EventReceivingClassDelegate<T, M extends HandlerMethod<?, EventClass, ?, ?>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document the generic parameters.
extends ModelClass<T> { | ||
|
||
private static final long serialVersionUID = 0L; | ||
private final MessageHandlerMap<EventClass, M> events; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have an empty line above.
This PR introduces
@Command
annotation for methods that issue one or more command messages in response to incoming command or event.ProcessManager
s andCommander
s can have such methods.New system events and commands were introduced to update command and event lifecycle aggregates with events on emitting a command in response to incoming command/event.
Other notable changes:
of()
methods ofMessageClass
descendants that accept message classes were renamed tofrom()
to allow using method references together withof()
which accepts message instances.CommandReceiver
,EventReceiver
,EventSubscriber
,CommandingClass
,SubscribingClass
,ReactingClass
, etc.SystemGateway
.