-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolidslides.html
More file actions
850 lines (694 loc) · 35.6 KB
/
solidslides.html
File metadata and controls
850 lines (694 loc) · 35.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How to be a SOLID programmer</title>
<meta name="description" content="SOLID principles in action">
<meta name="author" content="Thomas Stainer">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/white.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
.reveal .slide-number {
font-size: 28px;
}
.pdf-page{
background: #fff;
max-height: 727px;
}
body > div.reveal.slide.center.has-vertical-slides.has-horizontal-slides.ready > div.slides > section:nth-child(n) > div:nth-child(1) > section{
top: 14px !important;
}
.topright {
position: relative;
}
.topright img {
position: absolute;
top: 0px;
right: 0px;
}
.bottomleft {
position: relative;
}
.bottomleft img {
position: fixed;
width: 135% !important;
margin: 0 !important;
padding: 0 !important;
bottom: -35px;
left: -155px;
}
.nomargin {
margin: 0px 0px 0px 0px !important;
}
</style>
</head>
<body>
<div class="reveal">
<!-- custom header for showing letters of acroynm in various slides. use data-state="header1" in section required -->
<header style="position: absolute;top: 50px; left: 100px; z-index:500; font-size:70px;color: rgba(0, 81, 255, 0.671);"></header>
<div class="slides">
<!-- Title Slide -->
<section id="title-slide">
<div class="ukaea">
<h2>How to be a <font color="red">S</font><font color="green">O</font><font color="blue">L</font><font color="pink">I</font><font color="orange">D</font> programmer</h2>
<p>Thomas Stainer</p>
<p>24/01/2020</p>
</div>
</section>
<!-- Intro Slide -->
<section id="intro-slide">
<div class="ukaea">
<h2><font color="red">S</font><font color="green">O</font><font color="blue">L</font><font color="pink">I</font><font color="orange">D</font> principles</h2>
<div style="text-align: left">
<ul>
<li>Term originating from 2000's</li>
<li>Some ideas date back to 80's</li>
<li>Typically applied to <strong>OO</strong> programming</li>
<li>Very common in <strong>Java</strong> and <strong>C#</strong></li>
<li>Can be applied to other languages & methodologies</li>
<li>Not really principles - more guidelines & philosophy</li>
</ul>
</div>
</div>
</section>
<!-- Motivation Slide -->
<section id="motivation-slide">
<div class="ukaea">
<p><font color="red">Why bother?</font> - Computers only care about bytes!</p>
<!-- <div style="text-align: left"> -->
<ul>
<li><font color="blue">Humans</font> develop code, not machines (yet)</li>
<li><font color="blue">Humans</font> work with other humans to develop code</li>
<li><font color="blue">Humans</font> need to understand other humans' code</li>
<li><font color="blue">Humans</font> writing code cost money</li>
</ul>
</div>
</section>
<!-- Motivation Slide -->
<section id="motivation2-slide">
<div class="ukaea">
<img data-src="./assets/change.jpg" height="120" width="300" align="middle" style="background:none; border:none; box-shadow:none;">
<p><font color="green">Changes</font> cause other <font color="red">changes</font></p>
<p>Cascade of <font color="green">changes</font> follow from one small <font color="red">change</font></p>
<p>You didn't plan for your application to <font color="green">change</font> like this</p>
<br />
<p><font color="blue">Implementing one small change can break everything and be very costly!</font></p>
</div>
</section>
<!-- Principles Slide -->
<section id="motivation2-slide">
<div class="ukaea">
<div style="text-align: left">
<ul style="list-style-type:none;font-size:54px;">
<li><font color="green">S</font>  - Single responsibility</li>
<li><font color="green">O</font> - Open-Closed</li>
<li><font color="green">L</font>  - Liskov substitution</li>
<li><font color="green">I</font>   - Interface segregation</li>
<li><font color="green">D</font> - Dependency inversion</li>
</ul>
</div>
<br />
<!-- <img data-src="./assets/solid.jpg" height="200" width="200" align="middle" style="background:none; border:1px solid black; box-shadow:none;"> -->
<p>Learn by example...</p>
</div>
</section>
<!-- Notes Slide -->
<section id="notes-slide">
<div class="ukaea">
<p>I will use <font color="green"><strong>C++</strong></font> examples, but it can be applied to other languages</p>
<p>I will use <font color="blue"><strong>I</strong></font> to denote an interface (pure abstract class) for names</p>
<p>All examples in depth (along with these slides) are available at my <a href="https://github.com/thomasms/solid_talk">GitHub</a></p>
</div>
</section>
<!-- S is for ... -->
<section id="s-slide">
<section data-state="headerS">
<style>.headerS header:after { content: "S = Single responsibility"; }</style>
<div class="ukaea">
<p>A class should do <strong>one</strong> thing</p>
<p>It should have only <strong>one reason</strong> to change</p>
</div>
<img data-src="./assets/one.jpg" height="300" width="200" align="middle" style="background:none; border:1px solid black; box-shadow:none;">
</section>
<section data-state="headerS2">
<style>.headerS2 header:after { content: "S"; }</style>
<div class="ukaea">
<p><font color="red">Don't do this</font></p>
<div style="text-align: center">
<pre><code class="cpp" data-trim data-noescape contenteditable>struct MyBadClass{
double calculateTheta(){
// complex calculation
return theta;
}
void toFile(std::string filename) const{
// formatting here
}
void plot() const{
// plotting
}
// ...
};</code></pre>
</div>
</div>
</section>
<section data-state="headerS2">
<div class="ukaea">
<p><strong>Why is this bad?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>Before, we had an object responsible for <font color="blue">logic</font>,
<font color="red">formatting</font>, <font color="green">serialization</font> and
<font color="orange">visualisation</font> </p>
<p>If we wanted to change the file format, we must change the class, even though the logic remains the same</p>
<p>Forces others to adopt changes, can cause merge conflicts, dependency issues, ...</p>
<p>How do you <font color="green">test</font> <code class="cpp" data-trim data-noescape>MyBadClass</code>?</p>
</div>
</div>
</section>
<section data-state="headerS2">
<div class="ukaea">
<p><font color="green">This is better</font></p>
<div style="text-align: center">
<pre><code class="cpp" data-trim data-noescape contenteditable>struct MyBetterClass{
double calculateTheta(){
// complex calculation
return theta;
}
// other theta related stuff
};</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>// read and write operators
istream& operator>>(istream& is, MyBetterClass& myclass);
ostream& operator<<(ostream& os, const MyBetterClass& myclass);</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>// create a separate plotter object
struct MyBetterClassPlotter{
void operator()(const MyBetterClass& myclass) const{
// do plot
}
};</code></pre>
</div>
</div>
</section>
</section>
<!-- O is for ... -->
<section id="o-slide">
<section data-state="headerO">
<style>.headerO header:after { content: "O = Open/Closed"; }</style>
<div class="ukaea">
<p>A class should be <strong>open</strong> for <strong>extension</strong>, but <strong>closed</strong> for <strong>modification</strong></p>
</div>
<img data-src="./assets/open.jpg" height="200" width="300" align="middle" style="background:none; border:1px solid black; box-shadow:none;">
<img data-src="./assets/closed.jpg" height="200" width="300" align="middle" style="background:none; border:1px solid black; box-shadow:none;">
<p>Abstraction is key!</p>
</section>
<section data-state="headerO2">
<style>.headerO2 header:after { content: "O"; }</style>
<div class="ukaea">
<p><font color="red">Don't do this</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>void process(const std::vector< OptionEnum >& options,
const MyPlasmaObject& obj){
for(auto option: options){
switch(option){
case DO_PLASMA_INIT:
obj.plasma_init();
// ...
case DO_PLASMA_COMPUTE:
// ...
case DO_PLASMA_READ_FROM_FILE:
// ...
case DO_PLASMA_WRITE_TO_FILE:
//..
case DO_PLASMA_END:
// ..
}
}
}</code></pre>
</div>
</div>
</section>
<section data-state="headerO2">
<div class="ukaea">
<p><strong>Why is this bad?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>If we want to add another process, we needed to add another enum and switch statement to the <code>process</code> function</p>
<p>Before we know it we have 50+ switch statements, with 50+ enums!</p>
<p>Again, how do you <font color="green">test</font> it?</p>
<p>Here <code>process</code> is not closed for modification and not open for extension</p>
</div>
</div>
</section>
<section data-state="headerO2">
<style>.headerO2 header:after { content: "O"; }</style>
<div class="ukaea">
<p><font color="green">This is better</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>struct INonConstProcess{ // abstract base class
virtual void go() = 0;
};
struct PlasmaComputeProcess : public INonConstProcess{
PlasmaComputeProcess(MyPlasmaObject& obj) : _obj(obj) {}
virtual void go() {
// logic here
}
};</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>struct ProcessManager{
void add(const std::shared_ptr< INonConstProcess >& process){
_processes.push_back(process);
}
void run() const{
for(auto& process: _processes)
process->go();
}
private:
std::vector< std::shared_ptr< INonConstProcess > > _processes;
};</code></pre>
</div>
</div>
</section>
<section data-state="headerO2">
<div class="ukaea">
<p><strong>Why is this better?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>We've now made a <code>ProcessManager</code> to handle looping over all processes</p>
<p>Code is more modular and easier to understand</p>
<p>Now <code>ProcessManager</code> is closed for modification and is open for extension - just add a new process via <code>add</code></p>
<p>No switch statement or any enums, just types</p>
<p>Very easy to mock to test logic</p>
</div>
</div>
</section>
<section data-state="headerO2">
<div class="ukaea">
<p><strong>Mocking is now easy</strong></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>struct MockPlasmaComputeProcess : public INonConstProcess{
virtual void go() {
std::cout << "Hello from mock!";
// or asserts for testing library
}
};
ProcessManager manager;
manager.add(std::make_shared< MockPlasmaComputeProcess >());
manager.run();
</code></pre>
</div>
</div>
</section>
</section>
<!-- L is for ... -->
<section id="l-slide" ">
<section data-state="headerL">
<style>.headerL header:after { content: "L = Liskov substitution"; }</style>
<p>If <strong>S</strong> is a subtype of <strong>T</strong>, then objects of type <strong>T</strong> may be replaced with objects of type <strong>S</strong> without altering the correctness (no side effects) of the program</p>
<img data-src="./assets/liskov.jpg" height="180" width="200" align="middle" style="background:none; border:none; box-shadow:none;">
<!-- <p>What does that even mean?</p> -->
<p style="font-size:22px;"><strong>is-a</strong> or <strong>has-a</strong> relationship</p>
</section>
<section data-state="headerL2">
<style>.headerL2 header:after { content: "L"; }</style>
<div class="ukaea">
<p><font color="red">Don't do this</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>struct Plot{
virtual void setXLabel(std::string label){
_xlabel = label;
}
virtual void setYLabel(std::string label){
_ylabel = label;
}
// getters + other stuff + member vars
}</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>struct NormalisedHistogramPlot : public Plot{
NormalisedHistogramPlot() : _ylabel("counts") {}
virtual void setYLabel(std::string label) override{
// problem: Throws exception
// since normalised histogram y label (in this case)
// has a fixed ylabel
throw std::runtime_error(
"NormalisedHistogramPlot::setYLabel - Should not be called!");
}
}</code></pre>
</div>
</div>
</section>
<section data-state="headerL2">
<style>.headerL2 header:after { content: "L"; }</style>
<div class="ukaea">
<p><font color="red">At call site</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// a silly test for demonstration purposes only
void testPlot(std::shared_ptr< Plot >& plot,
std::string property)
{
plot->setXLabel("Energy (eV)");
// this will throw an exception for NormalisedHistogramPlot
plot->setYLabel(property);
assert(plot->getXLabel() == "Energy (eV)");
assert(plot->getYLabel() == property);
}
</code></pre>
</div>
</div>
</section>
<section data-state="headerL2">
<style>.headerL2 header:after { content: "L"; }</style>
<div class="ukaea">
<p><strong>Why is this bad?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>Fundamental architecture problem</p>
<p><code>NormalisedHistogramPlot</code> is not a <code>Plot</code></p>
<p>Not a <strong>is-a</strong> relationship</p>
<p>It is a <strong>has-a</strong> relationship - use composition</p>
<p>Better to rethink your object relationships and architecture</p>
</div>
</div>
</section>
</section>
<!-- I is for ... -->
<section id="i-slide">
<section data-state="headerI">
<style>.headerI header:after { content: "I = Interface segregation"; }</style>
<p>No client should be forced to depend on methods it does not use or need</p>
<img data-src="./assets/complex.jpg" height="200" width="300" align="middle" style="background:none; border:1px solid black; box-shadow:none;">
<p>Favour smaller, concise interfaces over larger interfaces</p>
</section>
<section data-state="headerI2">
<style>.headerI2 header:after { content: "I"; }</style>
<div class="ukaea">
<p><font color="red">Don't do this</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// very abstract interface
struct IEverything{
virtual void validate() const = 0;
virtual void reset() = 0;
virtual int operator()() const = 0;
virtual void operator()(int value) = 0;
virtual operator bool() const = 0;
// many others
};
</code></pre>
</div>
</div>
</section>
<section data-state="headerI2">
<style>.headerI2 header:after { content: "I"; }</style>
<div class="ukaea">
<p><strong>Why is this bad?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>We should look at the single responsibility principle again</p>
<p>And the Liskov substitution principle</p>
<p>What if we want to build something that can be reset but not validated?</p>
<p>Again, testing is difficult - we must implement every method</p>
</div>
</div>
</section>
<section data-state="headerI2">
<style>.headerI2 header:after { content: "I"; }</style>
<div class="ukaea">
<p><font color="green">This is better</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// beware the 'ible's
struct IResetible{
virtual void reset() = 0;
};
struct IConstValidatible{
virtual void validate() const = 0;
};
struct ISimpleAccess{
virtual int operator()() const = 0;
virtual void operator()(int value) = 0;
virtual operator bool() const = 0;
};
</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>// multiple inheritance for interfaces
struct NoCheatGuesser : public IConstValidatible,
public ISimpleAccess // no IResetible to avoid resetting guess count
{
//...
}
</code></pre>
</div>
</div>
</section>
</section>
<!-- D is for ... -->
<!-- D.I is not dependency injection it is inversion -->
<section id="d-slide">
<section data-state="headerD">
<style>.headerD header:after { content: "D = Dependency inversion"; }</style>
<br />
<p style="font-size: 24px;">*Inversion, not injection.</p>
<p>Depend on <strong>abstractions</strong> (interfaces) not <strong>concretions</strong> (implementation)</p>
<p>High level modules should not depend on low level modules</p>
<img data-src="./assets/plug.jpg" height="180" width="285" align="middle" style="background:none; border:1px solid black; box-shadow:none;">
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div style="text-align: left;margin-left:30px; font-size: 34px">
<p>This does not just mean <i>abstracting</i> our implementation (creating an interface)</p>
<p>The interface <font color="blue">'owns'</font> the implementation, not the other way around</p>
<p>If <strong>A</strong> depends on <strong>B</strong>, we don't want the changes in <strong>B</strong> to affect <strong>A</strong></p>
<p><strong>A</strong> should dictate the interface for <strong>B</strong> to conform to</p>
<p>Define in terms of <strong>A</strong>'s needs, not <strong>B</strong>'s behaviour</p>
</div>
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div class="ukaea">
<p><font color="red">Don't do this</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// our class depends on the implementation of VerySimpleLogger
struct MyCoolClass{
void method1(){
_logger.addMessage("Called method1!");
//other stuff
}
// more stuff ...
private:
// to change this logger to another i.e. BetterLogger
// from external library would cause
// us to change the implementation in this class
VerySimpleLogger _logger;
}; </code></pre>
</div>
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div class="ukaea">
<p><strong>Why is this bad?</strong></p>
<div style="text-align: left;margin-left:30px">
<p>We are strongly <font color="red"><i>coupled</i></font> to implementation of <code>VerySimpleLogger</code></p>
<p>We therefore break Open/Closed principle</p>
<p>What if we want to change our logging library to something better?</p>
<p>Did I mention testing?</p>
</div>
</div>
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div class="ukaea">
<p><font color="green">This is better</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// remember the I - only provide an interface for what you need
// we dictate the interface we need,
// we invert the dependency
// by depending on the interface,
// not the specific implementation of a logger
struct ISimpleLogger{
virtual void append(std::string message) = 0;
virtual size_t size() const = 0;
virtual std::string get(int index) const = 0;
virtual operator bool() const = 0;
};</code></pre>
</div>
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div class="ukaea">
<p><font color="green">This is better</font></p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>// Wraps the simple logger
class SimpleLoggerAdapter : public ISimpleLogger{
VerySimpleLogger _logger;
// ...
};
// wraps the another logger
struct AnotherLoggerAdapter : public ISimpleLogger{
// ...
};</code></pre>
<pre><code class="cpp" data-trim data-noescape contenteditable>// our class depends on the interface we dictated
struct MyCoolClass{
// create the class using construction injection
MyCoolClass(ISimpleLogger& logger) : _logger(logger) {}
// ...
private:
// this is now an interface
// set by our code not the external library
ISimpleLogger& _logger;
};</code></pre>
</div>
</section>
<section data-state="headerD2">
<style>.headerD2 header:after { content: "D"; }</style>
<div class="ukaea">
<p>Now at the call site it is clear</p>
<div style="text-align: center;">
<pre><code class="cpp" data-trim data-noescape contenteditable>{
// we can easily replace the logger now
SimpleLoggerAdapter logger;
// AnotherLoggerAdapter logger;
// MockNoErrorLogger logger;
// class that depends on logger
MyCoolClass cc(logger);
// has error?
if(logger){
// ...
}
}</code></pre>
</div>
</section>
</section>
<!-- Finish D by example - DB connection is a good one -->
<!-- Summary Slide -->
<section id="summary-slide">
<div class="ukaea">
<h2>Summary</h2>
<div style="text-align: left;margin-left:-30px">
<p><font color="blue">Think before you write</font></p>
<ul>
<li><strong>SOLID</strong> is a guideline for writing good, maintainable code</li>
<li><strong>SOLID</strong> can be applied to OO - Java, C#. Even C++, Fortran and Python</li>
<li><strong>SOLID</strong> code can make development easier in the long run!</li>
</ul>
</div>
<p>Full example code for each S-O-L-I-D and these slides available at <a href="https://github.com/thomasms/solid_talk">https://github.com/thomasms/solid_talk</a></p>
</div>
</section>
<!-- Resources Slide -->
<section id="resources-slide">
<div class="ukaea">
<h2>Resources</h2>
<div style="text-align: left;margin-left:30px">
<ul>
<li><a href="https://lostechies.com/derickbailey/2011/09/22/dependency-injection-is-not-the-same-as-the-dependency-inversion-principle/">lostechies</a></li>
<li><a href="http://aspiringcraftsman.com/2008/12/28/examining-dependency-inversion/">aspiringcraftsman</a></li>
<li><a href="https://en.wikipedia.org/wiki/SOLID">Wiki</a></li>
<li><a href="https://martinfowler.com/articles/dipInTheWild.html">martinfowler</a></li>
<li><a href="https://www.tomdalling.com/blog/software-design/solid-class-design-the-open-closed-principle/">tomdalling</a></li>
</ul>
</div>
</div>
</section>
</div> <!-- End slides -->
</div> <!-- End reveal -->
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<script>
// Configuration for Reveal
Reveal.initialize({
// Display presentation control arrows
controls: true,
// Help the user learn the controls by providing hints, for example by
// bouncing the down arrow when they first encounter a vertical slide
controlsTutorial: true,
// Determines where controls appear, "edges" or "bottom-right"
controlsLayout: 'bottom-right',
// Visibility rule for backwards navigation arrows; "faded", "hidden"
// or "visible"
controlsBackArrows: 'faded',
// Display a presentation progress bar
progress: true,
// Set default timing of 2 minutes per slide
defaultTiming: 120,
// Display the page number of the current slide
slideNumber: 'c/t',
// Push each slide change to the browser history
history: false,
// Enable keyboard shortcuts for navigation
keyboard: true,
// Enable the slide overview mode
overview: true,
// Vertical centering of slides
center: true,
// Enables touch navigation on devices with touch input
touch: true,
// Loop the presentation
loop: false,
// Change the presentation direction to be RTL
rtl: false,
// Randomizes the order of slides each time the presentation loads
shuffle: false,
// Turns fragments on and off globally
fragments: true,
// Flags if the presentation is running in an embedded mode,
// i.e. contained within a limited portion of the screen
embedded: false,
// Flags if we should show a help overlay when the questionmark
// key is pressed
help: true,
// Flags if speaker notes should be visible to all viewers
showNotes: false,
// Global override for autoplaying embedded media (video/audio/iframe)
// - null: Media will only autoplay if data-autoplay is present
// - true: All media will autoplay, regardless of individual setting
// - false: No media will autoplay, regardless of individual setting
autoPlayMedia: null,
// Number of milliseconds between automatically proceeding to the
// next slide, disabled when set to 0, this value can be overwritten
// by using a data-autoslide attribute on your slides
autoSlide: 0,
// Stop auto-sliding after user input
autoSlideStoppable: true,
// Use this method for navigation when auto-sliding
autoSlideMethod: Reveal.navigateNext,
// Enable slide navigation via mouse wheel
mouseWheel: false,
// Hides the address bar on mobile devices
hideAddressBar: true,
// Opens links in an iframe preview overlay
// Add `data-preview-link` and `data-preview-link="false"` to customise each link
// individually
previewLinks: false,
// Transition style
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Transition speed
transitionSpeed: 'default', // default/fast/slow
// Transition style for full page slide backgrounds
backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom
// Number of slides away from the current that are visible
viewDistance: 3,
// Parallax background image
parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
// Parallax background size
parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px"
// Number of pixels to move the parallax background per slide
// - Calculated automatically unless specified
// - Set to 0 to disable movement along an axis
parallaxBackgroundHorizontal: null,
parallaxBackgroundVertical: null,
// The display mode that will be used to show slides
display: 'block',
math: {
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html
},
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/math/math.js', async: true }
]
});
</script>
</body>
</html>