Skip to content

Commit 6466707

Browse files
author
james
committed
docs: move abstract classes topic to handbook
(cherry picked from commit 23d1e06)
1 parent bcf0864 commit 6466707

File tree

3 files changed

+13
-112
lines changed

3 files changed

+13
-112
lines changed

docs/language/learn-ql/advanced/abstract-classes.rst

Lines changed: 0 additions & 110 deletions
This file was deleted.

docs/language/learn-ql/advanced/advanced-ql.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Advanced QL
1010

1111
Topics on advanced uses of QL. These topics assume that you are familiar with QL and the basics of query writing.
1212

13-
- :doc:`Semantics of abstract classes <abstract-classes>`
1413
- :doc:`Choosing appropriate ways to constrain types <constraining-types>`
1514
- :doc:`Determining the most specific types of a variable <determining-specific-types-variables>`
1615
- :doc:`Monotonic aggregates in QL <monotonic-aggregates>`

docs/language/ql-handbook/types.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ by declaring them in the ``from`` part.
208208
You can also annotate predicates and fields. See the list of :ref:`annotations <annotations-overview>`
209209
that are available.
210210

211-
Kinds of classes
211+
.. _concrete-classes:
212+
213+
Concrete classes
212214
================
213215

214216
The classes in the above examples are all **concrete** classes. They are defined by
@@ -218,6 +220,9 @@ values in the intersection of the base types that also satisfy the
218220

219221
.. _abstract-classes:
220222

223+
Abstract classes
224+
================
225+
221226
A class :ref:`annotated <abstract>` with ``abstract``, known as an **abstract** class, is also a restriction of
222227
the values in a larger type. However, an abstract class is defined as the union of its
223228
subclasses. In particular, for a value to be in an abstract class, it must satisfy the
@@ -247,6 +252,13 @@ The abstract class ``SqlExpr`` refers to all of those different expressions. If
247252
support for another database system later on, you can simply add a new subclass to ``SqlExpr``;
248253
there is no need to update the queries that rely on it.
249254

255+
.. pull-quote:: Important
256+
257+
258+
You must take care when you add a new subclass to an existing abstract class. Adding a subclass
259+
is not an isolated change, it also extends the abstract class since that is a union of its
260+
subclasses.
261+
250262
.. _overriding-member-predicates:
251263

252264
Overriding member predicates

0 commit comments

Comments
 (0)