Skip to content

Commit

Permalink
spec 20 -> spec 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Oct 8, 2023
1 parent 4272278 commit 31ee2f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Chapters/CaseStudyOne/CaseStudyOne.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ A presenter can have subpresenters e.g., `ImdbFilmListPresenter` will contain ta
1. a presenter can have multiple layouts and
2. that layouts can be defined dynamically.

In Spec 20, layouts are by default dynamic and are expressed at the instance level. To allow backward compatibility, it is still possible to define a `defaultLayout` _class_ side method that returns a layout instead of using a `defaultLayout` instance side method but it is not the recommended way.
In Spec 2.0, layouts are by default dynamic and are expressed at the instance level. To allow backward compatibility, it is still possible to define a `defaultLayout` _class_ side method that returns a layout instead of using a `defaultLayout` instance side method but it is not the recommended way.

#### initializePresenters

Expand Down Expand Up @@ -454,7 +454,7 @@ Note that we need to define the method `setModel:` is needed only if you do not
Defining interactions between presenters is done in the `connectPresenters` method. We implement it to define that, when an element of the list is selected, we should display the information in the detail presenter.
It is worth taking some time to look at `whenSelectionChangedDo:` message.

The `whenSelectionChangedDo:` method expects a block with zero or one argument. Such an argument is not the selected item directly but a more complex object that represents the selection. Indeed a selection is different in a single item selection list and a multiple selection list. Therefore Spec 20 defines the notion of selection mode under the form of subclasses of `SpAbstractSelectionMode`.
The `whenSelectionChangedDo:` method expects a block with zero or one argument. Such an argument is not the selected item directly but a more complex object that represents the selection. Indeed a selection is different in a single item selection list and a multiple selection list. Therefore Spec 2,0 defines the notion of selection mode under the form of subclasses of `SpAbstractSelectionMode`.

```language=Smalltalk
ImdbFilmListPresenter >> connectPresenters
Expand Down Expand Up @@ -671,7 +671,7 @@ You can now see that the layout showing only one list has been applied dynamical

### Using transmissions

Spec 20 introduces a nice optional concept to propagate selection from one presenter to another, thinking on the "flow" of information more than the implementation details of this propagation, which can change from presenter to presenter.
Spec 2.0 introduces a nice optional concept to propagate selection from one presenter to another, thinking on the "flow" of information more than the implementation details of this propagation, which can change from presenter to presenter.

With transmissions, each presenter can define a set of output ports (ports to transmit information) and input ports (ports to receive information). Widget presenters already have defined the output/input ports you can use with them, but you can add your own ports to your presenters.

Expand Down
2 changes: 1 addition & 1 deletion Chapters/DynamicPresenter/DynamicPresenter.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Dynamic Presenters
@cha_dynamic_presenter

Contrary to Spec 1, in Spec 20 all the layouts are dynamic. It means that you can change on the fly the elements displayed. It is a radical improvement from Spec1 where most of the layouts were static and building dynamic widgets was cumbersome.
Contrary to Spec 1, in Spec 2.0 all the layouts are dynamic. It means that you can change on the fly the elements displayed. It is a radical improvement from Spec1 where most of the layouts were static and building dynamic widgets was cumbersome.

In this chapter, we will show that presenters can be dynamically composed using layouts. We will show a little interactive section. Then we will build a little code editor with dynamic aspects. Note that In this post, we are going to use simply Spec, to refer to Spec 20 when we do not need to stress a difference.

Expand Down

0 comments on commit 31ee2f7

Please sign in to comment.