Skip to content

Commit 044c2d3

Browse files
authored
feat!: remove constructor from ConsumedThing interface (#517)
* feat!: remove constructor from ExposedThing interface * Adjust specification text * fixup! Adjust specification text
1 parent d0313fd commit 044c2d3

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

index.html

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,6 @@ <h2>The <dfn>WOT</dfn> namespace</dfn></h2>
584584
[=Resolve=] |promise| with |thing|.
585585
</li>
586586
</ol>
587-
<p class="ednote">
588-
Note the difference between constructing <a>ConsumedThing</a> and using
589-
the <code>consume()</code> method: the latter also initializes the protocol
590-
bindings, whereas a simple constructed object will not have <a>WoT Interactions</a>
591-
initialized until they are invoked.
592-
</p>
593587
</div>
594588
</section>
595589

@@ -1377,7 +1371,6 @@ <h2>The <dfn>ConsumedThing</dfn> interface</h2>
13771371
<pre class="idl">
13781372
[SecureContext, Exposed=(Window,Worker)]
13791373
interface ConsumedThing {
1380-
constructor(ThingDescription td);
13811374
Promise&lt;InteractionOutput&gt; readProperty(DOMString propertyName,
13821375
optional InteractionOptions options = {});
13831376
Promise&lt;PropertyReadMap&gt; readAllProperties(
@@ -1475,7 +1468,7 @@ <h4>Internal slots for {{ConsumedThing}}</h4>
14751468
</section>
14761469

14771470
<section>
1478-
<h4>Constructing <code>ConsumedThing</code></h4>
1471+
<h4>Creating <code>ConsumedThing</code></h4>
14791472
<p>
14801473
After <a href="#fetching-a-thing-description">fetching</a> a
14811474
<a>Thing Description</a> as a JSON object, one can create a
@@ -2653,21 +2646,21 @@ <h4>Internal slots for ExposedThing</h4>
26532646
</section>
26542647

26552648
<section>
2656-
<h3>Constructing {{ExposedThing}}</h3>
2649+
<h3>Creating {{ExposedThing}}</h3>
26572650
<p>
2658-
The {{ExposedThing}} interface extends {{ConsumedThing}}. It
2659-
is constructed from a full or partial {{ThingDescription}} object.
2651+
The {{ExposedThing}} interface
2652+
is created from a full or partial {{ThingDescription}} object.
26602653
</p>
26612654
<p class="note">
2662-
Note that an existing {{ThingDescription}} object can be optionally modified (for instance by adding or removing elements on its |properties|, |actions| and |events| internal properties) and the resulting object can used for constructing an
2655+
Note that an existing {{ThingDescription}} object can be optionally modified (for instance by adding or removing elements on its |properties|, |actions| and |events| internal properties) and the resulting object can used for creating an
26632656
{{ExposedThing}} object. This is the current way of adding and
26642657
removing <a>Property</a>, <a>Action</a> and <a>Event</a> definitions, as illustrated in the <a href="#exposedthing-examples">examples</a>.
26652658
</p>
26662659
<p class="note">
2667-
Before invoking <a href="#dom-exposedthing-expose">expose()</a>, the {{ExposedThing}} object does not serve any requests. This allows first constructing {{ExposedThing}} and then initialize its <a>Properties</a> and service handlers before starting serving requests.
2660+
Before invoking <a href="#dom-exposedthing-expose">expose()</a>, the {{ExposedThing}} object does not serve any requests. This allows first creating {{ExposedThing}} and then initialize its <a>Properties</a> and service handlers before starting serving requests.
26682661
</p>
26692662
<div>
2670-
To construct an {{ExposedThing}} with the {{ExposedThingInit}}
2663+
To create an {{ExposedThing}} with the {{ExposedThingInit}}
26712664
|init:ExposedThingInit|, run the following steps:
26722665
<ol>
26732666
<li>
@@ -4298,11 +4291,6 @@ <h2>API design rationale</h2>
42984291
<a data-cite="infra#parse-json-bytes-to-a-javascript-value">parsed JSON object</a> that has been validated according to the [[[WOT-TD]]] specification.
42994292
</p>
43004293
</section>
4301-
<section> <h4>Factory vs constructors</h4>
4302-
<p>
4303-
The factory methods for consuming and exposing <a>Thing</a>s are asynchronous and fully validate the input <a>TD</a>. In addition, one can also construct {{ConsumedThing}} and {{ExposedThing}} by providing a parsed and validated <a>TD</a>. Platform initialization is then done when needed during the WoT interactions.
4304-
</p>
4305-
</section>
43064294
<section> <h4>Observers</h4>
43074295
<p>
43084296
Earlier drafts used the

0 commit comments

Comments
 (0)