Skip to content

Conversation

alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Aug 4, 2018

This PR introduces @Command annotation for methods that issue one or more command messages in response to incoming command or event. ProcessManagers and Commanders 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:

  • Improved naming for methods obtaining message classes from a model class.
  • of() methods of MessageClass descendants that accept message classes were renamed to from() to allow using method references together with of() which accepts message instances.
  • Reduced “singletonism” in the code related to method factories.
  • Introduced grouping marker interfaces for classes of objects that receive messages: CommandReceiver, EventReceiver, EventSubscriber, CommandingClass, SubscribingClass, ReactingClass, etc.
  • Improved structure of the code checking of duplicated command handling.
  • Isolated work with tenant-aware SystemGateway.
  • Improved class and method names in the Blackbox testing library.

@codecov
Copy link

codecov bot commented Aug 4, 2018

Codecov Report

Merging #804 into master will increase coverage by 0.08%.
The diff coverage is 90.44%.

@@             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

@SpineEventEngine SpineEventEngine deleted a comment Aug 4, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 4, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
Also: fix split generation, introduce abstract base for event-caused
command sequence.
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 5, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@SpineEventEngine SpineEventEngine deleted a comment Aug 9, 2018
@alexander-yevsyukov
Copy link
Contributor Author

@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.

@@ -19,7 +18,7 @@
<w>flushables</w>
<w>googleapis</w>
<w>gradle</w>
<w>grpc</w>
<w>grpc</w>
Copy link
Contributor

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.

Copy link
Contributor

@armiol armiol left a 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> {
Copy link
Contributor

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, ?, ?>>
Copy link
Contributor

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;
Copy link
Contributor

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.

@alexander-yevsyukov alexander-yevsyukov merged commit 8eed897 into master Aug 10, 2018
@alexander-yevsyukov alexander-yevsyukov deleted the commander-on branch August 10, 2018 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants