From 7ac31ee65e550b93d4f27ed4a478a12960ee214e Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:57:36 +0100 Subject: [PATCH 01/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 - 1 file changed, 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 0297d6ec..4d27063b 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,5 +1,4 @@ # Create and connect Components -s In this tutorial, we will create a first Component that produces an Event and provides a Service (a GPS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ The complete GPS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. From c82e899eface8d6673441029035086e436ae548e Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:35:30 +0100 Subject: [PATCH 02/70] Update Create and connect Components.md GPS -> GNSS --- .../Create and connect Components.md | 136 +++++++++--------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 4d27063b..533b44fb 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,7 @@ # Create and connect Components -In this tutorial, we will create a first Component that produces an Event and provides a Service (a GPS emitting geographical data). \ +In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ -The complete GPS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. +The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. # STATIC PART: declaration @@ -11,7 +11,7 @@ Code spaces beginning by `Trait` need to be put in the code space under *New cla First, we will create a Service Trait¹ with a Service inside it. ```smalltalk -Trait named: #MolGPSDataServices +Trait named: #MolGNSSDataServices uses: MolComponentServices instanceVariableNames: '' package: 'MoleculeTutorial' @@ -23,7 +23,7 @@ A Trait can be composed of multiple other traits.* Then, we create an Event interface with an Trait inside it. ```smalltalk -Trait named: #MolGPSDataEvents +Trait named: #MolGNSSDataEvents uses: MolComponentEvents instanceVariableNames: '' package: 'MoleculeTutorial' @@ -31,20 +31,20 @@ Trait named: #MolGPSDataEvents Next, we need to add the Service and Event interfaces as suppliers (of a Service and an Event respectively). ```smalltalk - MolGPSDataServices>>getAccuracyRadiusInMeters - "Gets and return the accuracy of the GPS depending on quality of signal and quantity of connected satellites" + MolGNSSDataServices>>getAccuracyRadiusInMeters + "Gets and return the accuracy of the GNSS depending on quality of signal and quantity of connected satellites" "method is left empty, will be defined in the Component that provides it" ``` ```smalltalk - MolGPSDataEvents>>currentPositionChanged: aGeoPosition - "Notify the current geographic position of the GPSreceiver when changed" + MolGNSSDataEvents>>currentPositionChanged: aGeoPosition + "Notify the current geographic position of the GNSSreceiver when changed" "method is left empty, will be defined in the Component that consumes it" ``` Note: Parameters are similar to Services, their Trait Type just need to be changed to `MolComponentParameters` ```smalltalk -Trait named: #MolGPSDataParameters +Trait named: #MolGNSSDataParameters uses: MolComponentParameters instanceVariableNames: '' package: 'MoleculeTutorial' @@ -61,7 +61,7 @@ Types don't have any methods on the Instance side of Pharo, their contract is to ## Define the first Component Type ```smalltalk -Trait named: #MolGPSData +Trait named: #MolGNSSData uses: MolComponentType instanceVariableNames: '' package: 'Molecule-Tutorial' @@ -69,7 +69,7 @@ Trait named: #MolGPSData ## Define the second Component Type ```smalltalk -Trait named: #MolGPSMap +Trait named: #MolGNSSMap uses: MolComponentType instanceVariableNames: '' package: 'Molecule-Tutorial' @@ -90,59 +90,59 @@ With Molecule, we reuse any existing Class by augmenting that Class with Compone We must use the Molecule Component interface `MolComponentImpl`, which is a Trait, in the existing Class. Any class that implements this interface is usable as a Molecule component. Then, we assign the type Component to the class as a standard Molecule Component. -## Define the contract for MolGPSData -For this tutorial, the GPS needs to send its geographical data to the Map. \ +## Define the contract for MolGNSSData +For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. \ Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browser** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ The needed methods for the contract already exist (since the Components' Type use `MolComponentType`), they just need to be overridden. \ A Component Type can provide multiple Services and Events (separated by a comma), there's just one each for this tutorial (each one being put between the curly brackets of the methods). -Since the `MolGPSData` Component Type needs to inform the Map when its position is changed, it produces the `MolGPSDataEvents>>currentPositionChanged: aGeoPosition` Event. +Since the `MolGNSSData` Component Type needs to inform the Map when its position is changed, it produces the `MolGNSSDataEvents>>currentPositionChanged: aGeoPosition` Event. ```smalltalk -MolGPSData>>producedComponentEvents +MolGNSSData>>producedComponentEvents - ^ { MolGPSDataEvents } + ^ { MolGNSSDataEvents } ``` -Since the `MolGPSData` Component Type needs to returns its accuracy when its position is changed, it provides the `MolGPSDataServices>>getAccuracyRadiusInMeters` Service. +Since the `MolGNSSData` Component Type needs to returns its accuracy when its position is changed, it provides the `MolGNSSDataServices>>getAccuracyRadiusInMeters` Service. ```smalltalk -MolGPSData>>providedComponentServices +MolGNSSData>>providedComponentServices - ^ { MolGPSDataServices } + ^ { MolGNSSDataServices } ``` -## Create the Component implementation for MolGPSData +## Create the Component implementation for MolGNSSData Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. -When this is all done, we can move on to create the GPS Component, being `MolGPSDataImpl`. This component uses the `MolGPSData` Trait, used to define the Component's contract, as well as the `MolGPSDataServices` interface, which needs to be specified in order for the Component to provide its Service. +When this is all done, we can move on to create the GNSS Component, being `MolGNSSDataImpl`. This component uses the `MolGNSSData` Trait, used to define the Component's contract, as well as the `MolGNSSDataServices` interface, which needs to be specified in order for the Component to provide its Service. ```smalltalk -MolAbstractComponentImpl subclass: #MolGPSDataImpl - uses: MolGPSData + MolGPSDataServices +MolAbstractComponentImpl subclass: #MolGNSSDataImpl + uses: MolGNSSData + MolGNSSDataServices instanceVariableNames: 'accuracy sendCurrentPositionThread' classVariableNames: '' package: 'Molecule-Tutorial' ``` -## Define what the GPS Component does -Next, we will need to specify what exactly the GPS sends. This is where the previously declared instance variable `accuracy` comes into play. +## Define what the GNSS Component does +Next, we will need to specify what exactly the GNSS sends. This is where the previously declared instance variable `accuracy` comes into play. First, create a getter and setter for it. ```smalltalk -MolGPSDataImpl>>accuracy +MolGNSSDataImpl>>accuracy ^ accuracy ``` ```smalltalk -MolGPSDataImpl>>accuracy: anObject +MolGNSSDataImpl>>accuracy: anObject accuracy := anObject ``` Next, create a method that changes the value of this instance variable. ```smalltalk -MolGPSDataImpl>>increaseAccuracy +MolGNSSDataImpl>>increaseAccuracy | nextAccuracy | self accuracy > 1 ifTrue: [ @@ -153,88 +153,88 @@ MolGPSDataImpl>>increaseAccuracy Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`) ```smalltalk -MolGPSDataImpl>>getAccuracyRadiusInMeters - "Get and return the accuracy of the GPS depending quality of signal and quantity of connected satellites" +MolGNSSDataImpl>>getAccuracyRadiusInMeters + "Get and return the accuracy of the GNSS depending quality of signal and quantity of connected satellites" ^ self accuracy ``` -`getRandomizedGPSPosition` is used to return a randomized couple of values. +`getRandomizedGNSSPosition` is used to return a randomized couple of values. ```smalltalk -MolGPSDataImpl>>getRandomizedGPSPosition +MolGNSSDataImpl>>getRandomizedGNSSPosition | random | random := Random new. ^ random next @ random next ``` -After that, the Component needs to call these methods and send them to the `MolGPSMapImpl` (component created in the next part). \ +After that, the Component needs to call these methods and send them to the `MolGNSSMapImpl` (component created in the next part). \ This is done by overriding `MolComponentImpl class>>componentActivate`, invoked when a Component is started, \ `MolComponentImpl class>>componentInitialize` when a Component is initialized (comes after starting) \ `MolComponentImpl class>>componentPassivate`, invoked when a Component is stopped. ```smalltalk -MolGPSDataImpl>>componentInitialize +MolGNSSDataImpl>>componentInitialize "Set starting accuracy" self accuracy: 1000 ``` ```smalltalk -MolGPSDataImpl>>componentActivate +MolGNSSDataImpl>>componentActivate "Start a thread to simulate sending of the geo position and accuracy precision each second" sendCurrentPositionThread := [ [ true ] whileTrue: [ (Delay forMilliseconds: 50) wait. - self getMolGPSDataEventsNotifier + self getMolGNSSDataEventsNotifier currentPositionChanged: - self getRandomizedGPSPosition. + self getRandomizedGNSSPosition. self increaseAccuracy ] ] forkAt: Processor userBackgroundPriority ``` -To quickly detail this method, we first need to examine the `getMolGPSDataEventsNotifier`. This method was generated by Pharo after `MolGPSDataEvents` was put in the `producedComponentEvents` part of the Component's contract. +To quickly detail this method, we first need to examine the `getMolGNSSDataEventsNotifier`. This method was generated by Pharo after `MolGNSSDataEvents` was put in the `producedComponentEvents` part of the Component's contract. To return to `componentActivate`, after every 50 milliseconds, a random geographical position is generated which is sent through the `currentPositionChanged: aGeoPosition` Event. ```smalltalk -MolGPSDataImpl>>componentPassivate +MolGNSSDataImpl>>componentPassivate sendCurrentPositionThread ifNotNil: [ :e | e terminate ]. sendCurrentPositionThread := nil ``` -## Create the Component implementation for MolGPSMap -Same way as `MolGPSDataImpl`, we can move on to create the Map Component, being `MolGPSMapImpl`. This component uses the `MolGPSMap` Trait, used to define the Component's contract, as well as the `MolGPSDataEvents` interface, which needs to be specified in order for the Component to consume its Service. +## Create the Component implementation for MolGNSSMap +Same way as `MolGNSSDataImpl`, we can move on to create the Map Component, being `MolGNSSMapImpl`. This component uses the `MolGNSSMap` Trait, used to define the Component's contract, as well as the `MolGNSSDataEvents` interface, which needs to be specified in order for the Component to consume its Service. ```smalltalk -MolAbstractComponentImpl subclass: #MolGPSMapImpl - uses: MolGPSMap + MolGPSDataEvents +MolAbstractComponentImpl subclass: #MolGNSSMapImpl + uses: MolGNSSMap + MolGNSSDataEvents instanceVariableNames: '' classVariableNames: '' - package: 'Molecule-Examples-GPS Example' + package: 'Molecule-Examples-GNSS Example' ``` -## Define the contract for MolGPSMap -Conversely, the Map needs to be informed and receive the data through the same Event and Service as `MolGPSData`. +## Define the contract for MolGNSSMap +Conversely, the Map needs to be informed and receive the data through the same Event and Service as `MolGNSSData`. Instead of producing and providing interfaces, it will instead consume and use them respectively. ```smalltalk -MolGPSMap>>consumedComponentEvents +MolGNSSMap>>consumedComponentEvents - ^ { MolGPSDataEvents } + ^ { MolGNSSDataEvents } ``` ```smalltalk -MolGPSMap>>usedComponentServices +MolGNSSMap>>usedComponentServices - ^ { MolGPSDataServices } + ^ { MolGNSSDataServices } ``` ## Define what the Map Component does -First off, this method is used to show in the Transcript (available from the **Browse** tab of Pharo) every position received from `MolGPSDataImpl`. +First off, this method is used to show in the Transcript (available from the **Browse** tab of Pharo) every position received from `MolGNSSDataImpl`. ```smalltalk -MolGPSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius - "Update geographic position of the received GPS position circle with a precision radius" +MolGNSSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius + "Update geographic position of the received GNSS position circle with a precision radius" | point text | point := aGeoPosition. @@ -243,32 +243,32 @@ MolGPSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius , (point y printShowingDecimalPlaces: 2). Transcript - show: '[Map] Receive new GPS position: ' , text , ' radius: ' + show: '[Map] Receive new GNSS position: ' , text , ' radius: ' , radius rounded printString , ' m'; cr ``` -Then, we will need to subscribe to `MolGPSDataEvents` through the `getMolGPSDataEventsSubscriber` (automatically generated by Pharo when `MolGPSDataEvents` was put in the `consumedComponentEvents` part of the Component's contract). Subscribing means that `MolGPSMapImpl` will be informed whenever an Event is produced from `MolGPSDataEvents`, and since `MolGPSDataImpl` is the only Component that can produce such Events, `MolGPSMapImpl` is informed by it. +Then, we will need to subscribe to `MolGNSSDataEvents` through the `getMolGNSSDataEventsSubscriber` (automatically generated by Pharo when `MolGNSSDataEvents` was put in the `consumedComponentEvents` part of the Component's contract). Subscribing means that `MolGNSSMapImpl` will be informed whenever an Event is produced from `MolGNSSDataEvents`, and since `MolGNSSDataImpl` is the only Component that can produce such Events, `MolGNSSMapImpl` is informed by it. ```smalltalk -MolGPSMapImpl>>componentActivate +MolGNSSMapImpl>>componentActivate - self getMolGPSDataEventsSubscriber subscribe: self + self getMolGNSSDataEventsSubscriber subscribe: self ``` -Stopping the component means that it will not listen anymore to the events produced by `MolGPSDataEvents`. +Stopping the component means that it will not listen anymore to the events produced by `MolGNSSDataEvents`. ```smalltalk -MolGPSMapImpl>>componentPassivate +MolGNSSMapImpl>>componentPassivate - self getMolGPSDataEventsSubscriber unsubscribe: self + self getMolGNSSDataEventsSubscriber unsubscribe: self ``` -Next, we need to override the `currentPositionChanged: aGeoPosition` inherited from the `MolGPSDataServices` (present in the `usedComponentServices` part of the Component's contract). In this case, the `accuracy` variable is used in order to display it in the Transcript by using `updatePositionCircleOnMap: aGeoPosition radius: radius`. +Next, we need to override the `currentPositionChanged: aGeoPosition` inherited from the `MolGNSSDataServices` (present in the `usedComponentServices` part of the Component's contract). In this case, the `accuracy` variable is used in order to display it in the Transcript by using `updatePositionCircleOnMap: aGeoPosition radius: radius`. ```smalltalk -MolGPSMapImpl>>currentPositionChanged: aGeoPosition +MolGNSSMapImpl>>currentPositionChanged: aGeoPosition "Display a circle on the map view at the current position" | radius | - radius := self getMolGPSDataServicesProvider + radius := self getMolGNSSDataServicesProvider getAccuracyRadiusInMeters. self updatePositionCircleOnMap: aGeoPosition radius: radius @@ -287,11 +287,11 @@ This is also why it's not possible to start two components of the same Type at a In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk -MolGPSDataImpl start. -MolGPSMapImpl start +MolGNSSDataImpl start. +MolGNSSMapImpl start ``` The Pharo **Transcript** (also located in the **Browse** tab of Pharo), will start showing messages in the form of \ -'[Map] Receive new GPS position: x@x radius: x m'; +'[Map] Receive new GNSS position: x@x radius: x m'; ### Starting a component with a name It's also possible to create a component with a name by using the following syntax: @@ -308,6 +308,6 @@ Components with a name are stopped using the same syntax as `start`, which is In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk -MolGPSDataImpl stop. -MolGPSMapImpl stop +MolGNSSDataImpl stop. +MolGNSSMapImpl stop ``` From f6758816db4986f630901338b5faad40fd40a028 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:40:24 +0100 Subject: [PATCH 03/70] Update Create and connect Components.md added geographical position example --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 533b44fb..2bed18eb 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -2,6 +2,7 @@ In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. +A graphical form of the example is available on the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. # STATIC PART: declaration From 03a63a10aea4b8b1332e90d47e61b392994b9018 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:50:48 +0100 Subject: [PATCH 04/70] Update Create and connect Components.md changed the beginning --- .../Create and connect Components.md | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 2bed18eb..cfd60229 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,7 @@ # Create and connect Components In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ -The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. +The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available on the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. # STATIC PART: declaration @@ -9,20 +9,25 @@ A graphical form of the example is available on the [Molecule-Geographical-Posit ## Define services and events Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. -First, we will create a Service Trait¹ -with a Service inside it. +First, we create a Service Trait¹ (a Trait that uses the `MolComponentServices` Trait) ```smalltalk Trait named: #MolGNSSDataServices uses: MolComponentServices instanceVariableNames: '' package: 'MoleculeTutorial' ``` +We then add a Service to this Trait which is `getAccuracyRadiusInMeters`, which means that the `MolGNSSDataServices` is a provider of the `getAccuracyRadiusInMeters` Service +```smalltalk + MolGNSSDataServices>>getAccuracyRadiusInMeters + "Gets and return the accuracy of the GNSS depending on quality of signal and quantity of connected satellites" + "method is left empty, will be defined in the Component that provides it" +``` ¹ Trait: *an independent set of methods with their implementation and requirements (methods and variables). \ Classes using a Trait automatically benefit from these methods, and must define that Trait’s requirements. \ A Trait can be composed of multiple other traits.* -Then, we create an Event interface with an Trait inside it. +Then, we create an Event Trait (a Trait that uses the `MolComponentEvents` Trait) ```smalltalk Trait named: #MolGNSSDataEvents uses: MolComponentEvents @@ -30,20 +35,14 @@ Trait named: #MolGNSSDataEvents package: 'MoleculeTutorial' ``` -Next, we need to add the Service and Event interfaces as suppliers (of a Service and an Event respectively). -```smalltalk - MolGNSSDataServices>>getAccuracyRadiusInMeters - "Gets and return the accuracy of the GNSS depending on quality of signal and quantity of connected satellites" - "method is left empty, will be defined in the Component that provides it" -``` - +This Event trait produces the `currentPositionChanged: aGeoPosition` Event ```smalltalk MolGNSSDataEvents>>currentPositionChanged: aGeoPosition "Notify the current geographic position of the GNSSreceiver when changed" "method is left empty, will be defined in the Component that consumes it" ``` -Note: Parameters are similar to Services, their Trait Type just need to be changed to `MolComponentParameters` +Note: Parameters are similar to Services, the only difference being that they use the `MolComponentParameters` Trait ```smalltalk Trait named: #MolGNSSDataParameters uses: MolComponentParameters From 66023b686194e7827871c035eb089ef82d76d176 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:51:18 +0100 Subject: [PATCH 05/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index cfd60229..01eda3ed 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -16,6 +16,10 @@ Trait named: #MolGNSSDataServices instanceVariableNames: '' package: 'MoleculeTutorial' ``` +¹ Trait: *an independent set of methods with their implementation and requirements (methods and variables). \ +Classes using a Trait automatically benefit from these methods, and must define that Trait’s requirements. \ +A Trait can be composed of multiple other traits.* + We then add a Service to this Trait which is `getAccuracyRadiusInMeters`, which means that the `MolGNSSDataServices` is a provider of the `getAccuracyRadiusInMeters` Service ```smalltalk MolGNSSDataServices>>getAccuracyRadiusInMeters @@ -23,10 +27,6 @@ We then add a Service to this Trait which is `getAccuracyRadiusInMeters`, which "method is left empty, will be defined in the Component that provides it" ``` -¹ Trait: *an independent set of methods with their implementation and requirements (methods and variables). \ -Classes using a Trait automatically benefit from these methods, and must define that Trait’s requirements. \ -A Trait can be composed of multiple other traits.* - Then, we create an Event Trait (a Trait that uses the `MolComponentEvents` Trait) ```smalltalk Trait named: #MolGNSSDataEvents From 5055ea23b9e600e37e884a67238c0fe095c32329 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:51:33 +0100 Subject: [PATCH 06/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 01eda3ed..a7a7a8d7 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -2,7 +2,7 @@ In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ -A graphical form of the example is available on the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. +A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. # STATIC PART: declaration From 84a684e471bab18aab8bd55c0316d67c6e3bfe69 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:58:30 +0100 Subject: [PATCH 07/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index a7a7a8d7..890eb08e 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,6 +1,7 @@ # Create and connect Components In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ +![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 1d089e58b4473fabc449de232fcb2ba1e53f1a97 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:59:02 +0100 Subject: [PATCH 08/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 890eb08e..7a868ad7 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,7 @@ # Create and connect Components In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ -![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) +![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 2d3bc36bedf781bcff3374d2a7173b60944c5229 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:02:35 +0100 Subject: [PATCH 09/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 7a868ad7..327d8575 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -91,6 +91,8 @@ With Molecule, we reuse any existing Class by augmenting that Class with Compone We must use the Molecule Component interface `MolComponentImpl`, which is a Trait, in the existing Class. Any class that implements this interface is usable as a Molecule component. Then, we assign the type Component to the class as a standard Molecule Component. +![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/80934057-8607-48b3-be24-9562b79e719f) \ + ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. \ From 9d2b02702ba6856266ad9838eb2ea090b562f40e Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:04:04 +0100 Subject: [PATCH 10/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 327d8575..5350a56b 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -91,7 +91,7 @@ With Molecule, we reuse any existing Class by augmenting that Class with Compone We must use the Molecule Component interface `MolComponentImpl`, which is a Trait, in the existing Class. Any class that implements this interface is usable as a Molecule component. Then, we assign the type Component to the class as a standard Molecule Component. -![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/80934057-8607-48b3-be24-9562b79e719f) \ +![classes et composants Molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/82fe912e-8db9-479f-ae0f-1d1d050318eb) \ ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ From fa913c39149632eec070e5ccb04bb3828a8c3465 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:09:13 +0100 Subject: [PATCH 11/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 5350a56b..fcc67b7f 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -91,11 +91,14 @@ With Molecule, we reuse any existing Class by augmenting that Class with Compone We must use the Molecule Component interface `MolComponentImpl`, which is a Trait, in the existing Class. Any class that implements this interface is usable as a Molecule component. Then, we assign the type Component to the class as a standard Molecule Component. -![classes et composants Molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/82fe912e-8db9-479f-ae0f-1d1d050318eb) \ +![classes et composants Molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/82fe912e-8db9-479f-ae0f-1d1d050318eb) ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. \ + +![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) \ + Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browser** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ The needed methods for the contract already exist (since the Components' Type use `MolComponentType`), they just need to be overridden. \ A Component Type can provide multiple Services and Events (separated by a comma), there's just one each for this tutorial (each one being put between the curly brackets of the methods). From fd0fcb7f7946f290df495429673c82a7e31e8902 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:09:37 +0100 Subject: [PATCH 12/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index fcc67b7f..d4b143cb 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -95,9 +95,9 @@ We must use the Molecule Component interface `MolComponentImpl`, which is a Trai ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ -In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. \ +In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. -![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) \ +![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browser** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ The needed methods for the contract already exist (since the Components' Type use `MolComponentType`), they just need to be overridden. \ From 46edb5d5e260dc376703be0465858d43814cf7be Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Tue, 21 Nov 2023 09:03:22 +0100 Subject: [PATCH 13/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index d4b143cb..45fb173b 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -305,8 +305,7 @@ It's also possible to create a component with a name by using the following synt This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. ## Stopping a component -Components are stopped using the `MolComponentImpl class>> stop` instruction, the syntax being similar to the `start` instruction since -Components are stopped by `[componentName] stop`. +Components are stopped using the `MolComponentImpl class>> stop` instruction, the syntax being similar to the `start` instruction since Components are stopped by `[componentName] stop`. \ Components with a name are stopped using the same syntax as `start`, which is `[componentName] stop: #[name]`. From c7c08a570b09cdc33a9ed1851cb3ec6d75c4e794 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:29:54 +0100 Subject: [PATCH 14/70] Update Tests.md --- documentation/Tests.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/documentation/Tests.md b/documentation/Tests.md index 31d57b32..e897c137 100644 --- a/documentation/Tests.md +++ b/documentation/Tests.md @@ -1,4 +1,5 @@ -To create quick tests for your components, you can create a package named [yourPackageName]-Examples or [yourPackageName]-Tests, then create an Object subclass named [yourPackageName]Examples, +# Tests +To create quick tests for your Components, you can create a package named [yourPackageName]-Examples or [yourPackageName]-Tests, then create an Object subclass named [yourPackageName]Examples, ```smalltalk Object subclass: #MolGPS-Examples instanceVariableNames: '' @@ -34,11 +35,14 @@ MolGPS-Examples>>stop MolComponentManager cleanUp ``` -You also need to verify the order of components starting since a component that listens to another needs to be started before the latter one. Otherwise, events will be sent wthout any component listening to it, rendering it meaningless. +## Order of Components +You also need to verify the order of Components starting since a Component that listens to another needs to be started before the latter one. Otherwise, events will be sent wthout any component listening to it, rendering it meaningless. In this example, that means that `MolGPSMapImpl` needs to be started **after** `MolGPSDataImpl`. -This test space can be useful for switching components on the fly, stopping a component to start another having a different Type (make sure that they have a different name or that the current launched component is stopped before the other of the same Type is launched). +## Switching Components on the fly +This test space can be useful for switching Components on the fly, stopping a component to start another having a different Type (make sure that they have a different name or that the current launched Component is stopped before the other of the same Type is launched). See the Molecule-Examples package for more examples on this. +## Calling another script To call another script, you simply have to call it like a regular function with `self [script]` since the `self` here represents the current class (for methods located in the class side). The stop script could be for example launched in the `start` script after a certain period of time passed through `self stop`. From d06eaa59471a41bf2a9c300d0a47c119b21cca5f Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:38:21 +0100 Subject: [PATCH 15/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 45fb173b..d846f24a 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -316,3 +316,6 @@ In a **Playground** (located in the **Browse** tab of Pharo): MolGNSSDataImpl stop. MolGNSSMapImpl stop ``` + +To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means no Component is currently active. +You can also use the **Inspect Component Manager** option of Molecule, available from the Library tab of Pharo. If the window shown doesn't have a deployedComponents field or is set to *nil*, it also means that no Component is currently active. From 1e1dee8b3406d2fc55a68b7fd849ebea7b623652 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:44:06 +0100 Subject: [PATCH 16/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index d846f24a..f45ead80 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -53,14 +53,14 @@ Trait named: #MolGNSSDataParameters ## Define Component types -## Adding Component contract with a Component Type +### Adding Component contract with a Component Type Whatever the method to create a Component (from scratch or with an existing Class) is, its contract first needs to be defined (for the two methods, the construction and assignment of the contract is the same). The Component Type implements the Component contract (used/provided Services, consumed/produced Events, used/provided Parameters). \ The Type is implemented through a Trait. \ Types don't have any methods on the Instance side of Pharo, their contract is to be defined by overriding some methods on the **Class side** of Pharo. -## Define the first Component Type +#### Define the first Component Type ```smalltalk Trait named: #MolGNSSData uses: MolComponentType @@ -68,7 +68,7 @@ Trait named: #MolGNSSData package: 'Molecule-Tutorial' ``` -## Define the second Component Type +#### Define the second Component Type ```smalltalk Trait named: #MolGNSSMap uses: MolComponentType @@ -81,10 +81,10 @@ There are two ways to create a new Molecule Component : - Create a new Component from scratch : write a new Class inheriting from the Component hierarchy - Re-using an existing Class : augmenting that class with Component behavior -## Create a new Component from scratch +### Create a new Component from scratch To develop a new Component from scratch, a class needs to be created that must subclass the `MolAbstractComponentImpl` abstract Class. -## Re-using an existing Class into a Component +### Re-using an existing Class into a Component Imagine that we want to reuse an open-source library that implements the behavior for our use case. We want to reuse a class from this existing implementation in our application to add the capability to use this behavior. This class is not a Molecule Component, and does not share the same Class hierarchy as Molecule Components. Therefore this class does not answer the Molecule Component’s interface, and cannot be reused directly as a Component. To manually plug this Class into a molecule component, we have to write glue code for the component to use the API of this Class. This requires an additional effort to write non-functional code, which introduces noise in the application code. This makes such architecture less understandable and maintainable. With Molecule, we reuse any existing Class by augmenting that Class with Component behavior. This Class becomes seamlessly usable as a Component in a Molecule architecture. From 667cfca9720d3f7697bef6758ce9967807d1db3a Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:45:03 +0100 Subject: [PATCH 17/70] Update Create and connect Components.md --- .../Create and connect Components.md | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index f45ead80..84614d40 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,31 @@ # Create and connect Components -In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ -Then we will create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ +- In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ +- We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ + +# Contents +# STATIC PART: declaration + ## Define services and events + ## Define Component types + ### Adding Component contract with a Component Type + #### Define the first Component Type + #### Define the second Component Type + ## Create a Component implementation of a Type + ### Create a new Component from scratch + ### Re-using an existing Class into a Component + ## Define the contract for MolGNSSData + ## Create the Component implementation for MolGNSSData + ## Define what the GNSS Component does + ## Create the Component implementation for MolGNSSMap + ## Define the contract for MolGNSSMap + ## Define what the Map Component does +# DYNAMIC PART: Execution + ## Starting a Component + ### Start the two components + ### Starting a component with a name + ## Stopping a component + ## Stop the two components + The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 1c0f6b1c4ca62326609331bd312e3ee3b0f2cd02 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:45:12 +0100 Subject: [PATCH 18/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 84614d40..280c2fec 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,5 +1,5 @@ # Create and connect Components -- In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). \ +- In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ From 4913e1a33066e8ef245d5ba4103f694aa2e3bc3f Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:45:20 +0100 Subject: [PATCH 19/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 280c2fec..6489a9f8 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,7 @@ # Create and connect Components - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ -![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ +![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) # Contents # STATIC PART: declaration From 4f91cf0aa7795fa9a793886559cf1bfcb89d2aa8 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:48:37 +0100 Subject: [PATCH 20/70] Update Create and connect Components.md --- .../Create and connect Components.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 6489a9f8..e7312272 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -4,27 +4,27 @@ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) # Contents -# STATIC PART: declaration - ## Define services and events - ## Define Component types - ### Adding Component contract with a Component Type - #### Define the first Component Type - #### Define the second Component Type - ## Create a Component implementation of a Type - ### Create a new Component from scratch - ### Re-using an existing Class into a Component - ## Define the contract for MolGNSSData - ## Create the Component implementation for MolGNSSData - ## Define what the GNSS Component does - ## Create the Component implementation for MolGNSSMap - ## Define the contract for MolGNSSMap - ## Define what the Map Component does -# DYNAMIC PART: Execution - ## Starting a Component - ### Start the two components - ### Starting a component with a name - ## Stopping a component - ## Stop the two components + # STATIC PART: declaration + ## Define services and events + ## Define Component types + ### Adding Component contract with a Component Type + #### Define the first Component Type + #### Define the second Component Type + ## Create a Component implementation of a Type + ### Create a new Component from scratch + ### Re-using an existing Class into a Component + ## Define the contract for MolGNSSData + ## Create the Component implementation for MolGNSSData + ## Define what the GNSS Component does + ## Create the Component implementation for MolGNSSMap + ## Define the contract for MolGNSSMap + ## Define what the Map Component does + # DYNAMIC PART: Execution + ## Starting a Component + ### Start the two components + ### Starting a component with a name + ## Stopping a component + ## Stop the two components The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 39fc742d0a4c1f569ec5ac72e603f5b2aaed9bca Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:52:51 +0100 Subject: [PATCH 21/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index e7312272..73ce234b 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -2,6 +2,7 @@ - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) +GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). # Contents # STATIC PART: declaration From 01a519c5031108627e4ccb8e0f95b114039172a7 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:52:59 +0100 Subject: [PATCH 22/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 73ce234b..a89b7937 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,7 @@ # Create and connect Components - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ -![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) +![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). # Contents From 8d87a7fb1998a3417c84a3449454e28d1978c3be Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:53:15 +0100 Subject: [PATCH 23/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index a89b7937..b7cb6554 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,6 +1,6 @@ # Create and connect Components -- In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data). -- We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data). \ +- In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data) +- We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data) \ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). From 334eaecd348e5b0774cf095f8957ab13500ac692 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:56:44 +0100 Subject: [PATCH 24/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index b7cb6554..2747e072 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -198,7 +198,7 @@ MolGNSSDataImpl>>getRandomizedGNSSPosition ^ random next @ random next ``` -After that, the Component needs to call these methods and send them to the `MolGNSSMapImpl` (component created in the next part). \ +After that, the `MolGNSSDataImpl` Component needs to use this Service. \ This is done by overriding `MolComponentImpl class>>componentActivate`, invoked when a Component is started, \ `MolComponentImpl class>>componentInitialize` when a Component is initialized (comes after starting) \ From c3805444ad5853435f1952183b180ca955d1718c Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 08:59:12 +0100 Subject: [PATCH 25/70] Update Create and connect Components.md syntax -> method --- documentation/Create and connect Components.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 2747e072..da630443 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -308,7 +308,7 @@ MolGNSSMapImpl>>currentPositionChanged: aGeoPosition # DYNAMIC PART: Execution ## Starting a Component -Components are started using the `MolComponentImpl class>>start` instruction, with the complete syntax being `[componentName] start`. +Components are started using the `MolComponentImpl class>>start` instruction. Components are created with the `default` name when the `start` instruction is used. This is also why it's not possible to start two components of the same Type at any moment, since they both use the same name (`default`) and same Type Trait (leading to a `ComponentAlreadyExistsError`). @@ -325,13 +325,13 @@ The Pharo **Transcript** (also located in the **Browse** tab of Pharo), will sta '[Map] Receive new GNSS position: x@x radius: x m'; ### Starting a component with a name -It's also possible to create a component with a name by using the following syntax: +It's also possible to create a component with a name by using the following method: `[componentName] start: #[name]`. This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. ## Stopping a component -Components are stopped using the `MolComponentImpl class>> stop` instruction, the syntax being similar to the `start` instruction since Components are stopped by `[componentName] stop`. \ -Components with a name are stopped using the same syntax as `start`, which is +Components are stopped using the `MolComponentImpl class>> stop` instruction, the method being similar to the `start` instruction since Components are stopped by `[componentName] stop`. \ +Components with a name are stopped a similar method as `start`, which is `[componentName] stop: #[name]`. ## Stop the two components From dc093da1689834679d8e696b2c06dc26976f7ac5 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:04:08 +0100 Subject: [PATCH 26/70] Update Create and connect Components.md added Component names --- .../Create and connect Components.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index da630443..79157cf7 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -5,27 +5,27 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). # Contents - # STATIC PART: declaration - ## Define services and events - ## Define Component types - ### Adding Component contract with a Component Type - #### Define the first Component Type - #### Define the second Component Type - ## Create a Component implementation of a Type - ### Create a new Component from scratch - ### Re-using an existing Class into a Component - ## Define the contract for MolGNSSData - ## Create the Component implementation for MolGNSSData - ## Define what the GNSS Component does - ## Create the Component implementation for MolGNSSMap - ## Define the contract for MolGNSSMap - ## Define what the Map Component does - # DYNAMIC PART: Execution - ## Starting a Component - ### Start the two components - ### Starting a component with a name - ## Stopping a component - ## Stop the two components + STATIC PART: declaration + Define services and events + Define Component types + Adding Component contract with a Component Type + Define the first Component Type MolGNSSData + Define the second Component Type MolGNSSDataParameters + Create a Component implementation of a Type + Create a new Component from scratch + Re-using an existing Class into a Component + Define the contract for MolGNSSData + Create the Component implementation for MolGNSSData + Define what the MolGNSSDataImpl Component does + Create the Component implementation for MolGNSSMap + Define the contract for MolGNSSMap + Define what the MolGNSSMapImpl Component does + DYNAMIC PART: Execution + Starting a Component + Start the two components MolGNSSDataImpl and MolGNSSMapImpl + Starting a component with a name + Stopping a component + Stop the two components MolGNSSDataImpl and MolGNSSMapImpl The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. @@ -85,7 +85,7 @@ The Component Type implements the Component contract (used/provided Services, co The Type is implemented through a Trait. \ Types don't have any methods on the Instance side of Pharo, their contract is to be defined by overriding some methods on the **Class side** of Pharo. -#### Define the first Component Type +#### Define the first Component Type MolGNSSData ```smalltalk Trait named: #MolGNSSData uses: MolComponentType @@ -93,7 +93,7 @@ Trait named: #MolGNSSData package: 'Molecule-Tutorial' ``` -#### Define the second Component Type +#### Define the second Component Type MolGNSSMap ```smalltalk Trait named: #MolGNSSMap uses: MolComponentType @@ -156,7 +156,7 @@ MolAbstractComponentImpl subclass: #MolGNSSDataImpl package: 'Molecule-Tutorial' ``` -## Define what the GNSS Component does +## Define what the MolGNSSDataImpl Component does Next, we will need to specify what exactly the GNSS sends. This is where the previously declared instance variable `accuracy` comes into play. First, create a getter and setter for it. ```smalltalk @@ -261,7 +261,7 @@ MolGNSSMap>>usedComponentServices ^ { MolGNSSDataServices } ``` -## Define what the Map Component does +## Define what the MolGNSSMapImpl Component does First off, this method is used to show in the Transcript (available from the **Browse** tab of Pharo) every position received from `MolGNSSDataImpl`. ```smalltalk MolGNSSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius @@ -314,7 +314,7 @@ This is also why it's not possible to start two components of the same Type at a **add img** -### Start the two components +### Start the two components MolGNSSDataImpl and MolGNSSMapImpl In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk @@ -334,7 +334,7 @@ Components are stopped using the `MolComponentImpl class>> stop` instruction, th Components with a name are stopped a similar method as `start`, which is `[componentName] stop: #[name]`. -## Stop the two components +## Stop the two components MolGNSSDataImpl and MolGNSSMapImpl In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk From 4afbc3a94fb8a6b5f4046ceacbcd8af16d0dc347 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:11:18 +0100 Subject: [PATCH 27/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 79157cf7..6e116932 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -10,7 +10,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga Define Component types Adding Component contract with a Component Type Define the first Component Type MolGNSSData - Define the second Component Type MolGNSSDataParameters + Define the second Component Type MolGNSSMap Create a Component implementation of a Type Create a new Component from scratch Re-using an existing Class into a Component @@ -68,14 +68,6 @@ This Event trait produces the `currentPositionChanged: aGeoPosition` Event "method is left empty, will be defined in the Component that consumes it" ``` -Note: Parameters are similar to Services, the only difference being that they use the `MolComponentParameters` Trait -```smalltalk -Trait named: #MolGNSSDataParameters - uses: MolComponentParameters - instanceVariableNames: '' - package: 'MoleculeTutorial' -``` - ## Define Component types ### Adding Component contract with a Component Type @@ -200,9 +192,9 @@ MolGNSSDataImpl>>getRandomizedGNSSPosition After that, the `MolGNSSDataImpl` Component needs to use this Service. \ This is done by overriding -`MolComponentImpl class>>componentActivate`, invoked when a Component is started, \ -`MolComponentImpl class>>componentInitialize` when a Component is initialized (comes after starting) \ -`MolComponentImpl class>>componentPassivate`, invoked when a Component is stopped. +- `MolComponentImpl class>>componentActivate`, invoked when a Component is started +- `MolComponentImpl class>>componentInitialize` when a Component is initialized (comes after starting) +- `MolComponentImpl class>>componentPassivate`, invoked when a Component is stopped ```smalltalk MolGNSSDataImpl>>componentInitialize From 96a97376fece96f892630e57012f0043479f7f54 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:12:10 +0100 Subject: [PATCH 28/70] Update Parameters.md --- documentation/Parameters.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/documentation/Parameters.md b/documentation/Parameters.md index 7e2ed2b4..0e6e5d52 100644 --- a/documentation/Parameters.md +++ b/documentation/Parameters.md @@ -2,7 +2,12 @@ Parameters are made of data only used at the initialization of a component. \ Parameters are not commonly used, instead opting for Services. \ Parameters are created in the `componentInitialize` method, which is executed during the **Initialize** state of a component's life-cycle. - -**to complete** +Parameters use the `MolComponentParameters` Trait +```smalltalk +Trait named: #MolGNSSDataParameters + uses: MolComponentParameters + instanceVariableNames: '' + package: 'MoleculeTutorial' +``` **add img** From 7d6e2a870e6d4e582257fcc2f2ec60154b93112b Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:12:24 +0100 Subject: [PATCH 29/70] Update Parameters.md --- documentation/Parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Parameters.md b/documentation/Parameters.md index 0e6e5d52..bf8f56ff 100644 --- a/documentation/Parameters.md +++ b/documentation/Parameters.md @@ -1,7 +1,7 @@ # Parameters Parameters are made of data only used at the initialization of a component. \ Parameters are not commonly used, instead opting for Services. \ -Parameters are created in the `componentInitialize` method, which is executed during the **Initialize** state of a component's life-cycle. +Parameters are created in the `componentInitialize` method, which is executed during the **Initialize** state of a component's life-cycle. \ Parameters use the `MolComponentParameters` Trait ```smalltalk Trait named: #MolGNSSDataParameters From 1e7c2e73d48602791f26c585edf379b51a9eeeaf Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:17:33 +0100 Subject: [PATCH 30/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 6e116932..154a68ba 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -9,7 +9,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga Define services and events Define Component types Adding Component contract with a Component Type - Define the first Component Type MolGNSSData + Define first Component Type MolGNSSData Define the second Component Type MolGNSSMap Create a Component implementation of a Type Create a new Component from scratch @@ -139,7 +139,7 @@ MolGNSSData>>providedComponentServices ## Create the Component implementation for MolGNSSData Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. -When this is all done, we can move on to create the GNSS Component, being `MolGNSSDataImpl`. This component uses the `MolGNSSData` Trait, used to define the Component's contract, as well as the `MolGNSSDataServices` interface, which needs to be specified in order for the Component to provide its Service. +When this is all done, we can move on to create the GNSS Component, being `MolGNSSDataImpl`. This component uses the `MolGNSSData` Trait, used to define the Component's contract, as well as the `MolGNSSDataServices` interface which needs to be specified in order for the Component to provide its Service. ```smalltalk MolAbstractComponentImpl subclass: #MolGNSSDataImpl uses: MolGNSSData + MolGNSSDataServices @@ -216,7 +216,7 @@ MolGNSSDataImpl>>componentActivate self increaseAccuracy ] ] forkAt: Processor userBackgroundPriority ``` -To quickly detail this method, we first need to examine the `getMolGNSSDataEventsNotifier`. This method was generated by Pharo after `MolGNSSDataEvents` was put in the `producedComponentEvents` part of the Component's contract. +To quickly detail this method, we first need to examine `getMolGNSSDataEventsNotifier`. This method was generated by Pharo after `MolGNSSDataEvents` was put in the `producedComponentEvents` part of the Component's contract. To return to `componentActivate`, after every 50 milliseconds, a random geographical position is generated which is sent through the `currentPositionChanged: aGeoPosition` Event. ```smalltalk @@ -271,7 +271,7 @@ MolGNSSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius cr ``` -Then, we will need to subscribe to `MolGNSSDataEvents` through the `getMolGNSSDataEventsSubscriber` (automatically generated by Pharo when `MolGNSSDataEvents` was put in the `consumedComponentEvents` part of the Component's contract). Subscribing means that `MolGNSSMapImpl` will be informed whenever an Event is produced from `MolGNSSDataEvents`, and since `MolGNSSDataImpl` is the only Component that can produce such Events, `MolGNSSMapImpl` is informed by it. +Then, we will need to subscribe to `MolGNSSDataEvents` through `getMolGNSSDataEventsSubscriber` (automatically generated by Pharo when `MolGNSSDataEvents` was put in the `consumedComponentEvents` part of the Component's contract). Subscribing means that `MolGNSSMapImpl` will be informed whenever an Event is produced from `MolGNSSDataEvents`, and since `MolGNSSDataImpl` is the only Component that can produce such Events, `MolGNSSMapImpl` is informed by it. ```smalltalk MolGNSSMapImpl>>componentActivate @@ -285,7 +285,7 @@ MolGNSSMapImpl>>componentPassivate self getMolGNSSDataEventsSubscriber unsubscribe: self ``` -Next, we need to override the `currentPositionChanged: aGeoPosition` inherited from the `MolGNSSDataServices` (present in the `usedComponentServices` part of the Component's contract). In this case, the `accuracy` variable is used in order to display it in the Transcript by using `updatePositionCircleOnMap: aGeoPosition radius: radius`. +Next, we need to override the `currentPositionChanged: aGeoPosition` inherited from `MolGNSSDataServices` (present in the `usedComponentServices` part of the Component's contract). In this case, the `accuracy` variable is used in order to display it in the Transcript by using `updatePositionCircleOnMap: aGeoPosition radius: radius`. ```smalltalk MolGNSSMapImpl>>currentPositionChanged: aGeoPosition "Display a circle on the map view at the current position" @@ -308,12 +308,11 @@ This is also why it's not possible to start two components of the same Type at a ### Start the two components MolGNSSDataImpl and MolGNSSMapImpl In a **Playground** (located in the **Browse** tab of Pharo): - ```smalltalk MolGNSSDataImpl start. MolGNSSMapImpl start ``` -The Pharo **Transcript** (also located in the **Browse** tab of Pharo), will start showing messages in the form of \ +The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages in the form of \ '[Map] Receive new GNSS position: x@x radius: x m'; ### Starting a component with a name @@ -334,5 +333,5 @@ MolGNSSDataImpl stop. MolGNSSMapImpl stop ``` -To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means no Component is currently active. -You can also use the **Inspect Component Manager** option of Molecule, available from the Library tab of Pharo. If the window shown doesn't have a deployedComponents field or is set to *nil*, it also means that no Component is currently active. +To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. +You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. From 4db0cd594adc64028b370bb23dc14ae57deda0bf Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:24:42 +0100 Subject: [PATCH 31/70] Update Create and connect Components.md generated methods --- documentation/Create and connect Components.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 154a68ba..e1657a60 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -17,6 +17,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga Define the contract for MolGNSSData Create the Component implementation for MolGNSSData Define what the MolGNSSDataImpl Component does + Generated methods Create the Component implementation for MolGNSSMap Define the contract for MolGNSSMap Define what the MolGNSSMapImpl Component does @@ -216,9 +217,19 @@ MolGNSSDataImpl>>componentActivate self increaseAccuracy ] ] forkAt: Processor userBackgroundPriority ``` + +### Generated methods To quickly detail this method, we first need to examine `getMolGNSSDataEventsNotifier`. This method was generated by Pharo after `MolGNSSDataEvents` was put in the `producedComponentEvents` part of the Component's contract. To return to `componentActivate`, after every 50 milliseconds, a random geographical position is generated which is sent through the `currentPositionChanged: aGeoPosition` Event. +Generated methods take the following forms: +- get[componentName]EventsNotifier +- get[componentName]EventsSubscriber +- get[componentName]ServicesProvider +There is no need to manually type them. + +If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). + ```smalltalk MolGNSSDataImpl>>componentPassivate From 487eeca3b1abe552dd2ba741ee3c0d43f0c1ede4 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:28:34 +0100 Subject: [PATCH 32/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index e1657a60..728f38b7 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -232,6 +232,7 @@ If you're not getting all the generated methods you should have, you can first c ```smalltalk MolGNSSDataImpl>>componentPassivate + "stops the thread and resets it" sendCurrentPositionThread ifNotNil: [ :e | e terminate ]. sendCurrentPositionThread := nil @@ -289,7 +290,7 @@ MolGNSSMapImpl>>componentActivate self getMolGNSSDataEventsSubscriber subscribe: self ``` -Stopping the component means that it will not listen anymore to the events produced by `MolGNSSDataEvents`. +Stopping `MolGNSSMapImpl` means that it will not listen anymore to the events produced by `MolGNSSDataEvents`. ```smalltalk MolGNSSMapImpl>>componentPassivate From e655e919caf4df30ca6693a0a3aebea5597003b5 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:31:28 +0100 Subject: [PATCH 33/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 728f38b7..4a39d75a 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -328,14 +328,12 @@ The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will star '[Map] Receive new GNSS position: x@x radius: x m'; ### Starting a component with a name -It's also possible to create a component with a name by using the following method: -`[componentName] start: #[name]`. +It's also possible to create a component with a name by using the `MolComponentImpl class>>start: #[name]` method. This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. ## Stopping a component -Components are stopped using the `MolComponentImpl class>> stop` instruction, the method being similar to the `start` instruction since Components are stopped by `[componentName] stop`. \ -Components with a name are stopped a similar method as `start`, which is -`[componentName] stop: #[name]`. +Components are stopped using the `MolComponentImpl class>>stop` instruction. \ +Components with a name are stopped a similar method as `start`, which is `MolComponentImpl class>>stop: #[name]`. ## Stop the two components MolGNSSDataImpl and MolGNSSMapImpl In a **Playground** (located in the **Browse** tab of Pharo): From 5845977c1a3ae14df7a9b3df0c99ca48583ea7f3 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:32:08 +0100 Subject: [PATCH 34/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 4a39d75a..e45d4c63 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -343,5 +343,6 @@ MolGNSSDataImpl stop. MolGNSSMapImpl stop ``` -To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. +To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. \ + You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. From 6ac7bc38b791b4b4a2cec23f77d25f0b36ac448b Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:32:25 +0100 Subject: [PATCH 35/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index e45d4c63..f2509630 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -343,6 +343,6 @@ MolGNSSDataImpl stop. MolGNSSMapImpl stop ``` -To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. \ +To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. From 9a21f9a07a13e8ce0e9104498d6c3e01d9838ec8 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:33:19 +0100 Subject: [PATCH 36/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index f2509630..9443aeee 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -23,10 +23,10 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga Define what the MolGNSSMapImpl Component does DYNAMIC PART: Execution Starting a Component - Start the two components MolGNSSDataImpl and MolGNSSMapImpl + Start the MolGNSSDataImpl and MolGNSSMapImpl components Starting a component with a name Stopping a component - Stop the two components MolGNSSDataImpl and MolGNSSMapImpl + Stop the MolGNSSDataImpl and MolGNSSMapImpl components The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. @@ -318,7 +318,7 @@ This is also why it's not possible to start two components of the same Type at a **add img** -### Start the two components MolGNSSDataImpl and MolGNSSMapImpl +### Start the MolGNSSDataImpl and MolGNSSMapImpl components In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk MolGNSSDataImpl start. @@ -335,7 +335,7 @@ This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/m Components are stopped using the `MolComponentImpl class>>stop` instruction. \ Components with a name are stopped a similar method as `start`, which is `MolComponentImpl class>>stop: #[name]`. -## Stop the two components MolGNSSDataImpl and MolGNSSMapImpl +## Stop the MolGNSSDataImpl and MolGNSSMapImpl components In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk From 0516b13aca76d85cece1ebd06301ff9cf514bfe6 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:36:45 +0100 Subject: [PATCH 37/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 9443aeee..5e5d60e8 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -5,7 +5,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). # Contents - STATIC PART: declaration + [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) Define services and events Define Component types Adding Component contract with a Component Type From 01d14a61a772fcf2644471e21912998267cc8725 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:40:30 +0100 Subject: [PATCH 38/70] Update Create and connect Components.md --- .../Create and connect Components.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 5e5d60e8..5d6ed73e 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -5,28 +5,28 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). # Contents - [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) - Define services and events - Define Component types - Adding Component contract with a Component Type - Define first Component Type MolGNSSData - Define the second Component Type MolGNSSMap - Create a Component implementation of a Type - Create a new Component from scratch - Re-using an existing Class into a Component - Define the contract for MolGNSSData - Create the Component implementation for MolGNSSData - Define what the MolGNSSDataImpl Component does - Generated methods - Create the Component implementation for MolGNSSMap - Define the contract for MolGNSSMap - Define what the MolGNSSMapImpl Component does - DYNAMIC PART: Execution - Starting a Component - Start the MolGNSSDataImpl and MolGNSSMapImpl components - Starting a component with a name - Stopping a component - Stop the MolGNSSDataImpl and MolGNSSMapImpl components +[STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) + - Define services and events + - Define Component types + * Adding Component contract with a Component Type + + Define first Component Type MolGNSSData + + Define the second Component Type MolGNSSMap + - Create a Component implementation of a Type + * Create a new Component from scratch + * Re-using an existing Class into a Component + - Define the contract for MolGNSSData + - Create the Component implementation for MolGNSSData + - Define what the MolGNSSDataImpl Component does + * Generated methods + - Create the Component implementation for MolGNSSMap + * Define the contract for MolGNSSMap + * Define what the MolGNSSMapImpl Component does +DYNAMIC PART: Execution + - Starting a Component + * Start the MolGNSSDataImpl and MolGNSSMapImpl components + * Starting a component with a name + - Stopping a component + * Stop the MolGNSSDataImpl and MolGNSSMapImpl components The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 930ccb5cb4819a6d75852341c4e8fea07283a677 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:42:17 +0100 Subject: [PATCH 39/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 5d6ed73e..6ee2ba46 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -6,7 +6,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) - - Define services and events + * Define services and events - Define Component types * Adding Component contract with a Component Type + Define first Component Type MolGNSSData From 66a98a9cedae489383bc44c2bad9db5bde9795aa Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:57:11 +0100 Subject: [PATCH 40/70] Update Create and connect Components.md links added to table of contents --- .../Create and connect Components.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 6ee2ba46..54ce8fd8 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -6,27 +6,27 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) - * Define services and events - - Define Component types - * Adding Component contract with a Component Type - + Define first Component Type MolGNSSData - + Define the second Component Type MolGNSSMap - - Create a Component implementation of a Type - * Create a new Component from scratch - * Re-using an existing Class into a Component - - Define the contract for MolGNSSData - - Create the Component implementation for MolGNSSData - - Define what the MolGNSSDataImpl Component does - * Generated methods - - Create the Component implementation for MolGNSSMap - * Define the contract for MolGNSSMap - * Define what the MolGNSSMapImpl Component does -DYNAMIC PART: Execution - - Starting a Component - * Start the MolGNSSDataImpl and MolGNSSMapImpl components - * Starting a component with a name - - Stopping a component - * Stop the MolGNSSDataImpl and MolGNSSMapImpl components + * [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) + - [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) + * [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) + - [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) + * [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) + * [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) + - [Define the contract for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssdata) + - [Create the Component implementation for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssdata) + - [Define what the MolGNSSDataImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssdataimpl-component-does) + * [Generated methods](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#generated-methods) + - [Create the Component implementation for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssmap) + * [Define the contract for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssmap) + * [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) +[DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) + - [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) + * [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) + * [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) + - [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) + * [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 1ad4d11b9cc923d6596f7de243ec2749ce86de75 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:01:31 +0100 Subject: [PATCH 41/70] Update Create and connect Components.md --- .../Create and connect Components.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 54ce8fd8..8a9f6c45 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -6,27 +6,27 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) - * [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) - - [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - * [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) - + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) - + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) - - [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) - * [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) - * [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) - - [Define the contract for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssdata) - - [Create the Component implementation for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssdata) - - [Define what the MolGNSSDataImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssdataimpl-component-does) - * [Generated methods](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#generated-methods) - - [Create the Component implementation for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssmap) - * [Define the contract for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssmap) - * [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) +* [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) +* [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) + - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) +* [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) + - [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) + - [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) +* [Define the contract for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssdata) +* [Create the Component implementation for MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssdata) +* [Define what the MolGNSSDataImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssdataimpl-component-does) + - [Generated methods](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#generated-methods) +* [Create the Component implementation for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssmap) +* [Define the contract for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssmap) +* [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) [DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) - - [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) - * [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) - * [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) - - [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) - * [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) +* [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) + - [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) + - [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) +* [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) + - [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. From 4ea233f3c8b42e8234a0abd38c136d0f30846c9d Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:02:14 +0100 Subject: [PATCH 42/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 8a9f6c45..de497e87 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -20,7 +20,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga - [Generated methods](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#generated-methods) * [Create the Component implementation for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssmap) * [Define the contract for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssmap) -* [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) +* [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) \ [DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) * [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) - [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) From 4227820ee39fc21b6a94b03d7909e55c97d1d920 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:02:31 +0100 Subject: [PATCH 43/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index de497e87..4949bb76 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -20,7 +20,8 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga - [Generated methods](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#generated-methods) * [Create the Component implementation for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-the-component-implementation-for-molgnssmap) * [Define the contract for MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-contract-for-molgnssmap) -* [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) \ +* [Define what the MolGNSSMapImpl Component does](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-what-the-molgnssmapimpl-component-does) + [DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) * [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) - [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) From 46f27487fb68c8eb88ba619254065f98d1a7eb0b Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:03:23 +0100 Subject: [PATCH 44/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 4949bb76..2ed901ce 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -10,7 +10,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga * [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) - + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) + * [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) * [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) - [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) - [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) From ca278e95bc971349ed71dbb801470e0db01d23ff Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:03:44 +0100 Subject: [PATCH 45/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 2ed901ce..4ee2b83b 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -10,7 +10,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga * [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) - * [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) + + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) * [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) - [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) - [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) From edb71f67d8eba874408a71df85a0d59b90e4c612 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:04:51 +0100 Subject: [PATCH 46/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 4ee2b83b..74cf6152 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -25,7 +25,7 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga [DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) * [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) - [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) - - [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) + - [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) * [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) - [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) From 7a0f739d9a38a6af7b66c89d4392dc3229ae2e1d Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:06:17 +0100 Subject: [PATCH 47/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 74cf6152..af49f03e 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -336,7 +336,7 @@ This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/m Components are stopped using the `MolComponentImpl class>>stop` instruction. \ Components with a name are stopped a similar method as `start`, which is `MolComponentImpl class>>stop: #[name]`. -## Stop the MolGNSSDataImpl and MolGNSSMapImpl components +### Stop the MolGNSSDataImpl and MolGNSSMapImpl components In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk From 444efbde6657f1ef927d33ac87288487d0dc39f5 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:10:29 +0100 Subject: [PATCH 48/70] Update Parameters.md --- documentation/Parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Parameters.md b/documentation/Parameters.md index bf8f56ff..c484734b 100644 --- a/documentation/Parameters.md +++ b/documentation/Parameters.md @@ -1,5 +1,5 @@ # Parameters -Parameters are made of data only used at the initialization of a component. \ +Parameters are made of data only used at the initialization of a Component which impact its heart, its essential data. Parameters are not commonly used, instead opting for Services. \ Parameters are created in the `componentInitialize` method, which is executed during the **Initialize** state of a component's life-cycle. \ Parameters use the `MolComponentParameters` Trait From b0004f005e4cfdf62935c0d341d188b958a256e6 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:10:39 +0100 Subject: [PATCH 49/70] Update Parameters.md --- documentation/Parameters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Parameters.md b/documentation/Parameters.md index c484734b..d0fb989e 100644 --- a/documentation/Parameters.md +++ b/documentation/Parameters.md @@ -1,5 +1,5 @@ # Parameters -Parameters are made of data only used at the initialization of a Component which impact its heart, its essential data. +Parameters are made of data only used at the initialization of a Component which impact its heart, its essential data. \ Parameters are not commonly used, instead opting for Services. \ Parameters are created in the `componentInitialize` method, which is executed during the **Initialize** state of a component's life-cycle. \ Parameters use the `MolComponentParameters` Trait From 874ee133a8d600f9893302298f83d4a7537bd1b2 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:11:12 +0100 Subject: [PATCH 50/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index af49f03e..ab5f09eb 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -4,6 +4,9 @@ ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). +The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ +A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. + # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) * [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) @@ -29,9 +32,6 @@ GPS (Global Positioning System) is the american subsystem of GNSS (Global Naviga * [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) - [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) -The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ -A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. - # STATIC PART: declaration ## Define services and events From f0e21dc75df49a8daf5b045248c2e6502c6fa959 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:12:05 +0100 Subject: [PATCH 51/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index ab5f09eb..b40d4d83 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -10,7 +10,7 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) * [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) -* [Define Component types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) +* [Define Component Types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) @@ -70,7 +70,7 @@ This Event trait produces the `currentPositionChanged: aGeoPosition` Event "method is left empty, will be defined in the Component that consumes it" ``` -## Define Component types +## Define Component Types ### Adding Component contract with a Component Type Whatever the method to create a Component (from scratch or with an existing Class) is, its contract first needs to be defined (for the two methods, the construction and assignment of the contract is the same). From c496899e575b8a6b1d856054bb2ded8873ecbc52 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:13:16 +0100 Subject: [PATCH 52/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index b40d4d83..dea48b0d 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -27,10 +27,10 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit [DYNAMIC PART: Execution](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#dynamic-part-execution) * [Starting a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component) - - [Start the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) - - [Starting a component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) -* [Stopping a component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) - - [Stop the MolGNSSDataImpl and MolGNSSMapImpl components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) + - [Start the MolGNSSDataImpl and MolGNSSMapImpl Components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#start-the-molgnssdataimpl-and-molgnssmapimpl-components) + - [Starting a Component with a name](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#starting-a-component-with-a-name) +* [Stopping a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stopping-a-component) + - [Stop the MolGNSSDataImpl and MolGNSSMapImpl Components](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#stop-the-molgnssdataimpl-and-molgnssmapimpl-components) # STATIC PART: declaration @@ -319,7 +319,7 @@ This is also why it's not possible to start two components of the same Type at a **add img** -### Start the MolGNSSDataImpl and MolGNSSMapImpl components +### Start the MolGNSSDataImpl and MolGNSSMapImpl Components In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk MolGNSSDataImpl start. @@ -328,15 +328,15 @@ MolGNSSMapImpl start The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages in the form of \ '[Map] Receive new GNSS position: x@x radius: x m'; -### Starting a component with a name +### Starting a Component with a name It's also possible to create a component with a name by using the `MolComponentImpl class>>start: #[name]` method. This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. -## Stopping a component +## Stopping a Component Components are stopped using the `MolComponentImpl class>>stop` instruction. \ Components with a name are stopped a similar method as `start`, which is `MolComponentImpl class>>stop: #[name]`. -### Stop the MolGNSSDataImpl and MolGNSSMapImpl components +### Stop the MolGNSSDataImpl and MolGNSSMapImpl Components In a **Playground** (located in the **Browse** tab of Pharo): ```smalltalk From 09762a09c466d0cce93b7394df80ec69e745c4df Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:14:41 +0100 Subject: [PATCH 53/70] Update Create and connect Components.md --- .../Create and connect Components.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index dea48b0d..6c59e219 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -34,6 +34,31 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit # STATIC PART: declaration +## Define Component Types + +### Adding Component contract with a Component Type +Whatever the method to create a Component (from scratch or with an existing Class) is, its contract first needs to be defined (for the two methods, the construction and assignment of the contract is the same). + +The Component Type implements the Component contract (used/provided Services, consumed/produced Events, used/provided Parameters). \ +The Type is implemented through a Trait. \ +Types don't have any methods on the Instance side of Pharo, their contract is to be defined by overriding some methods on the **Class side** of Pharo. + +#### Define the first Component Type MolGNSSData +```smalltalk +Trait named: #MolGNSSData + uses: MolComponentType + instanceVariableNames: '' + package: 'Molecule-Tutorial' +``` + +#### Define the second Component Type MolGNSSMap +```smalltalk +Trait named: #MolGNSSMap + uses: MolComponentType + instanceVariableNames: '' + package: 'Molecule-Tutorial' +``` + ## Define services and events Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. @@ -70,31 +95,6 @@ This Event trait produces the `currentPositionChanged: aGeoPosition` Event "method is left empty, will be defined in the Component that consumes it" ``` -## Define Component Types - -### Adding Component contract with a Component Type -Whatever the method to create a Component (from scratch or with an existing Class) is, its contract first needs to be defined (for the two methods, the construction and assignment of the contract is the same). - -The Component Type implements the Component contract (used/provided Services, consumed/produced Events, used/provided Parameters). \ -The Type is implemented through a Trait. \ -Types don't have any methods on the Instance side of Pharo, their contract is to be defined by overriding some methods on the **Class side** of Pharo. - -#### Define the first Component Type MolGNSSData -```smalltalk -Trait named: #MolGNSSData - uses: MolComponentType - instanceVariableNames: '' - package: 'Molecule-Tutorial' -``` - -#### Define the second Component Type MolGNSSMap -```smalltalk -Trait named: #MolGNSSMap - uses: MolComponentType - instanceVariableNames: '' - package: 'Molecule-Tutorial' -``` - ## Create a Component implementation of a Type There are two ways to create a new Molecule Component : - Create a new Component from scratch : write a new Class inheriting from the Component hierarchy From 10b40a670161c735a8126e7b6c39d86d9ae90021 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:15:18 +0100 Subject: [PATCH 54/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 6c59e219..7f5d3e98 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -9,11 +9,11 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) -* [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) * [Define Component Types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) +* [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) * [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) - [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) - [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) From 542c11de2afbc4820370f433f624810aaced33d0 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:15:47 +0100 Subject: [PATCH 55/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 7f5d3e98..dc61c2e3 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -13,7 +13,7 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) -* [Define services and events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) +* [Define Services and Events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) * [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) - [Create a new Component from scratch](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-new-component-from-scratch) - [Re-using an existing Class into a Component](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#re-using-an-existing-class-into-a-component) @@ -59,7 +59,7 @@ Trait named: #MolGNSSMap package: 'Molecule-Tutorial' ``` -## Define services and events +## Define Services and Events Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. First, we create a Service Trait¹ (a Trait that uses the `MolComponentServices` Trait) From 58b14f63d6354804939cc6db28a573bb9d19eb2b Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:21:15 +0100 Subject: [PATCH 56/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index dc61c2e3..2e890ba2 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -176,7 +176,7 @@ MolGNSSDataImpl>>increaseAccuracy self accuracy: nextAccuracy ] ``` -Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`) +Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`). The override is done since the `getAccuracyRadiusInMeters` Service is declared in the `providedComponentServices` part of `MolGNSSData`'s contract. And since `MolGNSSDataImpl` is an implemmentation of `MolGNSSData`, the `getAccuracyRadiusInMeters` is implemented here. ```smalltalk MolGNSSDataImpl>>getAccuracyRadiusInMeters "Get and return the accuracy of the GNSS depending quality of signal and quantity of connected satellites" From b73a84d1098cc24bcef65e2eb4bcef0f5d0d4919 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:27:59 +0100 Subject: [PATCH 57/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 2e890ba2..725f53ac 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,6 +1,7 @@ # Create and connect Components - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data) - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data) \ +They're directly linked, in the sens that a change detected in the first Component is observable in real time in the second component. ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). From 8e5ee2b6f67c4b76388862bf9db62c912afae59f Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:11:48 +0100 Subject: [PATCH 58/70] Update Create and connect Components.md added screenshots --- .../Create and connect Components.md | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 725f53ac..84293a15 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,7 +1,6 @@ -# Create and connect Components +![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/4f6d1f18-6d56-45da-80af-51f8ae20eebf)# Create and connect Components - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data) - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data) \ -They're directly linked, in the sens that a change detected in the first Component is observable in real time in the second component. ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). @@ -36,6 +35,8 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit # STATIC PART: declaration ## Define Component Types +Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +![molecule examples red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/fc366d2f-aebd-49da-9dba-2c08da797211) ### Adding Component contract with a Component Type Whatever the method to create a Component (from scratch or with an existing Class) is, its contract first needs to be defined (for the two methods, the construction and assignment of the contract is the same). @@ -43,6 +44,7 @@ Whatever the method to create a Component (from scratch or with an existing Clas The Component Type implements the Component contract (used/provided Services, consumed/produced Events, used/provided Parameters). \ The Type is implemented through a Trait. \ Types don't have any methods on the Instance side of Pharo, their contract is to be defined by overriding some methods on the **Class side** of Pharo. +![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/9a5556aa-d598-4277-a6d0-b31243ee6ecd) #### Define the first Component Type MolGNSSData ```smalltalk @@ -61,8 +63,6 @@ Trait named: #MolGNSSMap ``` ## Define Services and Events -Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. - First, we create a Service Trait¹ (a Trait that uses the `MolComponentServices` Trait) ```smalltalk Trait named: #MolGNSSDataServices @@ -120,6 +120,8 @@ In order to do that, its contract needs to be redefined to indicate which Servic ![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browser** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ +![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7b189b8a-1552-46df-a69d-44f78bb73848) + The needed methods for the contract already exist (since the Components' Type use `MolComponentType`), they just need to be overridden. \ A Component Type can provide multiple Services and Events (separated by a comma), there's just one each for this tutorial (each one being put between the curly brackets of the methods). @@ -141,6 +143,7 @@ MolGNSSData>>providedComponentServices ## Create the Component implementation for MolGNSSData Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +![molecule abstractcomponentimpl red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/5900b86d-791f-4e77-be7e-5abcfe577597) When this is all done, we can move on to create the GNSS Component, being `MolGNSSDataImpl`. This component uses the `MolGNSSData` Trait, used to define the Component's contract, as well as the `MolGNSSDataServices` interface which needs to be specified in order for the Component to provide its Service. ```smalltalk @@ -177,7 +180,7 @@ MolGNSSDataImpl>>increaseAccuracy self accuracy: nextAccuracy ] ``` -Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`). The override is done since the `getAccuracyRadiusInMeters` Service is declared in the `providedComponentServices` part of `MolGNSSData`'s contract. And since `MolGNSSDataImpl` is an implemmentation of `MolGNSSData`, the `getAccuracyRadiusInMeters` is implemented here. +Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`) ```smalltalk MolGNSSDataImpl>>getAccuracyRadiusInMeters "Get and return the accuracy of the GNSS depending quality of signal and quantity of connected satellites" @@ -230,7 +233,8 @@ Generated methods take the following forms: - get[componentName]ServicesProvider There is no need to manually type them. -If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). +If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). +![molecule define all components red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/6a8e8696-0e55-4ac7-86de-a5d6e3fbbcdf) ```smalltalk MolGNSSDataImpl>>componentPassivate @@ -269,6 +273,8 @@ MolGNSSMap>>usedComponentServices ## Define what the MolGNSSMapImpl Component does First off, this method is used to show in the Transcript (available from the **Browse** tab of Pharo) every position received from `MolGNSSDataImpl`. +![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/d76a733f-ae31-4119-a54f-50ecef91e8e8) + ```smalltalk MolGNSSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius "Update geographic position of the received GNSS position circle with a precision radius" @@ -327,8 +333,10 @@ MolGNSSDataImpl start. MolGNSSMapImpl start ``` The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages in the form of \ +![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cbd921c4-ad9b-4b40-8440-e693eb1a8e99) '[Map] Receive new GNSS position: x@x radius: x m'; + ### Starting a Component with a name It's also possible to create a component with a name by using the `MolComponentImpl class>>start: #[name]` method. This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. From 567d397365e451c568b986251e80d90f2180adf1 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:12:38 +0100 Subject: [PATCH 59/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 84293a15..b0242870 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -1,6 +1,7 @@ -![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/4f6d1f18-6d56-45da-80af-51f8ae20eebf)# Create and connect Components +# Create and connect Components - In this tutorial, we will create a first Component that produces an Event and provides a Service (a GNSS emitting geographical data) - We will then create a second Component that uses the provided Service and consumes the produced Event (a Map acting as a display for the data) \ +They're directly linked, in the sense that a change detected in the first Component is observable in real time in the second component. ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). @@ -180,7 +181,7 @@ MolGNSSDataImpl>>increaseAccuracy self accuracy: nextAccuracy ] ``` -Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`) +Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`). The override is done since the `getAccuracyRadiusInMeters` Service is declared in the `providedComponentServices` part of `MolGNSSData`'s contract. And since `MolGNSSDataImpl` is an implemmentation of `MolGNSSData`, the `getAccuracyRadiusInMeters` is implemented here. ```smalltalk MolGNSSDataImpl>>getAccuracyRadiusInMeters "Get and return the accuracy of the GNSS depending quality of signal and quantity of connected satellites" From f9b71473943b195da90e3921954fdef14f377318 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:15:54 +0100 Subject: [PATCH 60/70] Update Create and connect Components.md browser screenshots --- documentation/Create and connect Components.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index b0242870..ed5a7c16 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -37,6 +37,7 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit ## Define Component Types Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/6ad72abf-b1bf-44f0-af5f-64ecfb8e2571) ![molecule examples red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/fc366d2f-aebd-49da-9dba-2c08da797211) ### Adding Component contract with a Component Type @@ -120,7 +121,8 @@ In order to do that, its contract needs to be redefined to indicate which Servic ![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) -Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browser** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ +Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ +![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7fa84d1d-45b4-4fe1-b524-6193fc7d6fec) ![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7b189b8a-1552-46df-a69d-44f78bb73848) The needed methods for the contract already exist (since the Components' Type use `MolComponentType`), they just need to be overridden. \ @@ -144,6 +146,7 @@ MolGNSSData>>providedComponentServices ## Create the Component implementation for MolGNSSData Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cc44a9f9-673b-41f4-abee-c57516bff654) ![molecule abstractcomponentimpl red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/5900b86d-791f-4e77-be7e-5abcfe577597) When this is all done, we can move on to create the GNSS Component, being `MolGNSSDataImpl`. This component uses the `MolGNSSData` Trait, used to define the Component's contract, as well as the `MolGNSSDataServices` interface which needs to be specified in order for the Component to provide its Service. From 5d32ef1da3df754bfc6f44d56f503ed3db7197c4 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:19:29 +0100 Subject: [PATCH 61/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index ed5a7c16..75f8aa3d 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -36,7 +36,7 @@ A graphical form of the example is available in the [Molecule-Geographical-Posit # STATIC PART: declaration ## Define Component Types -Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +Code spaces beginning by `Trait` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. \ ![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/6ad72abf-b1bf-44f0-af5f-64ecfb8e2571) ![molecule examples red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/fc366d2f-aebd-49da-9dba-2c08da797211) @@ -145,7 +145,7 @@ MolGNSSData>>providedComponentServices ``` ## Create the Component implementation for MolGNSSData -Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. +Code spaces beginning by `MolAbstractComponentImpl` need to be put in the code space under *New class* in the **System Browser**, located in the **Browse** tab of Pharo. \ ![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cc44a9f9-673b-41f4-abee-c57516bff654) ![molecule abstractcomponentimpl red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/5900b86d-791f-4e77-be7e-5abcfe577597) @@ -238,7 +238,7 @@ Generated methods take the following forms: There is no need to manually type them. If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). -![molecule define all components red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/6a8e8696-0e55-4ac7-86de-a5d6e3fbbcdf) +![molecule define all components red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/b4625c91-749e-478e-83c3-68ef47bc2070) ```smalltalk MolGNSSDataImpl>>componentPassivate @@ -277,8 +277,6 @@ MolGNSSMap>>usedComponentServices ## Define what the MolGNSSMapImpl Component does First off, this method is used to show in the Transcript (available from the **Browse** tab of Pharo) every position received from `MolGNSSDataImpl`. -![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/d76a733f-ae31-4119-a54f-50ecef91e8e8) - ```smalltalk MolGNSSMapImpl>>updatePositionCircleOnMap: aGeoPosition radius: radius "Update geographic position of the received GNSS position circle with a precision radius" @@ -337,7 +335,7 @@ MolGNSSDataImpl start. MolGNSSMapImpl start ``` The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages in the form of \ -![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cbd921c4-ad9b-4b40-8440-e693eb1a8e99) +![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cbd921c4-ad9b-4b40-8440-e693eb1a8e99) \ '[Map] Receive new GNSS position: x@x radius: x m'; From ccf5d8c4f95bc642031f4e8730c5bf449e712514 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:22:42 +0100 Subject: [PATCH 62/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 75f8aa3d..f803acf4 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -334,10 +334,9 @@ In a **Playground** (located in the **Browse** tab of Pharo): MolGNSSDataImpl start. MolGNSSMapImpl start ``` -The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages in the form of \ +The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will start showing messages: \ ![transcript red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/cbd921c4-ad9b-4b40-8440-e693eb1a8e99) \ -'[Map] Receive new GNSS position: x@x radius: x m'; - +![transcript gnss](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/5346e6e8-6536-4d05-a875-d8954695b55b) ### Starting a Component with a name It's also possible to create a component with a name by using the `MolComponentImpl class>>start: #[name]` method. From 6df27e02789ad162243be19291bd36c23fb30019 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:26:13 +0100 Subject: [PATCH 63/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index f803acf4..760d3a90 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -234,7 +234,7 @@ To return to `componentActivate`, after every 50 milliseconds, a random geograph Generated methods take the following forms: - get[componentName]EventsNotifier - get[componentName]EventsSubscriber -- get[componentName]ServicesProvider +- get[componentName]ServicesProvider \ There is no need to manually type them. If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). From 5bd91e5432cf4dd1284784e27df4ef0919dfed82 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:27:11 +0100 Subject: [PATCH 64/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 760d3a90..08524a57 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -234,7 +234,8 @@ To return to `componentActivate`, after every 50 milliseconds, a random geograph Generated methods take the following forms: - get[componentName]EventsNotifier - get[componentName]EventsSubscriber -- get[componentName]ServicesProvider \ +- get[componentName]ServicesProvider + There is no need to manually type them. If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). From e966bab797ecc7771ba6ca3a4f63d32dded52528 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:29:27 +0100 Subject: [PATCH 65/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 08524a57..d8d393ec 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -358,3 +358,4 @@ MolGNSSMapImpl stop To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. +![molecule inspect component manager red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/2a09ab48-ea3b-4f59-bc25-b32457321845) From 9152a2272589d2ae774dc8528478aea9028dba98 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 11:35:03 +0100 Subject: [PATCH 66/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index d8d393ec..effdc2b4 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -239,7 +239,7 @@ Generated methods take the following forms: There is no need to manually type them. If you're not getting all the generated methods you should have, you can first click on the **Library** tab of Pharo, then select **Molecule** -> **Debug and Tools** and then click on **Define All Components**. If you're still not getting what you expected, you will need to verify what is put in your component's contract (no empty instance variable for example). -![molecule define all components red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/b4625c91-749e-478e-83c3-68ef47bc2070) +![molecule define all components red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/4d3a2e7e-e320-48fa-bbc4-cb26d30823bc) ```smalltalk MolGNSSDataImpl>>componentPassivate @@ -358,4 +358,4 @@ MolGNSSMapImpl stop To verify that all your Components are stopped, you can use `MolUtils allComponentInstancesOfType:` on the Type Trait of a Component. If it returns an empty list, it means that no Component is currently active. You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. -![molecule inspect component manager red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/2a09ab48-ea3b-4f59-bc25-b32457321845) +![molecule inspect component manager red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/ae61cd53-1835-488b-a5cc-9c4046b116eb) From 82f243fb90d9839d419a943e2d17a7febccaa69e Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:24:52 +0100 Subject: [PATCH 67/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index effdc2b4..a35dd93a 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -112,13 +112,11 @@ Imagine that we want to reuse an open-source library that implements the behavio With Molecule, we reuse any existing Class by augmenting that Class with Component behavior. This Class becomes seamlessly usable as a Component in a Molecule architecture. We must use the Molecule Component interface `MolComponentImpl`, which is a Trait, in the existing Class. Any class that implements this interface is usable as a Molecule component. Then, we assign the type Component to the class as a standard Molecule Component. - ![classes et composants Molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/82fe912e-8db9-479f-ae0f-1d1d050318eb) ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. - ![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ From 0dc70f34f4c336d726a62eb62c82fa865d3adab7 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:26:24 +0100 Subject: [PATCH 68/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index a35dd93a..fb9843e5 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -357,3 +357,4 @@ To verify that all your Components are stopped, you can use `MolUtils allCompone You can also use the **Inspect Component Manager** option of Molecule, available from the **Library tab of Pharo**. If the window shown doesn't have a *deployedComponents* field or is set to *nil*, it also means that no Component is currently active. ![molecule inspect component manager red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/ae61cd53-1835-488b-a5cc-9c4046b116eb) +![componentmanager](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/4228e992-ffc2-4236-b44c-9ba215b23473) From c55be04674cd0fe663c03fcf4fde586b54bfa854 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:28:46 +0100 Subject: [PATCH 69/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 1 - 1 file changed, 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index fb9843e5..884563d1 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -118,7 +118,6 @@ We must use the Molecule Component interface `MolComponentImpl`, which is a Trai For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. ![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) - Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ ![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7fa84d1d-45b4-4fe1-b524-6193fc7d6fec) ![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7b189b8a-1552-46df-a69d-44f78bb73848) From f119bd43e995b5a07b6ce793b521e9eef2a029b0 Mon Sep 17 00:00:00 2001 From: Eliott-Guevel <76944457+Eliott-Guevel@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:29:32 +0100 Subject: [PATCH 70/70] Update Create and connect Components.md --- documentation/Create and connect Components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index 884563d1..b5594ad5 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -117,7 +117,7 @@ We must use the Molecule Component interface `MolComponentImpl`, which is a Trai ## Define the contract for MolGNSSData For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. -![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) +![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) \ Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ ![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7fa84d1d-45b4-4fe1-b524-6193fc7d6fec) ![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7b189b8a-1552-46df-a69d-44f78bb73848)