From 32e70b4d4923a626eb965d848375fd5ba29127ba Mon Sep 17 00:00:00 2001 From: xhudik Date: Fri, 26 Feb 2021 21:35:05 +0100 Subject: [PATCH 1/3] a bit more context for `open` feature https://github.com/scala/docs.scala-lang/issues/1937 --- _overviews/scala3-book/domain-modeling-oop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_overviews/scala3-book/domain-modeling-oop.md b/_overviews/scala3-book/domain-modeling-oop.md index 1f4f3cac67..d4e7363a24 100644 --- a/_overviews/scala3-book/domain-modeling-oop.md +++ b/_overviews/scala3-book/domain-modeling-oop.md @@ -125,11 +125,11 @@ class SoftwareDeveloper(name: String, favoriteLang: String) ``` However, since _traits_ are designed as the primary means of decomposition, a class that is defined in one file _cannot_ be extended in another file. -In order to allow this, the base class needs to be [marked as `open`][open]: +In order to allow this, the base class needs to be marked as `open`: ```scala open class Person(name: String) ``` -Having to explicitly mark classes as open avoids many common pitfalls in OO design. +[`open`](open) is a new feature of Sala 3. Having to explicitly mark classes as open avoids many common pitfalls in OO design. In particular, it requires library designers to explicitly plan for extension and for instance document the classes that are marked as open with additional extension contracts. {% comment %} From 1347affac4b8eb5edbd178d4a2ea9c8063bfa622 Mon Sep 17 00:00:00 2001 From: xhudik Date: Mon, 15 Mar 2021 11:07:06 +0100 Subject: [PATCH 2/3] Update _overviews/scala3-book/domain-modeling-oop.md Co-authored-by: Jonathan --- _overviews/scala3-book/domain-modeling-oop.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_overviews/scala3-book/domain-modeling-oop.md b/_overviews/scala3-book/domain-modeling-oop.md index d4e7363a24..0510c42ca6 100644 --- a/_overviews/scala3-book/domain-modeling-oop.md +++ b/_overviews/scala3-book/domain-modeling-oop.md @@ -129,7 +129,7 @@ In order to allow this, the base class needs to be marked as `open`: ```scala open class Person(name: String) ``` -[`open`](open) is a new feature of Sala 3. Having to explicitly mark classes as open avoids many common pitfalls in OO design. +Marking classes with [`open`](open) is a new feature of Sala 3. Having to explicitly mark classes as open avoids many common pitfalls in OO design. In particular, it requires library designers to explicitly plan for extension and for instance document the classes that are marked as open with additional extension contracts. {% comment %} @@ -289,4 +289,3 @@ NOTE: One thing I occasionally do is flip things like this around, so I first sh - From 9f5a915c567d1074ba7bb2e959f2ae15128bdd77 Mon Sep 17 00:00:00 2001 From: xhudik Date: Wed, 17 Mar 2021 09:13:54 +0100 Subject: [PATCH 3/3] fixed link --- _overviews/scala3-book/domain-modeling-oop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_overviews/scala3-book/domain-modeling-oop.md b/_overviews/scala3-book/domain-modeling-oop.md index 0510c42ca6..f57742aa2b 100644 --- a/_overviews/scala3-book/domain-modeling-oop.md +++ b/_overviews/scala3-book/domain-modeling-oop.md @@ -129,7 +129,7 @@ In order to allow this, the base class needs to be marked as `open`: ```scala open class Person(name: String) ``` -Marking classes with [`open`](open) is a new feature of Sala 3. Having to explicitly mark classes as open avoids many common pitfalls in OO design. +Marking classes with [`open`][open] is a new feature of Sala 3. Having to explicitly mark classes as open avoids many common pitfalls in OO design. In particular, it requires library designers to explicitly plan for extension and for instance document the classes that are marked as open with additional extension contracts. {% comment %}