Skip to content
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

Improve: demo and README #15

Merged
merged 18 commits into from
Oct 8, 2016
Merged

Improve: demo and README #15

merged 18 commits into from
Oct 8, 2016

Conversation

vadymmarkov
Copy link
Contributor

@vadymmarkov vadymmarkov commented Oct 6, 2016

@zenangst @RamonGilabert @onmyway133
Now we have 2 demo projects (simple and more advanced) + 1 interactive playground. More about them in README, which is almost completed as well.

@vadymmarkov vadymmarkov changed the title Improve: demo Improve: demo and README Oct 7, 2016
Copy link
Contributor

@zenangst zenangst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I loved reading this README, I just found some nit-picking things that we might want to change before we merge this PR. Very pleasant read, keep it up @vadymmarkov 🚀

### Command execution

The first step is to declare a command. Your command type has to conform to
`Aftermath.Command` protocol and the `Output` type must be implicitly specified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

The first step is to declare a command. Your command type has to conform to
Aftermath.Command protocol and the Output type must be implicitly specified.

To:

The first step is to declare a command. Your command type has to conform to the
Aftermath.Command protocol and the Output type must be implicitly specified.

`Aftermath.Command` protocol and the `Output` type must be implicitly specified.

Let's say we want to fetch a list of books from some untrusted resource and
correct typos in titles and author names 🤓.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this part 😁

```

**Note** that any type can play a role of `Output`, so if we want to add a date
to our `BookUpdateCommand` it could look like the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

Note that any type can play a role of Output, so if we want to add a date
to our BookUpdateCommand it could look like the following:

To:

Note that any type can play the role of Output, so if we want to add a date
to our BookUpdateCommand it could look like the following:


### Command handling

Command is an intention that needs to be translated into action by handler.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

Command is an intention that needs to be translated into action by handler.

To:

Command is an intention that needs to be translated into an action by a handler.

Command handler is responsible for publishing events to notify about results of
the operation it performs. Command handler type has to conform to
`Aftermath.CommandHandler` protocol that needs to know about the command type
it will work with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command handler is responsible for publishing events to notify about results of
the operation it performs. Command handler type has to conform to
Aftermath.CommandHandler protocol that needs to know about the command type
it will work with:

The command handler is responsible for publishing events to notify about results of
the operation it performs. The command handlers type has to conform to
Aftermath.CommandHandler protocol, that needs to know about the command type
it will work with:

already an output itself, so the only thing you want to do is notify all
subscribers that something happened in the system, and they will react
accordingly. In this sense it's closer to a type-safe alternative to
`NSNotification`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

Fact works like notification with no async operations involved. It could
be used when there is no need to have a handler and generate an output. Fact is
already an output itself, so the only thing you want to do is notify all
subscribers that something happened in the system, and they will react
accordingly. In this sense it's closer to a type-safe alternative to
NSNotification.

To:

Fact works like notification, with no async operations involved. It can
be used when there is no need for a handler to generate an output. Fact is an
output itself, so the only thing you want to do is notify all
subscribers that something happened in the system, and they will react
accordingly. In this sense it's closer to a type-safe alternative to
NSNotification.

executed command in **Command Middleware**, or do appropriate operation in
**Event Middleware** before the published event is received by its reactions.
It's handy for logging, crash reporting, aborting particular commands or
events, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

Middleware is a layer where commands and events could be intercepted before
the moment they reach listeners. It means you can modify/cancel/extend the
executed command in Command Middleware, or do appropriate operation in
Event Middleware before the published event is received by its reactions.
It's handy for logging, crash reporting, aborting particular commands or
events, etc.

To:

Middleware is a layer where commands and events can be intercepted before
they reach their listeners. It means you can modify/cancel/extend the
executed command in Command Middleware, or do appropriate operation in
Event Middleware before the published event is received by its reactions.
It's handy for logging, crash reporting, aborting particular commands or
events, etc.


Naming is hard. I doesn't seem right to have names like `BookListCommand`,
`BookListCommandHandler` and `BookListWhatever` in the project. Here comes the
idea of stories that group related types and make the flow more concrete:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

Naming is hard. I doesn't seem right to have names like BookListCommand,
BookListCommandHandler and BookListWhatever in the project. Here comes the
idea of stories that group related types and make the flow more concrete:

To:

Naming is hard. It doesn't feel right to have names like BookListCommand,
BookListCommandHandler and BookListWhatever, does it? If you agree, then you can work
around this issue by introducing a new idea into the mix.
You can group all related types into stories, which makes the flow more concrete.

}
```

In this sense it's close to user stories used in agile software development
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

In this sense it's close to user stories used in agile software development
methodologies.

To:

In this sense, it's close to user stories used in agile software development
methodologies.

assembled piece by piece from different sources, is translated into the
"view state", which is readable by the view to render it on the screen. This
"view state" is kept in memory and valid at a given instant in time until we
switch the context and the current view is deallocated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From:

We believe that in iOS applications in most of the cases there is no real need
for single global state (single source of truth) or multiple sub-states
distributed between stores. Data is stored on disc in local persistence layer,
such as database and cache, or it's fetched from network. Then this content,
assembled piece by piece from different sources, is translated into the
"view state", which is readable by the view to render it on the screen. This
"view state" is kept in memory and valid at a given instant in time until we
switch the context and the current view is deallocated.

To:

We believe that in iOS applications, in most of the cases, there is no real need
for single global state (single source of truth) or multiple sub-states
distributed between stores. Data is stored on disc in local persistence layer,
such as database and cache, or it's fetched from network. Then this content,
assembled piece by piece from different sources, is translated into the
"view state", which is readable by the view to render it on the screen. This
"view state" is kept in memory and valid at a given instant in time until we
switch the context and the current view is deallocated.

@vadymmarkov
Copy link
Contributor Author

vadymmarkov commented Oct 7, 2016

Thanks @zenangst ! Fixed your comments in this commit 5db9101

@zenangst zenangst merged commit 64020f5 into master Oct 8, 2016
@zenangst zenangst deleted the improve/demo branch October 8, 2016 07:37
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.

2 participants