CLIC
a Component Model Symbiotic with Smalltalk
- N. Bouraqadi and L. Fabresse
Ecole des Mines de Douai http://vst.ensm-douai.fr/Clic
+ CLIC!
CLIC a Component Model Symbiotic with Smalltalk N. Bouraqadi and - - PowerPoint PPT Presentation
CLIC! + CLIC a Component Model Symbiotic with Smalltalk N. Bouraqadi and L. Fabresse Ecole des Mines de Douai http://vst.ensm-douai.fr/Clic 2 Software Engineering Virtuous Circle Programming Language N. Bouraqadi & L. Fabresse -
Ecole des Mines de Douai http://vst.ensm-douai.fr/Clic
+ CLIC!
2
Programming Language Good Practices
3
– Design drawings – Comments
– Inversion of control – Use of design patterns such as Observer
4
– Code change not reflected in documentation
– Dependencies hidden inside methods
5
– Documentation – Loose Coupling
6
– Part of the software
– Implemented or picked out of some library
– According to the architecture
7
a piece of software
– Standalone or not
self-documented
– Requirements / Dependencies – Provided services – Parameters – Architecture
easy to deploy
– Explicit connections to the rest of the software
8
– Objects = building blocks for components
9
language
– No objects – Ex: SCL
10
U n i f y d e s i g n a n d c
e P e r f
m a n c e R e u s e O O c
e E a s y t
m p l e m e n t Object-based Pure components
11
U n i f y d e s i g n a n d c
e P e r f
m a n c e R e u s e O O c
e E a s y t
m p l e m e n t
12
– Can be used by objects
– Can be connected to components – Possibly with implicit / tight dependencies
– Same performances
13
Single Provided Port
… + + + …
C3 C4 C5
+
C1 C2
Simple Required Ports Collection Required Ports
+
Attributes Assembly
14
– 1 attribute => 1 collection required port
15
count count: anInt increment decrement
+ 12 countObservers port count attribute
16
CLComponent subclass: #Counter localPrivateAttributeNames: #(count) privateAttributesInitDict: { #count -> 0} sharedAttributeNames: #() sharedAttributesInitDict: {} localRequiredPortsDict: {} category: #'ClicExamples-Clock'
17
CLComponent subclass: #Counter localPrivateAttributeNames: #(count) privateAttributesInitDict: { #count -> 0} sharedAttributeNames: #() sharedAttributesInitDict: {} localRequiredPortsDict: {} category: #'ClicExamples-Clock'
18
CLComponent subclass: #Counter localPrivateAttributeNames: #(count) privateAttributesInitDict: { #count -> 0} sharedAttributeNames: #() sharedAttributesInitDict: {} localRequiredPortsDict: {} category: #'ClicExamples-Clock'
19
CLComponent subclass: #Counter localPrivateAttributeNames: #(count) privateAttributesInitDict: { #count -> 0} sharedAttributeNames: #() sharedAttributesInitDict: {} localRequiredPortsDict: {} category: #'ClicExamples-Clock'
20
Counter >> increment self count: self count + 1 Counter >> decrement self count: self count - 1
21
|myCounter| myCounter := Counter new. myCounter increment. Transcript cr; show: myCounter count
22
+
+
counter ticker reset start stop seconds
23
+
+
counter ticker count: 0 reset receiveEvent: method lookup & evaluation
24
+
+
counter ticker increment start receiveEvent: start
25
+
+
counter ticker seconds count
26
CLComponent subclass: #StopWatch localPrivateAttributeNames: #(counter ticker) privateAttributesInitDict: { #counter -> Counter @ #new. #ticker -> GenericTicker @ #new} …
27
… sharedAttributeNames: #(Scheduler) sharedAttributesInitDict: { #Scheduler -> Processor} …
28
… architectureFrom: { (#ticker @ #notifiedComponents) => #counter}; …
29
…
#counter @ #(count) -> #(seconds). #ticker @ #(start stop)}; …
30
… exportedRequiredPortsDictFrom: { #counter @ #(countObservers)
31
StopWatch>>reset self counter count: 0 StopWatch>>initialize super initialize. self ticker tickSelector: #increment; stepDelayDuration: 1000; processPriority: self Scheduler timingPriority.
32
good practices
– Documentation
– Loose coupling
33
symbiosis
– Easy implementation
– Components as first class entities – Same run-time => Same performance – Ability to use objects ("dirty" components)
34
Ecole des Mines de Douai http://vst.ensm-douai.fr/Clic
+ CLIC!