-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from OpenSmock/dev_impl_defineContract
Dev impl define contract
- Loading branch information
Showing
8 changed files
with
635 additions
and
172 deletions.
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
src/Molecule-Tests/MolCompleteComponentOverloadImpl.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
" | ||
I am a component impl overloading my contract for impl purpose | ||
" | ||
Class { | ||
#name : #MolCompleteComponentOverloadImpl, | ||
#superclass : #MolAbstractComponentImpl, | ||
#traits : 'MolCompleteComponent + MolUsedServices + MolUsedEvents + MolUsedParameters + MolUsedParameters2 + MolUsedServices2 + MolUsedEvents2', | ||
#classTraits : 'MolCompleteComponent classTrait + MolUsedServices classTrait + MolUsedEvents classTrait + MolUsedParameters classTrait + MolUsedParameters2 classTrait + MolUsedServices2 classTrait + MolUsedEvents2 classTrait', | ||
#category : #'Molecule-Tests-Resources - Components' | ||
} | ||
|
||
{ #category : #'accessing - events' } | ||
MolCompleteComponentOverloadImpl class >> consumedComponentEvents [ | ||
|
||
<componentContract> | ||
^ { MolUsedEvents. MolUsedEvents2 } | ||
] | ||
|
||
{ #category : #'accessing - events' } | ||
MolCompleteComponentOverloadImpl class >> producedComponentEvents [ | ||
|
||
<componentContract> | ||
^ { | ||
MolUsedEvents. | ||
MolUsedEvents2 } | ||
] | ||
|
||
{ #category : #'accessing - parameters' } | ||
MolCompleteComponentOverloadImpl class >> providedComponentParameters [ | ||
|
||
<componentContract> | ||
^ { MolUsedParameters. MolUsedParameters2. } | ||
] | ||
|
||
{ #category : #'accessing - services' } | ||
MolCompleteComponentOverloadImpl class >> providedComponentServices [ | ||
|
||
<componentContract> | ||
^ { MolUsedServices. MolUsedServices2 } | ||
] | ||
|
||
{ #category : #'accessing - parameters' } | ||
MolCompleteComponentOverloadImpl class >> usedComponentParameters [ | ||
|
||
<componentContract> | ||
^ { MolUsedParameters. MolUsedParameters2 } | ||
] | ||
|
||
{ #category : #'accessing - services' } | ||
MolCompleteComponentOverloadImpl class >> usedComponentServices [ | ||
|
||
<componentContract> | ||
^ { MolUsedServices. MolUsedServices2 } | ||
] | ||
|
||
{ #category : #events } | ||
MolCompleteComponentOverloadImpl >> event [ | ||
^ #event | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedEvents2Notifier [ | ||
^self eventsNotifiers at: MolUsedEvents2 ifAbsent: [^MolNotFoundEventsNotifier new interface: MolUsedEvents2 name: nil]. | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedEvents2Subscriber [ | ||
| eventsSymbol eventsSubscriber itf | | ||
itf := MolUsedEvents2. | ||
eventsSymbol := self eventsSubscribers at: itf ifAbsent: [^MolNotFoundEventsSubscriber new interface: itf name: nil]. | ||
eventsSymbol isCollection | ||
ifTrue: | ||
[eventsSubscriber := MolComponentManager default locatorServices | ||
searchEventsSubscriberFor: MolUsedEvents2 named: eventsSymbol ]. | ||
^eventsSubscriber | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedEventsNotifier [ | ||
^self eventsNotifiers at: MolUsedEvents ifAbsent: [^MolNotFoundEventsNotifier new interface: MolUsedEvents name: nil]. | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedEventsSubscriber [ | ||
| eventsSymbol eventsSubscriber itf | | ||
itf := MolUsedEvents. | ||
eventsSymbol := self eventsSubscribers at: itf ifAbsent: [^MolNotFoundEventsSubscriber new interface: itf name: nil]. | ||
eventsSymbol isCollection | ||
ifTrue: | ||
[eventsSubscriber := MolComponentManager default locatorServices | ||
searchEventsSubscriberFor: MolUsedEvents named: eventsSymbol ]. | ||
^eventsSubscriber | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedParameters2Provider [ | ||
| parametersSymbol parametersProvider itf | | ||
|
||
itf := MolUsedParameters2. | ||
parametersSymbol := self parametersProviders at: itf ifAbsent: [nil]. | ||
(parametersSymbol isNil or:[parametersSymbol isSymbol not]) ifTrue: [ ^ MolNotFoundParametersProvider new interface: itf name: nil ]. | ||
|
||
parametersProvider := MolComponentManager default locatorServices searchParametersProviderFor: MolUsedParameters2 named: parametersSymbol. | ||
^parametersProvider | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedParametersProvider [ | ||
| parametersSymbol parametersProvider itf | | ||
|
||
itf := MolUsedParameters. | ||
parametersSymbol := self parametersProviders at: itf ifAbsent: [nil]. | ||
(parametersSymbol isNil or:[parametersSymbol isSymbol not]) ifTrue: [ ^ MolNotFoundParametersProvider new interface: itf name: nil ]. | ||
|
||
parametersProvider := MolComponentManager default locatorServices searchParametersProviderFor: MolUsedParameters named: parametersSymbol. | ||
^parametersProvider | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedServices2Provider [ | ||
| servicesSymbol servicesProvider itf | | ||
|
||
itf := MolUsedServices2. | ||
servicesSymbol := self servicesProviders at: itf ifAbsent: [nil]. | ||
(servicesSymbol isNil or:[servicesSymbol isSymbol not]) ifTrue: [ ^ MolNotFoundServicesProvider new interface: itf name: nil ]. | ||
|
||
servicesProvider := MolComponentManager default locatorServices searchServicesProviderFor: MolUsedServices2 named: servicesSymbol. | ||
^servicesProvider | ||
] | ||
|
||
{ #category : #'component accessing' } | ||
MolCompleteComponentOverloadImpl >> getMolUsedServicesProvider [ | ||
| servicesSymbol servicesProvider itf | | ||
|
||
itf := MolUsedServices. | ||
servicesSymbol := self servicesProviders at: itf ifAbsent: [nil]. | ||
(servicesSymbol isNil or:[servicesSymbol isSymbol not]) ifTrue: [ ^ MolNotFoundServicesProvider new interface: itf name: nil ]. | ||
|
||
servicesProvider := MolComponentManager default locatorServices searchServicesProviderFor: MolUsedServices named: servicesSymbol. | ||
^servicesProvider | ||
] | ||
|
||
{ #category : #parameters } | ||
MolCompleteComponentOverloadImpl >> parameter [ | ||
^ #parameter | ||
] | ||
|
||
{ #category : #service } | ||
MolCompleteComponentOverloadImpl >> service [ | ||
^ #service | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
" | ||
I am a event trait used for impl overloading test | ||
" | ||
Trait { | ||
#name : #MolUsedEvents2, | ||
#traits : 'MolComponentEvents', | ||
#classTraits : 'MolComponentEvents classTrait', | ||
#category : #'Molecule-Tests-Resources - Contracts' | ||
} | ||
|
||
{ #category : #events } | ||
MolUsedEvents2 >> event2 [ | ||
|
||
^ #event2 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
" | ||
I am a param trait used for impl overloading test | ||
" | ||
Trait { | ||
#name : #MolUsedParameters2, | ||
#traits : 'MolComponentParameters', | ||
#classTraits : 'MolComponentParameters classTrait', | ||
#category : #'Molecule-Tests-Resources - Contracts' | ||
} | ||
|
||
{ #category : #'parameters 2' } | ||
MolUsedParameters2 >> parameter2 [ | ||
|
||
^ #parameter2 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
" | ||
I am a services trait used for impl overloading test | ||
" | ||
Trait { | ||
#name : #MolUsedServices2, | ||
#traits : 'MolComponentServices', | ||
#classTraits : 'MolComponentServices classTrait', | ||
#category : #'Molecule-Tests-Resources - Contracts' | ||
} | ||
|
||
{ #category : #'service 2' } | ||
MolUsedServices2 >> service2 [ | ||
|
||
^ #service2 | ||
] |
Oops, something went wrong.