├── .gitignore
├── README.adoc
├── images
├── 3d-modeling.png
├── banner.graffle
│ ├── data.plist
│ ├── image1.jpg
│ ├── image3.png
│ └── preview.jpeg
├── banner.png
└── reklame.png
└── sessions
├── csharp_01
├── images
│ ├── android.png
│ ├── azure.png
│ ├── cpp.png
│ ├── csharp.png
│ ├── curriculum-bg.jpg
│ ├── devops.png
│ ├── dotnet-introduction-bg.jpg
│ ├── fsharp.png
│ ├── hello-world.png
│ ├── ios.png
│ ├── ironpython.png
│ ├── linux.png
│ ├── macos.png
│ ├── portrait.jpg
│ ├── powershell.png
│ ├── red-green-refactor.png
│ ├── rpi.png
│ ├── shared-branches-bad.png
│ ├── test-driven-development.jpg
│ ├── thank-you-bg.jpg
│ ├── tizen.png
│ ├── trunk-based-development-good.png
│ ├── trunk-based-development.jpg
│ ├── visual-basic.png
│ └── windows.png
├── slides.html
└── slides.md
├── csharp_02
├── images
│ ├── core.jpg
│ ├── generic-cola.jpg
│ ├── grain.jpg
│ ├── iterator.png
│ ├── monkey.jpg
│ ├── polymorphism-bg.jpg
│ ├── produce-bg.jpg
│ ├── robots.jpg
│ ├── system-collections-concurrent.png
│ ├── system-collections-generic-2.png
│ ├── system-collections-generic.png
│ ├── system-collections.png
│ ├── thank-you.jpg
│ └── traffic-lights.jpg
├── slides.html
└── slides.md
├── csharp_03
├── images
│ ├── belt.png
│ ├── core.jpg
│ ├── delegate.jpg
│ ├── extensions.jpg
│ ├── lambda.png
│ ├── questions.jpg
│ └── thank-you.jpg
├── slides.html
└── slides.md
├── csharp_04
├── images
│ ├── agenda.jpg
│ ├── applause.png
│ ├── azure-sql.png
│ ├── clean-architecture.png
│ ├── connection-meme.jpg
│ ├── database-popularity.png
│ ├── databases.png
│ ├── disposable.jpg
│ ├── entity-framework-core.jpg
│ ├── injection.jpg
│ ├── lock.jpg
│ ├── model.png
│ ├── onion.jpg
│ ├── orm.jpg
│ ├── package.jpg
│ ├── pyramids.jpg
│ └── skyscrapers.jpg
├── slides.html
└── slides.md
├── csharp_05
├── images
│ └── applause.png
├── slides.html
└── slides.md
├── csharp_06
├── images
│ ├── concurrency.jpg
│ ├── deadlock.jpg
│ ├── funko_pop_collection_by_needxxx_dazxmlc-fullview.jpg
│ ├── i-am-a-waiting.png
│ ├── main-worker-thread.png
│ ├── nails.jpg
│ ├── race-condition.png
│ ├── stack-heap.png
│ └── thread.jpg
├── slides.html
└── slides.md
├── csharp_07
├── images
│ ├── 418.png
│ ├── mvc-api.png
│ └── mvc.png
├── slides.html
└── slides.md
├── csharp_08
├── slides.html
└── slides.md
├── csharp_09
├── images
│ ├── angular.png
│ ├── react.png
│ ├── vue.png
│ └── webapps.jpg
├── slides.html
└── slides.md
├── csharp_10
├── images
│ ├── ali-farahnak.jpg
│ ├── button.png
│ └── rip.gif
├── slides.html
└── slides.md
├── csharp_11
├── images
│ ├── app-registration-account-types.png
│ ├── azure-ad-b2c-identity-providers.png
│ ├── binary.jpg
│ ├── black-board.jpg
│ ├── container.jpg
│ ├── lab.gif
│ ├── ladle.jpg
│ ├── padlock.gif
│ └── question.jpg
├── slides.html
└── slides.md
├── csharp_12
├── images
│ ├── applause.jpg
│ ├── book.gif
│ └── questions.png
├── slides.html
└── slides.md
├── q_and_a
├── Slides.html
└── Slides.md
├── swe_00
└── README.md
├── swe_01
├── Slides.html
├── Slides.md
├── images
│ ├── coronapas_app_arkitektur.png
│ ├── coronapas_app_arkitektur2.png
│ ├── first_names.png
│ └── grades.html
└── menti_results.pdf
├── swe_02
├── Slides.html
├── Slides.md
└── images
│ ├── analysis.png
│ ├── architecture.png
│ ├── coronapas_app_arkitektur.png
│ ├── design.png
│ └── knowledge_maps.png
├── swe_03
├── Slides.html
├── Slides.md
├── images
│ ├── kombit_sapa_krav_148_quiz.png
│ ├── kombit_sapa_krav_163_quiz.png
│ ├── kombit_sapa_krav_166_quiz.png
│ ├── kombit_sapa_krav_180_quiz.png
│ ├── kombit_sapa_krav_190_quiz.png
│ ├── kombit_sapa_krav_191_quiz.png
│ ├── kombit_sapa_krav_1_quiz.png
│ ├── kombit_sapa_krav_216_quiz.png
│ ├── kombit_sapa_krav_67_quiz.png
│ ├── kombit_sapa_use_case.png
│ ├── kombit_sapa_use_case_01.png
│ ├── kombit_sapa_use_case_02.png
│ ├── kombit_sapa_use_case_diagram.png
│ ├── kombit_sapa_use_case_diagram2.png
│ ├── kombit_sapa_vision.png
│ ├── re_process.png
│ ├── se_nonfunc.png
│ └── use_case_diagram_se.png
└── material
│ ├── Kravspecifikation juli 2014 v. 1.0.docx
│ └── Kravspecifikation juli 2014 v. 1.0.pdf
├── swe_04
├── Slides.html
├── Slides.md
└── images
│ ├── Sommerville_activity_diagram.png
│ ├── martin_bubble_sort.png
│ ├── martin_class_diag.png
│ ├── martin_class_diag2.png
│ ├── martin_class_diag3.png
│ ├── martin_collab_diag.png
│ ├── martin_collab_diag2.png
│ ├── martin_sequence_diag.png
│ └── martin_state_diag.png
├── swe_05
├── Slides.html
├── Slides.md
└── images
│ ├── dip_uml_diag.png
│ ├── dip_uml_diag.xmi
│ ├── lsp_uml_diag.png
│ ├── lsp_uml_diag.xmi
│ ├── martin_bubble_sort.png
│ ├── martin_class_diag.png
│ ├── martin_class_diag2.png
│ ├── martin_class_diag3.png
│ ├── martin_collab_diag.png
│ ├── martin_isp.png
│ ├── martin_srp_code.png
│ ├── martin_srp_diag.png
│ ├── ousterhout_complexity.png
│ ├── upsource-CR5-OCP-remove-if.png
│ ├── upsource-CR5-OCP-remove-if1.png
│ └── upsource-CR5-OCP3.png
├── swe_06
├── Slides.html
├── Slides.md
└── images
│ ├── Quiz.graffle
│ ├── alexander_square.png
│ ├── alexander_transport.png
│ ├── alexander_transport_areas.png
│ ├── dp_paper.png
│ ├── facade.png
│ ├── gof_command1.png
│ ├── gof_command2.png
│ ├── gof_observer.png
│ ├── gof_observer_case.png
│ ├── larman_observer.png
│ ├── mediator.png
│ ├── mediator_case.png
│ ├── observer_dotnet.png
│ ├── singleton.png
│ └── strategy.png
├── swe_07
├── Slides.html
├── Slides.md
├── images
│ ├── coronapas_app_arkitektur.png
│ ├── kombit_sapa_vision.png
│ ├── kruchten_4plus1.png
│ ├── se_arch.png
│ ├── se_client_server_pattern.png
│ ├── se_client_server_pattern_fatness.png
│ ├── se_component.png
│ ├── se_design_decisions.png
│ ├── se_distr_comp_arch.png
│ ├── se_distr_comp_arch2.png
│ ├── se_layered_pattern.png
│ ├── se_mvc_pattern.png
│ ├── se_mvc_pattern_instance.png
│ ├── se_p2p_pattern.png
│ ├── se_p2p_pattern2.png
│ ├── se_pipes_filters_pattern.png
│ └── se_repo_pattern.png
└── plot.py
├── swe_08
├── Slides.html
├── Slides.md
├── bdsa_greeter
│ ├── csharp
│ │ ├── Program.cs
│ │ ├── csharp.csproj
│ │ └── dist
│ │ │ ├── linux
│ │ │ ├── .gitkeep
│ │ │ ├── nosc
│ │ │ │ └── .gitkeep
│ │ │ ├── sc
│ │ │ │ └── .gitkeep
│ │ │ ├── sf-nosc
│ │ │ │ └── .gitkeep
│ │ │ └── sf-sc
│ │ │ │ └── .gitkeep
│ │ │ ├── macos
│ │ │ └── .gitkeep
│ │ │ └── windows
│ │ │ └── .gitkeep
│ ├── fpc
│ │ └── hello.pas
│ ├── go
│ │ ├── bdsa_greeter.go
│ │ └── dist
│ │ │ └── .gitkeep
│ └── python
│ │ ├── bdsa_greeter
│ │ └── cli.py
│ │ ├── dist
│ │ └── .gitkeep
│ │ ├── poetry.lock
│ │ └── pyproject.toml
├── hello.dll
└── hello.zip
├── swe_09
├── Slides.html
├── Slides.md
└── images
│ ├── ISO_25000_internal_qual.png
│ ├── SE_TDD.png
│ ├── SE_test_process.png
│ ├── google_test_antipatterns.png
│ ├── google_test_shares.png
│ └── google_test_sizes.png
├── swe_10
├── Slides.html
├── Slides.md
└── images
│ ├── FSA_arch_characteristics.png
│ ├── FSA_overview.png
│ ├── ISO_25000.png
│ ├── ISO_25010_in_use.png
│ ├── ISO_25010_product.png
│ ├── ISO_25023.png
│ ├── boehm.png
│ ├── boehm_metrics.png
│ ├── se_metrics.png
│ ├── se_oo_metrics.png
│ ├── se_qual_attributes.png
│ └── se_quality_to_metrics.png
├── swe_11
├── Slides.html
├── Slides.md
└── images
│ ├── abstractness.png
│ ├── ai_plot.png
│ ├── breaking_cycle_input.png
│ ├── cycle_dep.png
│ ├── deps.png
│ ├── gitinsight_components.png
│ ├── graph.svg
│ ├── instability.png
│ ├── pino_npm.png
│ └── vcpkg_gephi.png
├── swe_12
├── Slides.html
├── Slides.md
├── images
│ ├── agilemanifesto.png
│ ├── helena_paper.png
│ ├── royce_waterfall_model1.png
│ ├── royce_waterfall_model2.png
│ ├── royce_waterfall_model3.png
│ ├── royce_waterfall_model4.png
│ ├── se_agile_principles.png
│ ├── se_extreme_cycle.png
│ ├── se_extreme_practices.png
│ ├── se_iterative.png
│ ├── se_iterative_dev.png
│ ├── se_userstory.png
│ ├── se_waterfall_model.png
│ ├── statens_it_model.png
│ └── statens_it_model2.png
└── project_demo.md
├── the_gilded_rose
├── images
│ └── gilded-rose.jpg
├── slides.html
└── slides.md
└── the_gilded_rose_recap
├── images
└── gilded-rose.jpg
├── slides.html
└── slides.md
/.gitignore:
--------------------------------------------------------------------------------
1 | [Ss]lides.pdf
2 |
3 | ## Ignore Visual Studio temporary files, build results, and
4 | ## files generated by popular Visual Studio add-ons.
5 | ##
6 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
7 |
8 | # User-specific files
9 | *.rsuser
10 | *.suo
11 | *.user
12 | *.userosscache
13 | *.sln.docstates
14 |
15 | # User-specific files (MonoDevelop/Xamarin Studio)
16 | *.userprefs
17 |
18 | # Mono auto generated files
19 | mono_crash.*
20 |
21 | # Build results
22 | [Dd]ebug/
23 | [Dd]ebugPublic/
24 | [Rr]elease/
25 | [Rr]eleases/
26 | x64/
27 | x86/
28 | [Aa][Rr][Mm]/
29 | [Aa][Rr][Mm]64/
30 | bld/
31 | [Bb]in/
32 | [Oo]bj/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # StyleCop
67 | StyleCopReport.xml
68 |
69 | # Files built by Visual Studio
70 | *_i.c
71 | *_p.c
72 | *_h.h
73 | *.ilk
74 | *.meta
75 | *.obj
76 | *.iobj
77 | *.pch
78 | *.pdb
79 | *.ipdb
80 | *.pgc
81 | *.pgd
82 | *.rsp
83 | *.sbr
84 | *.tlb
85 | *.tli
86 | *.tlh
87 | *.tmp
88 | *.tmp_proj
89 | *_wpftmp.csproj
90 | *.log
91 | *.vspscc
92 | *.vssscc
93 | .builds
94 | *.pidb
95 | *.svclog
96 | *.scc
97 |
98 | # Chutzpah Test files
99 | _Chutzpah*
100 |
101 | # Visual C++ cache files
102 | ipch/
103 | *.aps
104 | *.ncb
105 | *.opendb
106 | *.opensdf
107 | *.sdf
108 | *.cachefile
109 | *.VC.db
110 | *.VC.VC.opendb
111 |
112 | # Visual Studio profiler
113 | *.psess
114 | *.vsp
115 | *.vspx
116 | *.sap
117 |
118 | # Visual Studio Trace Files
119 | *.e2e
120 |
121 | # TFS 2012 Local Workspace
122 | $tf/
123 |
124 | # Guidance Automation Toolkit
125 | *.gpState
126 |
127 | # ReSharper is a .NET coding add-in
128 | _ReSharper*/
129 | *.[Rr]e[Ss]harper
130 | *.DotSettings.user
131 |
132 | # TeamCity is a build add-in
133 | _TeamCity*
134 |
135 | # DotCover is a Code Coverage Tool
136 | *.dotCover
137 |
138 | # AxoCover is a Code Coverage Tool
139 | .axoCover/*
140 | !.axoCover/settings.json
141 |
142 | # Visual Studio code coverage results
143 | *.coverage
144 | *.coveragexml
145 |
146 | # NCrunch
147 | _NCrunch_*
148 | .*crunch*.local.xml
149 | nCrunchTemp_*
150 |
151 | # MightyMoose
152 | *.mm.*
153 | AutoTest.Net/
154 |
155 | # Web workbench (sass)
156 | .sass-cache/
157 |
158 | # Installshield output folder
159 | [Ee]xpress/
160 |
161 | # DocProject is a documentation generator add-in
162 | DocProject/buildhelp/
163 | DocProject/Help/*.HxT
164 | DocProject/Help/*.HxC
165 | DocProject/Help/*.hhc
166 | DocProject/Help/*.hhk
167 | DocProject/Help/*.hhp
168 | DocProject/Help/Html2
169 | DocProject/Help/html
170 |
171 | # Click-Once directory
172 | publish/
173 |
174 | # Publish Web Output
175 | *.[Pp]ublish.xml
176 | *.azurePubxml
177 | # Note: Comment the next line if you want to checkin your web deploy settings,
178 | # but database connection strings (with potential passwords) will be unencrypted
179 | *.pubxml
180 | *.publishproj
181 |
182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
183 | # checkin your Azure Web App publish settings, but sensitive information contained
184 | # in these scripts will be unencrypted
185 | PublishScripts/
186 |
187 | # NuGet Packages
188 | *.nupkg
189 | # NuGet Symbol Packages
190 | *.snupkg
191 | # The packages folder can be ignored because of Package Restore
192 | **/[Pp]ackages/*
193 | # except build/, which is used as an MSBuild target.
194 | !**/[Pp]ackages/build/
195 | # Uncomment if necessary however generally it will be regenerated when needed
196 | #!**/[Pp]ackages/repositories.config
197 | # NuGet v3's project.json files produces more ignorable files
198 | *.nuget.props
199 | *.nuget.targets
200 |
201 | # Microsoft Azure Build Output
202 | csx/
203 | *.build.csdef
204 |
205 | # Microsoft Azure Emulator
206 | ecf/
207 | rcf/
208 |
209 | # Windows Store app package directories and files
210 | AppPackages/
211 | BundleArtifacts/
212 | Package.StoreAssociation.xml
213 | _pkginfo.txt
214 | *.appx
215 | *.appxbundle
216 | *.appxupload
217 |
218 | # Visual Studio cache files
219 | # files ending in .cache can be ignored
220 | *.[Cc]ache
221 | # but keep track of directories ending in .cache
222 | !?*.[Cc]ache/
223 |
224 | # Others
225 | ClientBin/
226 | ~$*
227 | *~
228 | *.dbmdl
229 | *.dbproj.schemaview
230 | *.jfm
231 | *.pfx
232 | *.publishsettings
233 | orleans.codegen.cs
234 |
235 | # Including strong name files can present a security risk
236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
237 | #*.snk
238 |
239 | # Since there are multiple workflows, uncomment next line to ignore bower_components
240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
241 | #bower_components/
242 |
243 | # RIA/Silverlight projects
244 | Generated_Code/
245 |
246 | # Backup & report files from converting an old project file
247 | # to a newer Visual Studio version. Backup files are not needed,
248 | # because we have git ;-)
249 | _UpgradeReport_Files/
250 | Backup*/
251 | UpgradeLog*.XML
252 | UpgradeLog*.htm
253 | ServiceFabricBackup/
254 | *.rptproj.bak
255 |
256 | # SQL Server files
257 | *.mdf
258 | *.ldf
259 | *.ndf
260 |
261 | # Business Intelligence projects
262 | *.rdl.data
263 | *.bim.layout
264 | *.bim_*.settings
265 | *.rptproj.rsuser
266 | *- [Bb]ackup.rdl
267 | *- [Bb]ackup ([0-9]).rdl
268 | *- [Bb]ackup ([0-9][0-9]).rdl
269 |
270 | # Microsoft Fakes
271 | FakesAssemblies/
272 |
273 | # GhostDoc plugin setting file
274 | *.GhostDoc.xml
275 |
276 | # Node.js Tools for Visual Studio
277 | .ntvs_analysis.dat
278 | node_modules/
279 |
280 | # Visual Studio 6 build log
281 | *.plg
282 |
283 | # Visual Studio 6 workspace options file
284 | *.opt
285 |
286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
287 | *.vbw
288 |
289 | # Visual Studio LightSwitch build output
290 | **/*.HTMLClient/GeneratedArtifacts
291 | **/*.DesktopClient/GeneratedArtifacts
292 | **/*.DesktopClient/ModelManifest.xml
293 | **/*.Server/GeneratedArtifacts
294 | **/*.Server/ModelManifest.xml
295 | _Pvt_Extensions
296 |
297 | # Paket dependency manager
298 | .paket/paket.exe
299 | paket-files/
300 |
301 | # FAKE - F# Make
302 | .fake/
303 |
304 | # CodeRush personal settings
305 | .cr/personal
306 |
307 | # Python Tools for Visual Studio (PTVS)
308 | __pycache__/
309 | *.pyc
310 |
311 | # Cake - Uncomment if you are using it
312 | # tools/**
313 | # !tools/packages.config
314 |
315 | # Tabs Studio
316 | *.tss
317 |
318 | # Telerik's JustMock configuration file
319 | *.jmconfig
320 |
321 | # BizTalk build output
322 | *.btp.cs
323 | *.btm.cs
324 | *.odx.cs
325 | *.xsd.cs
326 |
327 | # OpenCover UI analysis results
328 | OpenCover/
329 |
330 | # Azure Stream Analytics local run output
331 | ASALocalRun/
332 |
333 | # MSBuild Binary and Structured Log
334 | *.binlog
335 |
336 | # NVidia Nsight GPU debugger configuration file
337 | *.nvuser
338 |
339 | # MFractors (Xamarin productivity tool) working folder
340 | .mfractor/
341 |
342 | # Local History for Visual Studio
343 | .localhistory/
344 |
345 | # BeatPulse healthcheck temp database
346 | healthchecksdb
347 |
348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
349 | MigrationBackup/
350 |
351 | # Ionide (cross platform F# VS Code tools) working folder
352 | .ionide/
353 |
354 | .DS_Store
355 | .vscode
356 | index.html
357 | misc/students/courseid_*_participants.csv
358 | README_LearnIT.html
359 | sessions/swe_*/Slides.pdf
360 |
361 | tmp/
362 | misc/communication/*.html
363 | README.html
364 |
--------------------------------------------------------------------------------
/images/3d-modeling.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/3d-modeling.png
--------------------------------------------------------------------------------
/images/banner.graffle/data.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/banner.graffle/data.plist
--------------------------------------------------------------------------------
/images/banner.graffle/image1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/banner.graffle/image1.jpg
--------------------------------------------------------------------------------
/images/banner.graffle/image3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/banner.graffle/image3.png
--------------------------------------------------------------------------------
/images/banner.graffle/preview.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/banner.graffle/preview.jpeg
--------------------------------------------------------------------------------
/images/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/banner.png
--------------------------------------------------------------------------------
/images/reklame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/images/reklame.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/android.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/azure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/azure.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/cpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/cpp.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/csharp.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/curriculum-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/curriculum-bg.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/devops.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/devops.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/dotnet-introduction-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/dotnet-introduction-bg.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/fsharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/fsharp.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/hello-world.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/hello-world.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/ios.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/ironpython.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/ironpython.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/linux.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/linux.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/macos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/macos.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/portrait.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/portrait.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/powershell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/powershell.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/red-green-refactor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/red-green-refactor.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/rpi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/rpi.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/shared-branches-bad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/shared-branches-bad.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/test-driven-development.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/test-driven-development.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/thank-you-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/thank-you-bg.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/tizen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/tizen.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/trunk-based-development-good.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/trunk-based-development-good.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/trunk-based-development.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/trunk-based-development.jpg
--------------------------------------------------------------------------------
/sessions/csharp_01/images/visual-basic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/visual-basic.png
--------------------------------------------------------------------------------
/sessions/csharp_01/images/windows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_01/images/windows.png
--------------------------------------------------------------------------------
/sessions/csharp_01/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 |
17 |
18 |
19 |
20 | # C♯ 01: Test Driven C♯
21 |
22 | 
23 |
24 | Rasmus Lystrøm
25 | Associate Professor
26 | ITU
27 |
28 |
29 |
30 | ---
31 |
32 | # About Me
33 |
34 | 
35 |
36 | Senior Cloud Solution Architect @ Microsoft
37 | Associate Professer @ ITU
38 | Captain/Battalion Chief of Staff @ Danish Army (Reserves)
39 |
40 | M[]().Sc. IT, ITU (2012)
41 | Thesis: *Forecalc – Developing a core spreadsheet implementation in F♯*
42 |
43 | Wife: Katrine
44 | Children: Lærke (4), Laura (7), and Alma (14)
45 | Origin: Aarhus
46 | Currently residing: Vanløse (Copenhagen)
47 |
48 | Live music and festivals (Copenhell, Brutal Assault, Hellfest, etc.)
49 | Cross-fit
50 |
51 | ---
52 |
53 | # Agenda
54 |
55 | - How to reach me
56 | - *Boring stuff*
57 | - Test-Driven Development
58 | - Trunk Based Development
59 | - Continuous Integration
60 | - Show and Tell
61 |
62 | ---
63 |
64 | # How to reach me
65 |
66 | Do not write me an email!
67 | Use Discord: the TAs or your fellow students might have the answer.
68 | You may tag me.
69 | You may DM me for personal questions.
70 |
71 | ---
72 |
73 | # Curriculum
74 |
75 | 
76 |
77 | Test-Driven C♯
78 | Generics
79 | Lambdas and Linq
80 | Data Access (ORM)
81 | Asynchronous and Parallel
82 | Web APIs
83 | Design Patterns
84 | Mobile and Desktop Apps
85 | Web apps
86 | Security
87 | Cloud
88 |
89 | Updated version cf.
90 |
91 | ---
92 |
93 | # C♯
94 |
95 | > "C♯ is intended to be a simple, modern, general-purpose, object-oriented programming language."
96 |
97 | ECMA-334 ISO/IEC 23270:2018(E)
98 | C♯ language specification, 5th edition, December 2017
99 |
100 | ---
101 |
102 | # Why C♯
103 |
104 | - Popular cf. [Stack Overflow Annual Developer Survey 2022](https://survey.stackoverflow.co/2022/)
105 | - Ubiquitous
106 | - Open Source
107 | - Cross-platform
108 | - Industry / Enterprise
109 | - Tool for your toolbox
110 | - IRON
111 | - .NET CLR
112 |
113 | ---
114 |
115 | # Why not C♯
116 |
117 | ## It's just like Java
118 |
119 | - Curly brackets and semicolons from C
120 | - Statically typed
121 | - Object-oriented
122 | - Single inheritance
123 | - Cross platform
124 | - Open source
125 | - Industry / enterprise
126 | - JVM
127 |
128 | ---
129 |
130 | # Enterprise
131 |
132 |
133 |
134 |
135 |
136 | ---
137 |
138 | # Build on what you know already
139 |
140 | - No basic stuff
141 | - Read the book
142 | - Do the exercises
143 | - Learn the advanced patterns and syntactic sugar
144 | - Idiomatic C♯
145 | - Focus on clean, testable code
146 | - Stop the enterprise madness!
147 |
148 | ---
149 |
150 | 
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | # .NET - a brief introduction
166 |
167 | ---
168 |
169 | # .NET
170 |
171 | > .NET is a free, cross-platform, open source developer platform for building many different types of applications.
172 |
173 | > With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, IoT, and more.
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 | # .NET Languages
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 | # .NET Platforms
226 |
227 | ---
228 |
229 | # .NET Timeline
230 |
231 | 2002: .NET, C♯, Visual Basic, Visual Studio .NET
232 | 2003: .NET 1.1, Visual Studio .NET 2003
233 | 2005: .NET 2.0, C♯ 2, F♯, Generics, VS2005
234 | 2007: .NET 3.5, C♯ 3, Auto-properties, Linq, Lambda, VS2008
235 | 2010: .NET 4.0, C♯ 4, F♯ 2, Dynamic, Parallel, VS2010
236 | 2012: .NET 4.5, C♯ 5, F♯ 3, Async/await, VS2012
237 | 2015: .NET 4.6, C♯ 6, F♯ 4, VS2015
238 | 2016: **.NET Core**, Open Source on GitHub!, Visual Studio Code
239 | 2017: .NET 4.7, **.NET Core 2**, C♯ 7, VS2017
240 | 2019: .NET 4.8, **.NET Core 3**, C♯ 8, VS2019
241 | 2020: **.NET 5**, C♯ 9, F♯ 5
242 | 2021: **.NET 6**, C♯ 10, F♯ 6
243 | 2022: **.NET 7**, C♯ 11, [.NET Conf 2022 8-10 November](https://www.dotnetconf.net/)
244 |
245 | ---
246 |
247 |
248 |
249 | 
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 | # Test-Driven Development
265 |
266 | ---
267 |
268 | # Test-Driven Development
269 |
270 | - What?
271 | - Why?
272 | - How?
273 |
274 | ---
275 |
276 |
277 |
278 | 
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 | # Red-Green-Refactor
295 |
296 | ---
297 |
298 | 
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 | # Trunk Based Development
314 |
315 | ---
316 |
317 | # Trunk Based Development - What?
318 |
319 | > A source-control branching model, where developers collaborate on code in a single branch called 'trunk'*), resist any pressure to create other long-lived development branches by employing documented techniques. They therefore avoid merge hell, do not break the build, and live happily ever after.
320 |
321 | *) master/main, in Git nomenclature
322 |
323 | Source:
324 |
325 | ---
326 |
327 |
328 |
329 | # Shared branches off mainline/master/trunk are bad at any release cadence
330 |
331 | 
332 |
333 | ---
334 |
335 |
336 |
337 | # Trunk Based Development – How?
338 |
339 | 
340 |
341 | ---
342 |
343 | # Branching strategy
344 |
345 | - Short-lived < 1 day
346 | - Branching enables automated tests as gates
347 | - It's not a *strategy*...
348 |
349 | ---
350 |
351 | 
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 | # Continuous Integration
368 |
369 | ---
370 |
371 | # Continuous Integration – What?
372 |
373 | > Continuous Integration (CI) is the process of automating the build and testing of code every time a team member commits changes to version control.
374 |
375 | Source:
376 |
377 | ---
378 |
379 | # Demo
380 |
381 | Test-Driven C♯ using Continuous Integration and Trunk Based Development
382 |
383 | ---
384 |
385 | 
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 | # Thank you
401 |
402 | ---
403 |
404 | # Appendix
405 |
406 | ---
407 |
408 | # Create a C♯ console app with a test library
409 |
410 | ```bash
411 | mkdir MyApp
412 | cd MyApp
413 |
414 | dotnet new console -o MyApp
415 | dotnet new xunit -o MyApp.Tests
416 |
417 | dotnet new sln
418 | dotnet sln add MyApp
419 | dotnet sln add MyApp.Tests
420 | dotnet add MyApp.Tests reference MyApp
421 |
422 | dotnet build
423 | dotnet test
424 | dotnet run --project MyApp
425 |
426 | dotnet list package --outdated
427 | dotnet add MyApp.Tests package xunit # add/update package
428 |
429 | dotnet watch test --project HelloWorld.Tests/
430 | ```
431 |
432 | ---
433 |
434 | # The C♯ class
435 |
436 | ```csharp
437 | namespace Namespace;
438 |
439 | public class Class
440 | {
441 | private string _field;
442 |
443 | protected DateTime _fieldAvailableInSubClass;
444 |
445 | public string Property { get => _field; } // Getter
446 |
447 | public int AutoProperty { get; set; }
448 |
449 | public Class() { }
450 |
451 | public string InstanceMethod(string parameter)
452 | {
453 | return $"Hello {parameter}";
454 | }
455 |
456 | public virtual bool OverridableInstanceMethod(bool parameter) => !parameter;
457 |
458 | public static void StaticMethod() { }
459 |
460 | private void PrivateInstanceMethod() { }
461 |
462 | public event EventHandler Event;
463 |
464 | protected virtual void OnEvent(EventArgs e)
465 | {
466 | EventHandler handler = Event;
467 | handler?.Invoke(this, e);
468 | }
469 |
470 | public delegate void MyEventHandler(object sender, EventArgs e);
471 | }
472 | ```
473 |
474 | ---
475 |
476 | # Naming Conventions
477 |
478 | **Composed names**
479 | `currentLayout`, `CurrentLayout`
480 |
481 | **Variables and fields**
482 | `vehicle`, `leftElement`
483 |
484 | **Private fields**
485 | `_vehicle`, `_leftElement`
486 |
487 | **Methods**
488 | `CurrentVehicle()`, `Size()`
489 |
490 | **Properties**
491 | `Pi`, `Name`, `Size`
492 |
493 | **Classes**
494 | `MyClass`, `List`
495 |
496 | **Interfaces**
497 | `IException`, `IObserver`
498 |
499 |
500 |
501 | ---
502 |
503 | # Built-in Types
504 |
505 | ```csharp
506 | bool boolean; // true || false
507 | char character; // 'a', 'b', 'c', '1', '2', '3'
508 |
509 | // Integral numeric types
510 | byte integer8bit; sbyte signedByte;
511 | int integer32bit; uint unsignedInteger32bit;
512 | long integer64bit; ulong unsignedInteger64bit;
513 | short integer16bit; ushort unsignedInteger16bit;
514 |
515 | // Floating point numeric types Reference types
516 | decimal precisionFloatingPoint; object obj;
517 | double floatingPoint64bit; string str;
518 | float floatingPoint32Bit; dynamic dyn;
519 | ```
520 |
521 |
522 |
523 | ---
524 |
525 | # Basic Unit Test
526 |
527 | ```csharp
528 | public class Ticker
529 | {
530 | public int Counter { get; private set; }
531 | public void Increment() => Counter++;
532 | public Ticker(int start = 0) => Counter = start;
533 | }
534 |
535 | public class TickerTests
536 | {
537 | [Fact]
538 | public void Increment_when_called_increases_Counter_by_1()
539 | {
540 | // Arrange
541 | var sut = new Ticker(41);
542 |
543 | // Act
544 | sut.Increment();
545 |
546 | // Assert
547 | sut.Counter.Should().Be(42);
548 | }
549 | }
550 | ```
--------------------------------------------------------------------------------
/sessions/csharp_02/images/core.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/core.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/generic-cola.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/generic-cola.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/grain.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/grain.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/iterator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/iterator.png
--------------------------------------------------------------------------------
/sessions/csharp_02/images/monkey.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/monkey.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/polymorphism-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/polymorphism-bg.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/produce-bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/produce-bg.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/robots.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/robots.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/system-collections-concurrent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/system-collections-concurrent.png
--------------------------------------------------------------------------------
/sessions/csharp_02/images/system-collections-generic-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/system-collections-generic-2.png
--------------------------------------------------------------------------------
/sessions/csharp_02/images/system-collections-generic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/system-collections-generic.png
--------------------------------------------------------------------------------
/sessions/csharp_02/images/system-collections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/system-collections.png
--------------------------------------------------------------------------------
/sessions/csharp_02/images/thank-you.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/thank-you.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/images/traffic-lights.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_02/images/traffic-lights.jpg
--------------------------------------------------------------------------------
/sessions/csharp_02/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 02: Generics, Collections, Iterators, and Regular Expressions
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 |
19 |
20 | 
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | # Parametric Polymorphism – "Generics"
34 |
35 | ---
36 |
37 | # Generics
38 |
39 | 
40 |
41 | Collections (Generic)
42 | Iterators
43 | Create your own?
44 | Type Constraints
45 | (Co- and contravariance)
46 |
47 | ---
48 |
49 | # `ArrayList` --> `List`
50 |
51 | ```csharp
52 | // Non-generic
53 | IList list = new ArrayList();
54 | list.Add("hello");
55 | var s = (string)list[0];
56 |
57 | // Generic
58 | IList list = new List();
59 | list.Add("hello");
60 | var s = list[0];
61 | ```
62 |
63 | ---
64 |
65 | 
66 |
67 | # Generic collections
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | ---
83 |
84 |
85 |
86 | # `System.Collections`
87 |
88 | 
89 |
90 | ---
91 |
92 |
93 |
94 | # `System.Collections.Generic`
95 |
96 | 
97 |
98 | ---
99 |
100 |
101 |
102 | # `System.Collections.Generic` - Key/Value
103 |
104 | 
105 |
106 | ---
107 |
108 |
109 |
110 | # `System.Collections.Concurrent`
111 |
112 | 
113 |
114 | ---
115 |
116 | # Generic Collections
117 |
118 | ## Demo
119 |
120 | ---
121 |
122 | 
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | # Iterators
138 |
139 | ---
140 |
141 |
142 |
143 | # Iterators
144 |
145 | 
146 |
147 | - Producer
148 | - Building block for *LINQ*
149 | - Enables:
150 |
151 | ```csharp
152 | foreach (var item in items)
153 | {
154 | Console.WriteLine(item.Name);
155 | }
156 | ```
157 |
158 | - Built using:
159 |
160 | ```
161 | yield return 42;
162 | yield break;
163 | ```
164 |
165 | ---
166 |
167 | # Iterators
168 |
169 | ## Demo
170 |
171 | ---
172 |
173 | # Create your own generic class
174 |
175 | ```csharp
176 | class MyGenericClass where T : IComparable
177 | {
178 | void Add(T value) { }
179 | void Remove(T value) { }
180 | bool Contains(T value) { }
181 | }
182 | ```
183 |
184 | ---
185 |
186 | # Create your own generic class 2
187 |
188 | ```csharp
189 | class MyGenericMap
190 | {
191 | void Add(TKey key, TValue value) { }
192 | bool ContainsKey(TKey key) { }
193 | bool ContainsValue(TValue key) { }
194 | TValue this[TKey key] { get; set; }
195 | }
196 | ```
197 |
198 | ---
199 |
200 | # Create your own generic method
201 |
202 | ```csharp
203 | public string Serialize(T obj) {}
204 |
205 | public T2 Convert(T1 obj) { }
206 | ```
207 |
208 | ---
209 |
210 | # Type constraints
211 |
212 | ```csharp
213 | public class MyConstrainedGenericClass
214 | where T : class, new() { }
215 |
216 | public class MyConstrainedGenericClass
217 | where T : struct { }
218 |
219 | public class MyConstrainedGenericClass
220 | where T1 : Foo
221 | where T2 : IBar { }
222 |
223 | public T2 MyConstrainedMethod(T1 item)
224 | where T1 : Foo
225 | where T2 : IBar, new() { }
226 | ```
227 |
228 | ---
229 |
230 | # Custom Generics
231 |
232 | ## Demo
233 |
234 | ---
235 |
236 | 
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 | # Covariance – Contravariance – Invariance?
252 |
253 | ---
254 |
255 | ### Covariance
256 |
257 | Enables you to use a more derived type than originally specified.
258 | You can assign an instance of `IEnumerable` to a variable of type `IEnumerable`.
259 |
260 | ### Contravariance
261 |
262 | Enables you to use a more generic (less derived) type than originally specified.
263 | You can assign an instance of `Action` to a variable of type `Action`.
264 |
265 | ### Invariance
266 |
267 | Means that you can use only the type originally specified. An invariant generic type parameter is neither covariant nor contravariant.
268 | You cannot assign an instance of `List` to a variable of type `List` or vice versa.
269 |
270 | Source: [docs.microsoft.com/.../generics/covariance-and-contravariance](https://docs.microsoft.com/en-us/dotnet/standard/generics/covariance-and-contravariance).
271 |
272 | ---
273 |
274 | # Built-in Generics
275 |
276 | ```csharp
277 | public interface IComparer
278 | {
279 | int Compare(T x, T y);
280 | }
281 |
282 | public interface IEnumerable : IEnumerable
283 | {
284 | IEnumerator GetEnumerator();
285 | }
286 | ```
287 |
288 | ---
289 |
290 | # Covariance and Contravariance
291 |
292 | ## Demo
293 |
294 | ---
295 |
296 | 
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 | # Enumerations
313 |
314 | ---
315 |
316 | # Enumerations
317 |
318 | ## Demo
319 |
320 | Source: [docs.microsoft.com/.../language-reference/builtin-types/enum](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/enum)
321 |
322 | ---
323 |
324 | 
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 | # Regular Expressions
341 |
342 | ---
343 |
344 | # Regular Expressions reference 1
345 |
346 | `*` Zero or more times the previous character
347 | `+` Once or more times the previous character
348 | `?` Zero or one time the previous character
349 | `.` Any single character (not \n)
350 | `\s` Any whitespace character (e.g. tab)
351 | `\S` Any non-whitespace character
352 | `\b` Word boundary
353 | `\B` Any non-word boundary position
354 | `\w` Any word character (a-z, A-Z, 0-9)
355 | `\W` Any non-word character
356 | `^` Start of the input text
357 | `$` End of the input text
358 |
359 | ---
360 |
361 | # Regular Expressions reference 2
362 |
363 | `[1c]` matches character ‘1’ or ‘c’
364 | `[a-z]` matches all lower-case letters
365 | `[a-zA-Z]` matches all letters
366 | `[0-9]+` matches integer numbers
367 | `[0-9]+\.[0-9]+` matches a floating point
368 | `[0-2][0-9]:[0-5][0-9]` matches a time e.g. 12:34
369 |
370 | ---
371 |
372 | # Regular Expressions reference 3
373 |
374 | `[^abc]` matches character not in ‘a’, ‘b’, or ‘c’
375 | `(capture)` capturing group
376 | `(?:non)` non-capturing group
377 | `(?name)` named capturing group
378 | `[a-z]+(\d{5})` matches a standard Danish license plate where the numeric part is a capturing group
379 | `(?\w+) (?\w+)` matching a given name followed by a surname (named capturing groups)
380 | `(?:Jane|John) (\w+) (?:Doe)` matching the middle name of Jane or John Doe
381 |
382 | ---
383 |
384 | # Regular Expressions
385 |
386 | ## Demo
387 |
388 | ---
389 |
390 | 
391 |
392 | # Thank you
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
--------------------------------------------------------------------------------
/sessions/csharp_03/images/belt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/belt.png
--------------------------------------------------------------------------------
/sessions/csharp_03/images/core.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/core.jpg
--------------------------------------------------------------------------------
/sessions/csharp_03/images/delegate.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/delegate.jpg
--------------------------------------------------------------------------------
/sessions/csharp_03/images/extensions.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/extensions.jpg
--------------------------------------------------------------------------------
/sessions/csharp_03/images/lambda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/lambda.png
--------------------------------------------------------------------------------
/sessions/csharp_03/images/questions.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/questions.jpg
--------------------------------------------------------------------------------
/sessions/csharp_03/images/thank-you.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_03/images/thank-you.jpg
--------------------------------------------------------------------------------
/sessions/csharp_03/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # Survey during the *academic quarter*
9 |
10 | ## code: `5942 1139`
11 |
12 | ---
13 |
14 | # Questions
15 |
16 | - How to setup tests?
17 | - Testing private methods?
18 | - How to use fluent assertions?
19 |
20 | ---
21 |
22 | # C♯ 03: Lambdas and LINQ
23 |
24 | 
25 |
26 | Rasmus Lystrøm
27 | Associate Professor
28 | ITU
29 |
30 | ---
31 |
32 | # Topics
33 |
34 | 
35 |
36 | Delegates
37 | Anonymous methods
38 | Lambda expressions
39 | Local functions
40 | Anonymous types
41 | Tuples
42 | Records
43 | Extension methods
44 | LINQ
45 |
46 | ---
47 |
48 | 
49 |
50 | # Delegates
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | ---
66 |
67 |
68 |
69 | # Delegates – Building block for Higher-order functions
70 |
71 | ```csharp
72 | public delegate int BinaryOperation(int x, int y);
73 |
74 | var add = new BinaryOperation(
75 | delegate (int x, int y)
76 | {
77 | return x + y;
78 | }
79 | );
80 | ```
81 |
82 | ---
83 |
84 | # Delegates
85 |
86 | ## Demo
87 |
88 | ---
89 |
90 | # Lambda Expressions
91 |
92 | 
93 |
94 | ---
95 |
96 |
97 |
98 | # Lambda Expressions
99 |
100 | ```csharp
101 | Action write = s => Console.WriteLine(s);
102 |
103 | Func square = a => a * a;
104 | ```
105 |
106 | ```csharp
107 | Predicate b = c => c.Name.StartsWith("B");
108 |
109 | Converter ftoC = c => c * 9.0 / 5.0 + 32.0;
110 |
111 | ...
112 | ```
113 |
114 | ---
115 |
116 |
117 |
118 | # Local Functions
119 |
120 | ```csharp
121 | static void Main(string[] args)
122 | {
123 | int square(int a) { return a * a; };
124 |
125 | Console.WriteLine(square(16));
126 | }
127 | ```
128 |
129 | ---
130 |
131 | # Local Functions
132 |
133 | ## Demo
134 |
135 | ---
136 |
137 | 
138 |
139 | # Prerequisites
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 | ---
155 |
156 |
157 |
158 | # Anonymous types
159 |
160 | ```csharp
161 | var question = new
162 | {
163 | Title = "The answer...?",
164 | Answer = 42
165 | };
166 | ```
167 |
168 | ---
169 |
170 |
171 |
172 | # (Tuples)
173 |
174 | ```csharp
175 | var s = Tuple.Create("Clark Kent", "Superman");
176 |
177 | var b = ("Bruce Wayne", "Batman");
178 |
179 | var f = (name: "Barry Allen", alterEgo: "The Flash");
180 |
181 | var random = new Random();
182 |
183 | IEnumerable<(float x, float y)> GenerateCoordinates()
184 | {
185 | yield return (random.NextSingle() * 100, random.NextSingle() * 100);
186 | }
187 | ```
188 |
189 | ---
190 |
191 |
192 |
193 | # Records
194 |
195 | ```csharp
196 | public record Superhero(string Name, string AlterEgo, DateTime FirstAppearance);
197 | ```
198 |
199 | ---
200 |
201 |
202 |
203 | # Data: Collection Initializer
204 |
205 | ```csharp
206 | IEnumerable cities = new[]
207 | {
208 | new City(1, "Berlin"),
209 | new City(2, "Hamburg"),
210 | new City(3, "Frankfurt")
211 | };
212 | ```
213 |
214 | ---
215 |
216 |
217 |
218 | # Data: Collection + Object Initializer
219 |
220 | ```csharp
221 | IEnumerable cities = new[]
222 | {
223 | new City { Id = 1, Name = "Berlin" },
224 | new City { Id = 2, Name = "Hamburg" },
225 | new City { Id = 3, Name = "Frankfurt" }
226 | };
227 | ```
228 |
229 | ---
230 |
231 |
232 |
233 | 
234 |
235 | # Extension Methods
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 | ---
251 |
252 |
253 |
254 | # Built-in Extension methods
255 |
256 | ```csharp
257 | var count = cities.Count();
258 |
259 | var sort = cities.OrderBy(c => c.Name);
260 |
261 | var filter = cities.Where(c => c.Name.Contains("i"));
262 |
263 | var pick = cities.FirstOrDefault(c => c.Id == 2);
264 |
265 | var all = cities.All(c => c.Name.Length < 10);
266 |
267 | var any = cities.Any(c => c.Name.StartsWith("B"));
268 |
269 | var project = cities.Select(c => c.Name);
270 | ```
271 |
272 | ---
273 |
274 |
275 |
276 | # Create your own extension method
277 |
278 | ```csharp
279 | public static class Extensions
280 | {
281 | public static int WordCount(this string str) =>
282 | str.Split(new[] { ' ', '.', '?' },
283 | StringSplitOptions.RemoveEmptyEntries)
284 | .Length;
285 | }
286 | ```
287 |
288 | ---
289 |
290 | # Extension methods
291 |
292 | ## Demo
293 |
294 | ---
295 |
296 | 
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 | # LINQ - Language INtegrated Query
312 |
313 | ---
314 |
315 |
316 |
317 | # LINQ
318 |
319 |
320 |
321 | ```csharp
322 | var sorted = from c in cities
323 | where c.Name.Contains("i")
324 | orderby c.Name descending
325 | select new { Name = c.Name };
326 | ```
327 |
328 | ## Extension Methods Version
329 |
330 | ```csharp
331 | var sorted = cities.Where(c => c.Name.Contains("i"))
332 | .OrderByDescending(c => c.Name)
333 | .Select(c => new { Name = c.Name });
334 | ```
335 |
336 | ---
337 |
338 | # LINQ
339 |
340 | ## Demo
341 |
342 | ---
343 |
344 | 
345 |
346 | # Thank you
347 |
--------------------------------------------------------------------------------
/sessions/csharp_04/images/agenda.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/agenda.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/applause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/applause.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/azure-sql.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/azure-sql.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/clean-architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/clean-architecture.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/connection-meme.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/connection-meme.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/database-popularity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/database-popularity.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/databases.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/databases.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/disposable.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/disposable.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/entity-framework-core.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/entity-framework-core.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/injection.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/injection.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/lock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/lock.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/model.png
--------------------------------------------------------------------------------
/sessions/csharp_04/images/onion.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/onion.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/orm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/orm.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/package.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/package.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/pyramids.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/pyramids.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/images/skyscrapers.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_04/images/skyscrapers.jpg
--------------------------------------------------------------------------------
/sessions/csharp_04/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 4 - Data Access and Entity Framework Core
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Assignment feedback
19 |
20 | ## Conformance to requirements!
21 |
22 | > To submit the assignment you need to create a PDF document using LaTeX that contains the answers to the questions **and** a link to a public GitHub repository that contains a fork of the assignments repository with the completed code.
23 |
24 | > The PDF file must conform to the following **naming convention: `group_____assignment_01.pdf`**, where `` is replaced by the number of your group from [README_GROUPS.md](./README_GROUPS.md) and ``, ``, and `` are your respective ITU identifiers.
25 |
26 | > You submit via [LearnIT](https://learnit.itu.dk/mod/assign/view.php?id=164354).
27 |
28 | >
29 |
30 | ---
31 |
32 | # Pop quiz!
33 |
34 | # Which of the following PDF files conforms to the file name requirement above?
35 |
36 | 1. `Assignment1.pdf`
37 | 1. `Group_1_aaaa_bbbb_cccc_assignment_01.pdf`
38 | 1. `group_1_aaaa_bbbb_cccc.pdf`
39 | 1. `Assignment_01-2.pdf`
40 | 1. `group_1_aaaa_bbbb_cccc_assignment_01.pdf`
41 |
42 | ---
43 |
44 | # Pop Quiz!
45 |
46 | # Which of the following PDF files conforms to the file name requirement above?
47 |
48 | 1. ✗ `Assignment1.pdf`
49 | 1. ✗ `Group_1_aaaa_bbbb_cccc_assignment_01.pdf`
50 | 1. ✗ `group_1_aaaa_bbbb_cccc.pdf`
51 | 1. ✗ `Assignment_01-2.pdf`
52 | 1. ✓ `group_1_aaaa_bbbb_cccc_assignment_01.pdf`
53 |
54 | ---
55 |
56 | # Pop Quiz!
57 |
58 | ## Which of the following actions satisfies the requirement above?
59 |
60 | - Handing in a link to a repository only
61 | - Handing in a PDF file only
62 | - Handing in a link to a repository and a PDF file
63 |
64 | ---
65 |
66 | # Pop Quiz!
67 |
68 | ## Which of the following actions satisfies the requirement above?
69 |
70 | - ✗ Handing in a link to a repository only
71 | - ✗ Handing in a PDF file only
72 | - ✓ Handing in a link to a repository and a PDF file
73 |
74 | ---
75 |
76 | # Topics
77 |
78 |
79 |
80 | 
81 |
82 | Databases
83 | Old school SQL in C♯
84 | Package managers and dependencies
85 | Secrets
86 | The IDisposable interface
87 | SQL Injection
88 | Object Relational Mapping
89 | Entity Framework Core
90 | Clean Onions
91 | Lazy vs. Eager Loading
92 |
93 | ---
94 |
95 | 
96 |
97 | # Databases
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | ---
113 |
114 | # Relational Databases (SQL)
115 |
116 | Microsoft SQL Server
117 | Oracle Database
118 | IBM Db2
119 | MySQL
120 | MariaDB
121 | PostgreSQL
122 | SQLite
123 |
124 | 
125 |
126 | ---
127 |
128 | ## Document (NoSQL)
129 |
130 | Azure Cosmos DB
131 | Amazon DynamoDB
132 | MongoDB
133 | Couchbase
134 | Redis
135 | Elasticsearch
136 | Neo4j
137 |
138 | 
139 |
140 | ---
141 |
142 | # Most popular databases
143 |
144 | Source:
145 |
146 | 
147 |
148 | ---
149 |
150 |
151 |
152 | # SQL Server
153 |
154 | ```bash
155 | sudo docker pull mcr.microsoft.com/mssql/server:2019-latest
156 |
157 | MSSQL_SA_PASSWORD=
158 |
159 | docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$MSSQL_SA_PASSWORD" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
160 | ```
161 |
162 |
163 |
164 | ---
165 |
166 | # SQL Server Demo
167 |
168 | ## SQL Server Docker Container + Azure Data Studio
169 |
170 | ---
171 |
172 | 
173 |
174 |
175 |
176 | ---
177 |
178 | 
179 |
180 | # IDisposable
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | ---
194 |
195 |
196 |
197 | # IDisposable
198 |
199 | ```csharp
200 | var connection = new SqlConnection("...");
201 | try
202 | {
203 | ...
204 | }
205 | finally
206 | {
207 | if (connection != null)
208 | {
209 | connection.Dispose();
210 | }
211 | }
212 | ```
213 |
214 | ---
215 |
216 | 
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 | # Package Manager
233 |
234 | ---
235 |
236 | # NuGet Package Manager
237 |
238 | Source:
239 |
240 | `dotnet add package …`
241 |
242 | Criteria:
243 |
244 | - Downloads
245 | - License
246 | - Dependencies
247 | - Update frequency
248 | - Check source repository
249 |
250 | ---
251 |
252 | 
253 |
254 | # Dependabot
255 |
256 | ## Demo
257 |
258 | ---
259 |
260 | # Old School SQL
261 |
262 | ```bash
263 | dotnet add package System.Data.SqlClient
264 | ```
265 |
266 | ```csharp
267 | var cmdText = "SELECT * FROM Animals";
268 | using var connection = new SqlConnection(connectionString);
269 | connection.Open();
270 | using var command = new SqlCommand(cmdText, connection);
271 | using var reader = command.ExecuteReader();
272 | while (reader.Read())
273 | {
274 | ...
275 | }
276 | ```
277 |
278 | ---
279 |
280 |
281 |
282 | # IDisposable (Much better)
283 |
284 | ```csharp
285 | {
286 | using var connection = new SqlConnection("...");
287 |
288 | ...
289 | }
290 | ```
291 |
292 | ---
293 |
294 | 
295 |
296 | # Secrets
297 |
298 | ---
299 |
300 |
301 |
302 | # Secrets
303 |
304 | ```bash
305 | dotnet user-secrets init
306 | dotnet user-secrets set "ConnectionStrings:ConnectionString" "..."
307 | dotnet add package Microsoft.Extensions.Configuration.UserSecrets
308 | ```
309 |
310 | ```csharp
311 | using Microsoft.Extensions.Configuration;
312 |
313 | var configuration = new ConfigurationBuilder()
314 | .AddUserSecrets()
315 | .Build();
316 | var connectionString = configuration.GetConnectionString("ConnectionString");
317 | ```
318 |
319 | ---
320 |
321 | 
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 | # SQL Injection
337 |
338 | ---
339 |
340 | # SQL Injection
341 |
342 | A SQL injection attack consists of insertion or "injection" of a SQL query via the input data from the client to the application.
343 |
344 | A successful SQL injection exploit can:
345 |
346 | - read sensitive data from the database,
347 | - modify database data (Insert/Update/Delete),
348 | - execute administration operations on the database (such as shutdown the DBMS),
349 | or worse
350 |
351 | Source:
352 |
353 | ---
354 |
355 |
356 |
357 | 
358 |
359 | ---
360 |
361 | # Object Relational Mapping
362 |
363 | The act of converting incompatible types in OOP to tables/columns/rows/relations in SQL
364 |
365 | Object–relational impedance mismatch
366 |
367 | > Me not understand object me table
368 |
369 | ---
370 |
371 |
372 |
373 | 
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 | # Model
390 |
391 | ---
392 |
393 | 
394 |
395 | # Entity Framework Core
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 | ---
411 |
412 |
413 |
414 | # Entity Framework Core
415 |
416 | ```bash
417 | dotnet tool install --global dotnet-ef
418 | dotnet add package Microsoft.EntityFrameworkCore.Design
419 | dotnet ef migrations add InitialCreate
420 | dotnet ef database update
421 | ```
422 |
423 |
424 |
425 |
426 | ---
427 |
428 | 
429 |
430 |
431 |
432 | # Onion Architecture
433 |
434 |
435 |
436 | ---
437 |
438 |
439 |
440 | 
441 |
442 | ---
443 |
444 | # Lazy Loading
445 |
446 | ```bash
447 | dotnet add package Microsoft.EntityFrameworkCore.Proxies
448 | ```
449 |
450 | ```csharp
451 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
452 | => optionsBuilder.UseLazyLoadingProxies()
453 | .UseSqlServer(...);
454 | ```
455 |
456 |
457 |
458 | ---
459 |
460 | 
461 |
462 | # Thank you
463 |
--------------------------------------------------------------------------------
/sessions/csharp_05/images/applause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_05/images/applause.png
--------------------------------------------------------------------------------
/sessions/csharp_05/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 05: Dependency Injection and Testing Entity Framework Core
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Assignment feedback
19 |
20 | - How was it?
21 | - Testing?
22 |
23 | ---
24 |
25 | 
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | # Repository pattern
43 |
44 | ---
45 |
46 | # Repository Pattern
47 |
48 | - Enable CRUD on domain objects (entities)
49 |
50 | - Usually: one repository per entity
51 |
52 | - Debatable: has a `Save()` method
53 |
54 | ---
55 |
56 | # Generic repository
57 |
58 | ```csharp
59 | public interface Repository
60 | {
61 | T Create(T entity);
62 | IReadOnlyCollection Read();
63 | T Read(K id);
64 | void Update(T entity);
65 | void Delete(K id);
66 | }
67 | ```
68 |
69 | ---
70 |
71 | # Repository Pattern
72 |
73 | > ... but wait ...Entity Framework already does that for me!?
74 |
75 | ---
76 |
77 | # Recommended Repository: Per entity e.g., `Character`
78 |
79 | ```csharp
80 | public interface ICharacterRepository
81 | {
82 | int Create(CharacterCreateDTO character);
83 | CharacterDetailsDTO Read(int characterId);
84 | IReadOnlyCollection Read();
85 | void Update(CharacterUpdateDTO character);
86 | void Delete(int characterId);
87 | }
88 | ```
89 |
90 | ...or something similar...
91 |
92 | ---
93 |
94 | # Testing...
95 |
96 | - Testing live databases is hard
97 | - Testing live full systems is hard
98 | - By transitivity: Testing ... is hard...
99 |
100 | ---
101 |
102 |
103 |
104 | 
105 |
106 | ---
107 |
108 | # Dependency Injection
109 |
110 | Software design pattern which implements Inversion of Control (IoC)
111 |
112 | - Constructor Injection
113 | - Property (Setter) Injection
114 | - Interface Injection
115 |
116 | ---
117 |
118 | # Dependency Injection
119 |
120 | - Structured readable code
121 | - Testable code
122 | - Dependency Inversion Principle
123 | - Separation of Concerns
124 | - Rock SOLI***D***!!! <-- Pun intented
125 | - AWESOME!!
126 |
127 | ---
128 |
129 | # Programming to interface, not implementation…
130 |
131 | ```csharp
132 | public interface IFooService
133 | {
134 | bool Bar(Foo foo);
135 | }
136 |
137 | public class FooService : IFooService
138 | {
139 | bool Bar(Foo foo)
140 | {
141 | // Implementation
142 | }
143 | }
144 |
145 | public interface IFooMapper
146 | {
147 | Foo Map(Qux qux);
148 | }
149 | ```
150 |
151 | ---
152 |
153 | 
154 |
155 | # Using IFooService?
156 |
157 | ```csharp
158 | public class Baz
159 | {
160 | public bool Grault(Qux qux)
161 | {
162 | IFooMapper mapper = new FooMapper();
163 | var foo = mapper.Map(qux);
164 | IFooService service = new FooService();
165 | return service.Bar(foo);
166 | }
167 | }
168 | ```
169 |
170 | ---
171 |
172 | # Constructor Injection (preferred)
173 |
174 | ```csharp
175 | public class Baz
176 | {
177 | private readonly IFooMapper _mapper;
178 | private readonly IFooService _service;
179 |
180 | public Baz(IFooMapper mapper, IFooService service)
181 | {
182 | _mapper = mapper;
183 | _service = service;
184 | }
185 |
186 | public bool Grault(Qux qux)
187 | {
188 | var foo = _mapper.Map(qux);
189 | return _service.Bar(foo);
190 | }
191 | }
192 | ```
193 |
194 | ---
195 |
196 | # Property Injection
197 |
198 | ```csharp
199 | public class Baz
200 | {
201 | public IFooService Service { private get; set; }
202 |
203 | public bool Grault(Qux qux)
204 | {
205 | ...
206 |
207 | return Service?.Update(foo);
208 | }
209 | }
210 | ```
211 |
212 | ---
213 |
214 | # Interface Injection
215 |
216 | ```csharp
217 | public interface IServiceSetter
218 | {
219 | T Service { set; }
220 | }
221 |
222 | public class Baz : IServiceSetter
223 | {
224 | public IFooService Service { private get; set; }
225 |
226 | public bool Grault(Qux qux)
227 | {
228 | ...
229 |
230 | return Service?.Update(foo);
231 | }
232 | }
233 | ```
234 |
235 | ---
236 |
237 | # Best practices
238 |
239 | - Use Adapter to enable interface if needed
240 | - Use constructor injection
241 | - Program to interface
242 | - Use an IoC container (more on that later)
243 | - If you're injection more than 1-2-3 dependencies - you're doing it wrong!
244 |
245 | ---
246 |
247 | # Testing Entity Framework
248 |
249 | ---
250 |
251 | # SQLite in-memory database
252 |
253 | ```bash
254 | dotnet add package Microsoft.EntityFrameworkCore.Sqlite
255 | ```
256 |
257 | ```csharp
258 | using var connection = new SqliteConnection("Filename=:memory:");
259 | connection.Open();
260 | var builder = new DbContextOptionsBuilder().UseSqlite(connection);
261 | using var context = new MyContext(builder.Options);
262 | ```
263 |
264 | ---
265 |
266 | # Demo
267 |
268 | ## Testing Entity Framework with *SQLite in-memory*
269 |
270 | ---
271 |
272 | # Best practices
273 |
274 | - Wrap in logical units/service classes/repositories
275 | - Don’t test built-in code…
276 | - Program to interface
277 | - Repositories should not depend on other repositories
278 | - Use integration testing to ensure it all works
279 |
280 | ---
281 |
282 | # Integration testing
283 |
284 | - You must test against a real database eventually
285 | - More on this later in the course
286 |
287 | ---
288 |
289 | 
290 |
291 | # Thank you
292 |
--------------------------------------------------------------------------------
/sessions/csharp_06/images/concurrency.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/concurrency.jpg
--------------------------------------------------------------------------------
/sessions/csharp_06/images/deadlock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/deadlock.jpg
--------------------------------------------------------------------------------
/sessions/csharp_06/images/funko_pop_collection_by_needxxx_dazxmlc-fullview.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/funko_pop_collection_by_needxxx_dazxmlc-fullview.jpg
--------------------------------------------------------------------------------
/sessions/csharp_06/images/i-am-a-waiting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/i-am-a-waiting.png
--------------------------------------------------------------------------------
/sessions/csharp_06/images/main-worker-thread.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/main-worker-thread.png
--------------------------------------------------------------------------------
/sessions/csharp_06/images/nails.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/nails.jpg
--------------------------------------------------------------------------------
/sessions/csharp_06/images/race-condition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/race-condition.png
--------------------------------------------------------------------------------
/sessions/csharp_06/images/stack-heap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/stack-heap.png
--------------------------------------------------------------------------------
/sessions/csharp_06/images/thread.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_06/images/thread.jpg
--------------------------------------------------------------------------------
/sessions/csharp_06/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 06: Asynchronous and Parallel Programming
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # The Gilded Rose
19 |
20 | Introduction
21 |
22 | ---
23 |
24 | 
25 |
26 | # Dictionary
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | ---
42 |
43 | # Async ≠ Parallel ≠ Threads
44 |
45 | ---
46 |
47 | 
48 |
49 | # Concurrency
50 |
51 | ---
52 |
53 | # Concurrency I
54 |
55 | > A property of systems in which several computations are executing simultaneously, and potentially interacting with each other. The computations may be executing on multiple cores in the same chip, preemptively time-shared threads on the same processor, or executed on physically separated processors.
56 |
57 | ---
58 |
59 | # Concurrency II
60 |
61 | > Multiple tasks which start, run, and complete in overlapping time periods, in no specific order.
62 |
63 | ---
64 |
65 | 
66 |
67 | # Parallelism
68 |
69 | ---
70 |
71 | # Parallelism
72 |
73 | > When multiple tasks OR several parts of a unique task literally run at the same time, e.g., on a multi-core processor.
74 |
75 | ---
76 |
77 |
78 |
79 | 
80 |
81 | # Multithreading
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | ---
95 |
96 | # Multithreading
97 |
98 | > Software implementation which allows different threads to be executed concurrently.
99 | > A multithreaded program appears to be doing several things at the same time even when it's running on a single-core machine.
100 | > Compare to chatting with different people through various IM windows; although you're switching back and forth, the net result is that you're having multiple conversations at the same time.
101 |
102 | ---
103 |
104 |
105 |
106 | 
107 |
108 | # Asynchronous methods
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | ---
124 |
125 | # Asynchronous methods
126 |
127 | > Asynchrony is used to present the impression of concurrent or parallel tasking.
128 | > Normally used for a process that needs to do work away from the current application where we don't want to wait and block our application awaiting the response.
129 |
130 | ---
131 |
132 |
133 |
134 | 
135 |
136 | # Threads
137 |
138 | ---
139 |
140 |
141 |
142 | 
143 |
144 | ---
145 |
146 |
147 |
148 | 
149 |
150 | # Threads Example
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | ---
166 |
167 | 
168 |
169 | # Race Condition
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 | ---
185 |
186 | # Race Condition
187 |
188 | > Behavior of a program where the output is dependent on the sequence or timing of other uncontrollable events.
189 | --> Bug, when events do not happen in the order the programmer intended.
190 |
191 | ---
192 |
193 |
194 |
195 | 
196 |
197 | # Race Condition
198 |
199 | ## Demo
200 |
201 | ---
202 |
203 | 
204 |
205 | # Deadlock
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 | ---
221 |
222 | # Deadlock
223 |
224 | > A situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does.
225 |
226 | ---
227 |
228 | 
229 |
230 | # Deadlock
231 |
232 | ## Demo
233 |
234 | ---
235 |
236 |
237 |
238 | 
239 |
240 | # Task Parallel Library
241 |
242 | ## Demo
243 |
244 | ---
245 |
246 | # TPL
247 |
248 | Task.Run
249 | Task.Factory…
250 | Task.Delay
251 | Parallel.For
252 | Parallel.ForEach
253 | Parallel.Invoke
254 |
255 | Parallel Linq --> .AsParallel()
256 |
257 | ---
258 |
259 | 
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 | # Concurrent Collections
275 |
276 | ---
277 |
278 | # `System.Collections.Concurrent`
279 |
280 | `ConcurrentQueue`
281 | `ConcurrentStack`
282 | `BlockingCollection`
283 | `ConcurrentDictionary`
284 |
285 | ---
286 |
287 |
288 |
289 | 
290 |
291 | # Asynchronous Programming
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 | ---
308 |
309 | # Asynchronous Programming
310 |
311 | > **Asynchronous programming** is a means of **parallel programming** in which a unit of work runs separately from the main application thread and notifies the calling thread of its completion, failure or progress.
312 |
313 | ---
314 |
315 | # Asynchronous Programming
316 |
317 | ## Demo
318 |
319 | ---
320 |
321 | # `async` / `await`
322 |
323 | `async` -->
324 |
325 | Method must return `void`, `Task`, `Task`, `ValueTask`, `ValueTask`, or a task-like type.
326 |
327 | Specifically: a type, which satisfy the *async* pattern, meaning a `GetAwaiter` method must be accessible.
328 |
329 | `await` --> Await task(s)...
330 |
331 | Note: Asynchronous `Main` and *test* methods must return `Task`
332 |
333 | ---
334 |
335 | # Async ≠ Parallel ≠ Threads
336 |
337 | *Async*: Non-blocking UI, background tasks, asynchronous
338 |
339 | *Parallel*: Speed, Multiprocessor, Parallel execution
340 |
341 | *Thread*: Low-level building block. Do not use directly!
342 |
343 | ---
344 |
345 | # Thank you
346 |
--------------------------------------------------------------------------------
/sessions/csharp_07/images/418.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_07/images/418.png
--------------------------------------------------------------------------------
/sessions/csharp_07/images/mvc-api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_07/images/mvc-api.png
--------------------------------------------------------------------------------
/sessions/csharp_07/images/mvc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_07/images/mvc.png
--------------------------------------------------------------------------------
/sessions/csharp_07/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 07: JSON and the REST
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # The Project
19 |
20 | More info on Monday
21 |
22 | ---
23 |
24 | # The Gilded Rose
25 |
26 | Recap
27 |
28 | ---
29 |
30 | # Parallel LINQ
31 |
32 | Carry-over from last week
33 |
34 | ---
35 |
36 | # XML
37 |
38 | eXtensible Markup Language
39 | Markup language like HTML
40 | Designed to carry data, not to display data
41 | Tags are not predefined – You must define your own tags
42 | Designed to be self-descriptive
43 |
44 | ---
45 |
46 |
47 |
48 | # XML does not do anything
49 |
50 | XML was created to structure, store, and transport information
51 |
52 | ```xml
53 |
54 |
55 | Kathleen B.
56 | Tom W.
57 | Reminder
58 | Don't forget to bring small change!
59 |
60 | ```
61 |
62 | ---
63 |
64 | # How Can XML be Used?
65 |
66 | Separates data from HTML
67 | Simplifies data sharing
68 | Simplifies data transport
69 | Simplifies platform changes
70 | Used to create new (Internet) languages
71 |
72 | - XHTML
73 | - WSDL for describing web services
74 | - RSS and ATOM for news feeds
75 | - XAML
76 |
77 | ---
78 |
79 |
80 |
81 | 
82 |
83 | ---
84 |
85 |
86 |
87 | # SOAP request
88 |
89 | ```http
90 | POST https://store.com/services/PriceService/getPrice
91 | ```
92 |
93 | ```xml
94 |
95 |
98 |
99 |
100 | Apples
101 |
102 |
103 |
104 | ```
105 |
106 | ---
107 |
108 |
109 |
110 | # SOAP response
111 |
112 | ```xml
113 |
114 |
117 |
118 | 1.90
119 |
120 |
121 |
122 | ```
123 |
124 | ---
125 |
126 | 
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 | # JSON
142 |
143 | ---
144 |
145 | # JSON
146 |
147 | JavaScript Object Notation
148 | Lightweight text-data interchange format
149 | Language independent (uses JavaScript syntax)
150 | "Self-describing" and easy to understand
151 |
152 | ---
153 |
154 | # JSON Syntax
155 |
156 | (subset of the JavaScript object notation syntax)
157 |
158 | Data is in name/value pairs
159 | Data is separated by commas
160 | Curly braces hold objects
161 | Square brackets hold arrays
162 |
163 | ---
164 |
165 | # JSON Name/Value Pairs
166 |
167 | A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value:
168 |
169 | ```json
170 | "givenName": "John"
171 | ```
172 |
173 | This is simple to understand, and equals to the JavaScript statement:
174 |
175 | ```javascript
176 | givenName = "John"
177 | ```
178 |
179 | ---
180 |
181 | JSON Data Types
182 |
183 | Number: `42` or `2.71828182845905`
184 | String: `"this is a string"`
185 | Boolean: `true` or `false`
186 | Array: `[]`
187 | Object: `{}`
188 | Null: `null`
189 |
190 | ---
191 |
192 |
193 |
194 | # Examples
195 |
196 | ```json
197 | { "alterEgo": "Batman", "firstAppearance": 1939 }
198 | ```
199 |
200 | ```json
201 | [
202 | { "givenName": "Bruce", "surname": "Wayne" },
203 | { "givenName": "Bruce", "surname": "Lee" },
204 | { "givenName": "Bruce", "surname": "Dickinson" }
205 | { "givenName": "Bruce", "surname": "Campbell" }
206 | { "givenName": "Robert", "surname": "the Bruce" }
207 | ]
208 | ```
209 |
210 | ```json
211 | null
212 | ```
213 |
214 | ```json
215 | "Batman"
216 | ```
217 |
218 | ---
219 |
220 | # Best of both worlds?
221 |
222 |
223 |
224 | ---
225 |
226 | 
227 |
228 | # YAML
229 |
230 | ---
231 |
232 | # YAML
233 |
234 | YAML Ain't Markup Language
235 |
236 | Human-readable data-serialization language.
237 |
238 | It is commonly used for configuration files and in applications where data is being stored or transmitted.
239 |
240 | Superset of JSON
241 |
242 | ---
243 |
244 |
245 |
246 | # YAML Example
247 |
248 | ```yaml
249 | version: '3.9'
250 | services:
251 | sql-server:
252 | image: mcr.microsoft.com/mssql/server:2019-latest
253 | hostname: sql-server
254 | container_name: sql-server
255 | ports:
256 | - 1433:1433
257 | environment:
258 | ACCEPT_EULA: 'Y'
259 | MSSQL_SA_PASSWORD_FILE: /run/secrets/sa_password
260 | MSSQL_PID: Express
261 | secrets:
262 | sa_password:
263 | file: ./local/sa_password.txt
264 | ```
265 |
266 | ---
267 |
268 | # REST
269 |
270 | # REpresentational State Transfer
271 |
272 | ---
273 |
274 | # HTTP request
275 |
276 | **URI**: string
277 | **(Query)**: key/value pairs
278 | **Method**: string
279 | **Header**: key/value pairs
280 | **Body**: string/binary
281 |
282 | ---
283 |
284 | # HTTP response
285 |
286 | **Status-Code**: number
287 | **Header**: key/value pairs
288 | **Body**: string/binary
289 |
290 | ---
291 |
292 | # REST
293 |
294 | Maps your CRUD actions to HTTP verbs:
295 |
296 | |Action|Verb|
297 | |:----|:----|
298 | |Create|POST|
299 | |Read (Retrieve)|GET|
300 | |Update (Replace)|PUT|
301 | |Update (Modify)|PATCH|
302 | |Delete|DELETE|
303 |
304 | ---
305 |
306 | # HTTP status codes
307 |
308 | |Code|Meaning|
309 | |:----|:----|
310 | |200|OK|
311 | |201|Created|
312 | |202|Accepted|
313 | |204|No Content|
314 | |301|Moved Permanently|
315 | |302|Found (Previously "Moved temporarily")|
316 | |307|Temporary Redirect|
317 | |308|Permanent Redirect|
318 | |400|Bad Request|
319 | |401|Unauthorized|
320 | |403|Forbidden|
321 | |404|Not Found|
322 | |409|Conflict|
323 | |415|Unsupported Media Type418|I’m a Teapot|
324 | |422|Unprocessable Entity|
325 | |500|Internal Server Error|
326 | |501|Not Implemented|
327 | |503|Service Unavailable|
328 |
329 | ---
330 |
331 |
332 |
333 | # RFC2324: Hyper Text Coffee Pot Control Protocol
334 |
335 | 
336 |
337 | Source:
338 |
339 | ---
340 |
341 | # HTTP headers
342 |
343 | |Header Field|Description|Examples|
344 | |:----|:----|:----|
345 | |Accept|I understand|`text/plain`
`application/json`
`application/xml`|
346 | |Content-Type|I'm sending|`application/x-www-form-urlencoded`
`application/json; charset=utf-8`|
347 | |Authorization|Who I am|`Bearer ey…`|
348 |
349 | ---
350 |
351 | # Why REST?
352 |
353 | Simple, both conceptually and programmatically
354 |
355 | Simpler and cleaner than SOAP
356 |
357 | REST is the new black
358 |
359 | ---
360 |
361 | # REST request
362 |
363 | ```http
364 | GET https://store.com/prices/Apples
365 | ```
366 |
367 | ---
368 |
369 | # REST response
370 |
371 | ```json
372 | 1.9
373 | ```
374 |
375 | ---
376 |
377 | # HTTP request
378 |
379 | **URI**:
380 | **Method**: `POST`
381 | **Header**:
382 | `Content-Type`: `application/json; charset=utf-8`
383 | `Authorization`: `Bearer ey...`
384 | **Body**:
385 |
386 | ```json
387 | {
388 | "name": "Bender",
389 | "species": "Robot",
390 | "planet": "Earth"
391 | }
392 | ```
393 |
394 | ---
395 |
396 | # HTTP response
397 |
398 | **Status-Code**: `201`
399 | **Header**:
400 | `Content-Type`: `application/json; charset=utf-8`
401 | `Location`: `https://futurama.com/api/characters/42`
402 | **Body**:
403 |
404 | ```json
405 | {
406 | "id": 42,
407 | "name": "Bender",
408 | "species": "Robot",
409 | "planet": "Earth"
410 | }
411 | ```
412 |
413 | ---
414 |
415 | # ASP.NET Core
416 |
417 | ---
418 |
419 |
420 |
421 | # Model – View – Controller
422 |
423 | 
424 |
425 | ---
426 |
427 |
428 |
429 | # ASP.NET Core Web API
430 |
431 | 
432 |
433 | ---
434 |
435 | # MVC elsewhere
436 |
437 | - [Spring Framework](https://spring.io/projects/spring-framework): 2002 (Java)
438 | - [Ruby on Rails](https://rubyonrails.org/): 2004
439 | - [CakePHP](https://cakephp.org/): 2005
440 | - [Catalyst](http://catalyst.perl.org/): 2005 (Perl)
441 | - [CodeIgniter](https://codeigniter.com/): 2006 (PHP)
442 | - ASP.NET MVC: 2009
443 | - ASP.NET Core: 2016
444 |
445 | ---
446 |
447 | # ASP.NET Core Web API
448 |
449 | ## Demo
450 |
451 | `dotnet new --list`
452 |
453 | ---
454 |
455 | # Controller
456 |
457 | ## Class
458 |
459 | Derive from `ControllerBase`
460 | Decorate with `[ApiController]` and `[Route("[controller]")]`
461 |
462 | ## Method
463 |
464 | Decorate with `[HttpGet]`,`[HttpPost]`, `[HttpPut]`, or `[HttpDelete]`
465 | Return specific type, `IActionResult`, `ActionResult`, or `async Task<...>`.
466 |
467 | ---
468 |
469 | # Thank You
470 |
--------------------------------------------------------------------------------
/sessions/csharp_08/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 08: JSON and the REST part deux
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Documenting ASP.NET Core
19 |
20 | ## Demo
21 |
22 | ---
23 |
24 |
25 |
26 | # Support the OpenAPI Specification (Swagger)
27 |
28 | ```bash
29 | dotnet add package Swashbuckle.AspNetCore
30 | ```
31 |
32 | ```csharp
33 | builder.Services.AddSwaggerGen();
34 |
35 | var app = builder.Build();
36 |
37 | if (app.Environment.IsDevelopment())
38 | {
39 | app.UseSwagger();
40 | app.UseSwaggerUI();
41 | }
42 | ```
43 |
44 | ---
45 |
46 |
47 |
48 | # Support HTTPS only
49 |
50 | Cf. [Enforce HTTPS in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/security/enforcing-ssl)
51 |
52 | ```bash
53 | dotnet dev-certs https --trust
54 | ```
55 |
56 | ```csharp
57 | app.UseHttpsRedirection();
58 | ```
59 |
60 | ---
61 |
62 |
63 |
64 | # Standardize on lowercase urls
65 |
66 | ```csharp
67 | builder.Services.AddRouting(options => options.LowercaseUrls = true);
68 | ```
69 |
70 | ---
71 |
72 | # Secure your Web API
73 |
74 | Azure AD
75 | Azure AD B2C
76 | 3rd party
77 |
78 | **Do not write your own security layer!!!**
79 |
80 | ---
81 |
82 | 
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | # Testing ASP.NET Core
98 |
99 | ---
100 |
101 | # Stub --> Mock --> Fake
102 |
103 | ---
104 |
105 | # Stubs
106 |
107 | ```csharp
108 | public class FooServiceFalseStub : IFooService
109 | {
110 | public bool Bar(Foo foo)
111 | {
112 | return false;
113 | }
114 | }
115 | ```
116 |
117 | ---
118 |
119 | # Test using stub
120 |
121 | ```csharp
122 |
123 | [Fact]
124 | public void Exec_when_IFooService_Update_returns_false_returns_false()
125 | {
126 | IFooService service = new FooServiceTrueStub();
127 | var baz = new Baz(service);
128 | var result = baz.Exec(new Foo());
129 | result.Should().Be(false);
130 | }
131 | ```
132 |
133 | ---
134 |
135 | # Faking it using Moq
136 |
137 | ```bash
138 | dotnet add package Moq
139 | ```
140 |
141 | ```csharp
142 | [Fact]
143 | public void Exec_when_IFooService_Update_returns_false_returns_false()
144 | {
145 | var mock = new Mock();
146 | IFooService service = mock.Object;
147 | var baz = new Baz(service);
148 |
149 | var result = baz.Exec(new Foo());
150 | result.Should().Be(false);
151 | }
152 | ```
153 |
154 | ---
155 |
156 | # Faking it using Moq (advanced)
157 |
158 | ```csharp
159 | [Fact]
160 | public void Exec_when_IFooService_Update_true_returns_true()
161 | {
162 | var mock = new Mock();
163 | mock.Setup(m => m.Update(It.IsAny())).Returns(true);
164 | var baz = new Baz(mock.Object);
165 |
166 | var result = baz.Exec(new Foo());
167 | result.Should().Be(true);
168 | }
169 | ```
170 |
171 | ---
172 |
173 | # Faking it using NSubstitute
174 |
175 | ```bash
176 | dotnet add package NSubstitute
177 | ```
178 |
179 | ```csharp
180 | [Fact]
181 | public void Exec_when_IFooService_Update_returns_false_returns_false()
182 | {
183 | var service = Substitute.For();
184 | var baz = new Baz(service);
185 |
186 | var result = baz.Exec(new Foo());
187 | result.Should().Be(false);
188 | }
189 | ```
190 |
191 | ---
192 |
193 | # Faking it using NSubstitute (advanced)
194 |
195 | ```csharp
196 | [Fact]
197 | public void Exec_when_IFooService_Update_true_returns_true()
198 | {
199 | var service = Substitute.For();
200 | service.Update(Arg.Any()).Returns(true);
201 | var baz = new Baz(service);
202 |
203 | var result = baz.Exec(new Foo());
204 | result.Should().Be(true);
205 | }
206 | ```
207 |
208 | ---
209 |
210 | # Testing ASP.NET Core with fakes
211 |
212 | ## Demo
213 |
214 | ---
215 |
216 | # [ASP.NET Minimal APIs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis)
217 |
218 | `dotnet new webapi -minimal`
219 |
220 | *Controllers are so yesterday...*
221 |
222 | ## Demo
223 |
224 | ---
225 |
226 | # [Integration tests in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0)
227 |
228 | ## Demo
229 |
230 | ---
231 |
232 | # gRPC
233 |
234 | > gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.
235 |
236 | Source:
237 |
238 | ```bash
239 | dotnet new grpc
240 | ```
241 |
242 | ---
243 |
244 | # GraphQL
245 |
246 | > GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
247 |
248 | Source:
249 |
250 | ---
251 |
252 | # Thank You
253 |
--------------------------------------------------------------------------------
/sessions/csharp_09/images/angular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_09/images/angular.png
--------------------------------------------------------------------------------
/sessions/csharp_09/images/react.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_09/images/react.png
--------------------------------------------------------------------------------
/sessions/csharp_09/images/vue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_09/images/vue.png
--------------------------------------------------------------------------------
/sessions/csharp_09/images/webapps.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_09/images/webapps.jpg
--------------------------------------------------------------------------------
/sessions/csharp_09/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 09: .NET Web Applications
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | 
19 |
20 | # .NET Conf 2022
21 |
22 | November 8–10
23 |
24 | - .NET 7
25 | - ASP.NET Core
26 | - Blazor
27 | - Minimal APIs
28 | - .NET MAUI
29 | - C♯ 11
30 |
31 |
32 |
33 | ---
34 |
35 | # Server-side vs. client-side rendering
36 |
37 | TODO
38 |
39 | ---
40 |
41 | 
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | # ASP.NET Web Applications
56 |
57 | ---
58 |
59 | # ASP.NET Web Applications
60 |
61 | ASP.NET Web Forms (2002)
62 | ASP.NET MVC (2010) --> Core
63 | ASP.NET Web Pages (2010) --> Core
64 | ASP.NET Core (2016)
65 |
66 | - Razor Pages
67 | - MVC
68 | - Blazor (Server or WebAssembly) (2018)
69 | - SPA (Angular or React)
70 | - Hybrid MVC + Blazor
71 |
72 |
73 |
74 | ---
75 |
76 |
77 |
78 | # ASP.NET Core Razor Pages
79 |
80 | Razor Pages can make coding page-focused scenarios easier and more productive than using controllers and views.
81 |
82 | ```bash
83 | dotnet new webapp
84 | ```
85 |
86 |
87 |
88 | ---
89 |
90 |
91 |
92 | 
93 |
94 | # ASP.NET Core MVC
95 |
96 | ASP.NET Core MVC is a rich framework for building web apps and APIs using the Model-View-Controller design pattern.
97 |
98 | ```bash
99 | dotnet new mvc
100 | ```
101 |
102 |
103 |
104 | ---
105 |
106 |
107 |
108 | # Blazor
109 |
110 | Blazor is a framework for building interactive client-side web UI with .NET:
111 |
112 | [Beginner's Series to: Blazor
113 | ](https://learn.microsoft.com/en-us/shows/beginners-series-to-blazor/)
114 |
115 | ```bash
116 | dotnet new blazorserver
117 | dotnet new blazorwasm
118 | ```
119 |
120 |
121 |
122 |
123 | ---
124 |
125 |
126 |
127 | # Single Page Application (SPA)
128 |
129 |   
130 |
131 | ```bash
132 | dotnet new angular
133 | dotnet new react
134 | ```
135 |
136 | ---
137 |
138 | # ASP.NET Web Applications
139 |
140 | ## Demo
141 |
142 | ---
143 |
144 |
145 |
146 | 
147 |
148 | # Building your own components
149 |
150 | ---
151 |
152 | # Component Vendors
153 |
154 | Telerik:
155 | DevExpress:
156 | Radzen:
157 |
158 | ---
159 |
160 | # Components
161 |
162 | ## Demo
163 |
164 | ---
165 |
166 | # How to choose a framework
167 |
168 | ---
169 |
170 | # How to choose a framework
171 |
172 | 1. Install Studio Professional/VisualEnterprise/for Mac
173 | 1. TEST out all the templates one by one
174 | 1. Get your own feel for pros/cons of each framework for your scenario
175 | 1. **When your done; select Blazor!**
176 |
177 | ---
178 |
179 | # No, really
180 |
181 | - Pick the one where you believe you will be the most productive
182 | - Don’t be afraid to change your mind
183 | - Be prepared: The next great thing which is better than all the others will arrive tomorrow or next year approx.
184 |
185 | ---
186 |
187 | # Thank You
188 |
--------------------------------------------------------------------------------
/sessions/csharp_10/images/ali-farahnak.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_10/images/ali-farahnak.jpg
--------------------------------------------------------------------------------
/sessions/csharp_10/images/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_10/images/button.png
--------------------------------------------------------------------------------
/sessions/csharp_10/images/rip.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_10/images/rip.gif
--------------------------------------------------------------------------------
/sessions/csharp_10/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # C♯ 10: .NET Mobile and Desktop Applications
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Info
19 |
20 | ## No lectures next week
21 |
22 | Use the extra time to catch up with your project and work on the new requirements
23 |
24 | ---
25 |
26 |
27 |
28 | 
29 |
30 | # Guest Lecture
31 |
32 | ## Mobile Application Development with C♯
33 |
34 | Ali Reza Farahnak
35 | Senior Cloud Solution Architect - Engineering
36 |
37 | ---
38 |
39 | # Mobile and Desktop Applications in .NET
40 |
41 | Windows Forms (WinForms) (2002)
42 |
43 | Windows Presentation Foundation (WPF) (2006)
44 |
45 | Silverlight (2007-2019)
46 |
47 | Xamarin.Forms (2014) (acquired by Microsoft in 2016)
48 |
49 | Universal Windows Platform (UWP) (2015-2021?)
50 |
51 | Windows UI Library (WinUI) (2021)
52 |
53 | .NET Multi-platform App UI (MAUI) (2021)
54 |
55 | ---
56 |
57 | # XAML: eXtensible Application Markup Language
58 |
59 | Windows Desktop (WPF)
60 | .NET MAUI
61 | WinUI
62 |
63 | 
64 |
65 | Xamarin.Forms (iOS, Android, Windows)
66 | Silverlight (web)
67 | Universal Windows Platform (anything windowsy)
68 |
69 | ---
70 |
71 | # XAML
72 |
73 | Markup language for declaratively designing and creating application UIs
74 |
75 | XAML maps XML markup to objects in the .NET Framework
76 |
77 | Every tag maps to a class and every attribute to a property
78 |
79 | Markup and procedural code are peers in functionality and performance
80 |
81 | Code and markup are both first class citizens
82 |
83 | Consistent model between UI, documents, and media
84 |
85 | Compiled to code
86 |
87 | ---
88 |
89 |
90 |
91 | # XAML Markup vs. Code
92 |
93 | ```xml
94 |
99 | ```
100 |
101 | 
102 |
103 | ```csharp
104 | var button = new Button();
105 | button.Content = "OK";
106 | button.Background = new SolidColorBrush(Colors.Purple);
107 | button.Width = 100;
108 | ```
109 |
110 | ---
111 |
112 |
113 |
114 | # MainPage.xaml
115 |
116 | ```xml
117 |
118 |
119 |
120 |
122 |
126 |
127 |
128 |
129 | ```
130 |
131 | ---
132 |
133 |
134 |
135 | # MainPage.xaml.cs
136 |
137 | ```csharp
138 | namespace App;
139 |
140 | public sealed partial class MainPage : Page
141 | {
142 | public MainPage()
143 | {
144 | this.InitializeComponent();
145 | }
146 |
147 | private void Button_Click(object sender, RoutedEventArgs e)
148 | {
149 | var current = Light.Fill as SolidColorBrush;
150 |
151 | if (current.Color == Colors.Red)
152 | Light.Fill = new SolidColorBrush(Colors.Green);
153 | else
154 | Light.Fill = new SolidColorBrush(Colors.Red);
155 | }
156 | }
157 | ```
158 |
159 | ---
160 |
161 | # Desktop Applications
162 |
163 | ## Demo
164 |
165 | ---
166 |
167 |
168 |
169 | # XAML + Code Behind
170 |
171 | ```xml
172 |
173 |
175 |
177 |
178 | ```
179 |
180 | ```csharp
181 | private void Button_Click(object sender, RoutedEventArgs e)
182 | {
183 | var current = Light.Fill as SolidColorBrush;
184 |
185 | if (current.Color == Colors.Red)
186 | {
187 | Light.Fill = new SolidColorBrush(Colors.Green);
188 | }
189 | else
190 | {
191 | Light.Fill = new SolidColorBrush(Colors.Red);
192 | }
193 | }
194 | ```
195 |
196 | ---
197 |
198 | 
199 |
200 | ---
201 |
202 | # MVVM
203 |
204 | ---
205 |
206 | # The Model-View-ViewModel (MVVM) Pattern
207 |
208 | Separation of logic and presentation
209 |
210 | Having event handlers in the code-behind is bad for testing, since you cannot mock away the view
211 |
212 | Changing the design of the view often also requires changes in the code, since every element has its different event handlers
213 |
214 | The logic is tightly bound to the view. It's not possible to reuse the logic in an other view
215 |
216 | ---
217 |
218 |
219 |
220 | # MVVM
221 |
222 |
223 |
224 | 
225 |
226 | ---
227 |
228 | # MVVM
229 |
230 | ## Demo
231 |
232 | ---
233 |
234 | # MVVM Concepts
235 |
236 | There is conceptually only ever one MODEL
237 |
238 | Code in code-behind should be ABSOLUTELY MINIMAL
239 |
240 | A ViewModel should ALWAYS implement INotifyPropertyChanged
241 |
242 | A ViewModel may be used for more than one view
243 |
244 | ---
245 |
246 | # MVVM Design Patterns
247 |
248 | Observer Pattern:
249 |
250 | - `INotifyPropertyChanged`
251 | - `ObservableCollection`
252 |
253 | Command Pattern:
254 |
255 | - `ICommand`
256 |
257 | ---
258 |
259 | # Thank You
260 |
--------------------------------------------------------------------------------
/sessions/csharp_11/images/app-registration-account-types.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/app-registration-account-types.png
--------------------------------------------------------------------------------
/sessions/csharp_11/images/azure-ad-b2c-identity-providers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/azure-ad-b2c-identity-providers.png
--------------------------------------------------------------------------------
/sessions/csharp_11/images/binary.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/binary.jpg
--------------------------------------------------------------------------------
/sessions/csharp_11/images/black-board.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/black-board.jpg
--------------------------------------------------------------------------------
/sessions/csharp_11/images/container.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/container.jpg
--------------------------------------------------------------------------------
/sessions/csharp_11/images/lab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/lab.gif
--------------------------------------------------------------------------------
/sessions/csharp_11/images/ladle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/ladle.jpg
--------------------------------------------------------------------------------
/sessions/csharp_11/images/padlock.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/padlock.gif
--------------------------------------------------------------------------------
/sessions/csharp_11/images/question.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_11/images/question.jpg
--------------------------------------------------------------------------------
/sessions/csharp_11/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | 
9 |
10 | # C♯ 11: Security
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | 
19 |
20 | ---
21 |
22 | # Upgrading .NET Applications
23 |
24 | Use Dependabot: .
25 |
26 | Get the latest .NET SDK: .
27 |
28 | ```bash
29 | dotnet tool install --global upgrade-assistant
30 |
31 | dotnet tool install --global try-convert
32 |
33 | upgrade-assistant analyze
34 |
35 | upgrade-assistant upgrade --skip-backup
36 |
37 | dotnet tool list --global
38 |
39 | dotnet tool update --global dotnet-ef
40 |
41 | dotnet list package --outdated
42 | ```
43 |
44 | ---
45 |
46 |
47 |
48 | # Update your .csproj files
49 |
50 | ```xml
51 |
52 |
53 | net7.0
54 | enable
55 | enable
56 |
57 |
58 | ```
59 |
60 | ---
61 |
62 | # Upgrading .NET Applications
63 |
64 | ## Demo
65 |
66 | ---
67 |
68 | # C♯ 11
69 |
70 | ## New features
71 |
72 | - [UTF-8 string literals](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#utf-8-string-literals)
73 | - [Required members](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11#required-members)
74 | - Other stuff: [What's new in C♯ 11](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11)
75 |
76 | Check out what's new in C♯ 8.0, 9.0, and 10.0 also.
77 |
78 | ---
79 |
80 | # .NET 7
81 |
82 | ## New features
83 |
84 | - [What's new in .NET 7](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-7)
85 | - [What's new in ASP.NET Core 7.0](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew)
86 | - [What's New in EF Core 7.0](https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew)
87 |
88 | Check out what's new in C♯ 5.0 and 6.0.
89 |
90 | ---
91 |
92 | # Security
93 |
94 | ---
95 |
96 | 
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | # Authentication vs. Authorization
111 |
112 | ---
113 |
114 | # Authentication Options
115 |
116 | (None)
117 | (Individual User Accounts)
118 | Microsoft Identity Platform (Azure Active Directory)
119 | (Windows)
120 |
121 | ---
122 |
123 | # Microsoft Identity Platform
124 |
125 | ## LOB, Corporate, Business to Business (B2B)
126 |
127 | Azure Active Directory (Azure AD) is Microsoft's cloud-based identity and access management service, which helps your employees sign in and access resources in:
128 |
129 | External resources, such as Microsoft 365, the Azure portal, and thousands of other SaaS applications.
130 | Internal resources, such as apps on your corporate network and intranet, along with any cloud apps developed by your own organization.
131 |
132 | 
133 |
134 | ---
135 |
136 | # Microsoft Identity Platform
137 |
138 | ## Business to Consumer (B2C)
139 |
140 | 
141 |
142 | ---
143 |
144 | # Key takeaway:
145 |
146 | # Don’t roll your own security/identity layer
147 |
148 | ---
149 |
150 | 
151 |
152 | ---
153 |
154 | # Security in Blazor
155 |
156 | [ASP.NET Core Blazor authentication and authorization](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/)
157 |
158 | [Authentication and authorization in minimal APIs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/security)
159 |
160 | ---
161 |
162 | 
163 |
164 | # Encryption in Transit
165 |
166 | SSL
167 | HTTPS
168 | TLS 1.2
169 |
170 | ---
171 |
172 | # Encryption in Transit
173 |
174 | Always enforce HTTPS
175 | Do not expose HTTP – except for automatic redirect – TEST
176 | Containers should communicate over secure channels only (cf. Dapr and Azure Container Apps)
177 |
178 | ---
179 |
180 | 
181 |
182 | # Secrets
183 |
184 | ---
185 |
186 | # Secrets
187 |
188 | Use user-secrets in DEV
189 | Use platform specific secret handling in PROD:
190 |
191 | - Azure Key Vault
192 | - App Services settings
193 | - HashiCorp Vault
194 |
195 | ---
196 |
197 | 
198 |
199 | # SQL Security
200 |
201 | - Azure Managed Identity
202 | - Don't use SA in production
203 | - Discrete user per app*)
204 |
205 | *) Ideally: don't share databases between apps.
206 |
207 | ---
208 |
209 | 
210 |
211 | # Container Security
212 |
213 | ---
214 |
215 | # Container Security
216 |
217 | All applies!
218 | No exceptions
219 | Containers are not a security layer
220 | Network security is an oxymoron!
221 | Assume compromise!
222 | HTTPS: [Hosting ASP.NET Core images with Docker over HTTPS
223 | ](https://learn.microsoft.com/en-us/aspnet/core/security/docker-https)
224 |
225 | ---
226 |
227 | # Security
228 |
229 | ## Demo
230 |
231 | ---
232 |
233 | 
234 |
235 | # Penultimate Lecture
236 |
237 | ---
238 |
239 | # Last Lecture
240 |
241 | December 2nd will be the last lecture on C♯
242 |
243 | What are we missing?
244 | What do you want repeated?
245 |
246 | Will cover:
247 |
248 | Continuous deployment of MyApp to Azure using GitHub Actions
249 |
250 | ---
251 |
252 | # Thank You
253 |
--------------------------------------------------------------------------------
/sessions/csharp_12/images/applause.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_12/images/applause.jpg
--------------------------------------------------------------------------------
/sessions/csharp_12/images/book.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_12/images/book.gif
--------------------------------------------------------------------------------
/sessions/csharp_12/images/questions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/csharp_12/images/questions.png
--------------------------------------------------------------------------------
/sessions/csharp_12/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | 
9 |
10 | # C♯ 12:
11 |
12 | `await this._course.DisposeAsync()`
13 |
14 | Rasmus Lystrøm
15 | Associate Professor
16 | ITU
17 |
18 | ---
19 |
20 | 
21 |
22 | # When in doubt; read the docs!
23 |
24 | ---
25 |
26 | # A note on the exam
27 |
28 | ---
29 |
30 | 
31 |
32 | # Steps
33 |
34 | 1) Read through the whole thing – cover to cover
35 | 2) Read through the whole thing – cover to cover **AGAIN**
36 | 3) Choose an order:
37 | * Solve the easiest
38 | * The most points
39 | * The ones you know you can do
40 | 4) Get cracking!
41 |
42 | ---
43 |
44 | # Questions
45 |
46 | 
47 |
48 | ---
49 |
50 | # Curriculum
51 |
52 | ## (non-exclusive list)
53 |
54 | - Unit Testing with `xunit` and (`Moq` or `NSubstitute`)
55 | - Linq using query syntax and extension method syntax
56 | - Regular expressions (simple ones)
57 | - Lambda expressions
58 | - Entity Framework Core
59 | - ASP.NET Core Web API (Minimal API syntax)
60 | - HTTP, JSON, and REST
61 | - SOLID principles - detect and fix
62 | - `async`/`await`, `Parallel`
63 |
64 | ---
65 |
66 | # Demos
67 |
68 | ## Lambda expressions and Linq
69 |
70 | ## IoC Containers
71 |
72 | ---
73 |
74 | # Exam questions walk-through
75 |
76 | ## Demo
77 |
78 | ---
79 |
80 | # Questions and Feedback
81 |
82 | ## Please fill out the course evaluation
83 |
84 | ---
85 |
86 | 
87 |
88 | # Thank You
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/sessions/q_and_a/Slides.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Slides
5 |
6 |
45 |
46 |
47 |
143 |
145 |
148 |
149 |
--------------------------------------------------------------------------------
/sessions/q_and_a/Slides.md:
--------------------------------------------------------------------------------
1 | class: center, middle
2 |
3 |
4 |
5 | # Analysis, Design and Software Architecture
6 |
7 | ## Q&A Session
8 |
9 | Helge Pfeiffer, Assistant Professor,
10 | [Research Center for Government IT](https://www.itu.dk/forskning/institutter/institut-for-datalogi/forskningscenter-for-offentlig-it),
11 | [IT University of Copenhagen, Denmark](https://www.itu.dk)
12 | `ropf@itu.dk`
13 |
14 | ---
15 |
16 | ### One
17 |
18 | > Hurtigt overview om eksamen, hvor i eventuelt tager udgangspunkt i et af de gamle eksamenssæt
19 |
20 | --
21 |
22 | [2021 Exam](https://learnit.itu.dk/pluginfile.php/338471/mod_resource/content/1/BDSA_exam_2021.pdf)
23 |
24 | ---
25 |
26 | ### Two
27 |
28 | > Generelt en oversigt over hvad der kan være på eksamen, lavet af Helge så man ligesom er sikker på hvad der skal læses op på - bare at have de kapitler vi har skulle læse i bøgerne er meget uoverskueligt
29 |
30 | --
31 |
32 | * Let's look at the reading list
33 | * Likely, it is a good idea to take inspiration for potential exam questions by checking the questions that I raised on slides in class.
34 | * Another source could be the quizes that we had in class.
35 |
36 | ---
37 |
38 | ### Three
39 |
40 | > Er det muligt at få nogle eksamener lagt op fra de sidste år hvor svarene er med? Føler lidt man øver sig i blinde på de der trial exams.
41 |
42 | * No solutions from our side
43 | * But [2021 Exam](https://learnit.itu.dk/pluginfile.php/338471/mod_resource/content/1/BDSA_exam_2021.pdf)
44 | * All [exam questions from years 2017-2020](https://learnit.itu.dk/mod/resource/view.php?id=171080)
45 |
46 | ---
47 |
48 | ### Four
49 |
50 | > Til @Helge Rasmus siger at du måske ville være sød og lave en liste over relevante design patterns så vi ikke læser op på noget unødvendigt 🙂 ❤️
51 |
52 | ---
53 |
54 | APPP chapters about design patterns:
55 |
56 | * 21 Command & Active Object
57 | * 22 Template Method & Strategy
58 | * 23 Facade & Mediator
59 | * 24 Singleton & Monostate
60 | * 25 Null Object
61 | * 29 Factory
62 | * 31 Composite
63 | * 32 Observer
64 | * 33 Abstract Server, Adapter, & Bridge
65 | * 34 Proxy & Gateway
66 | * 35 Visitor
67 |
68 | I think you should have read them all.
69 | They are on the reading list.
70 |
71 | ---
72 |
73 | If I were to select some to focus attention on, I would choose those in italics:
74 |
75 | * 21 Command & Active Object
76 | * 22 _Template Method_ & _Strategy_
77 | * 23 _Facade_ & _Mediator_
78 | * 24 _Singleton_ & Monostate
79 | * 25 Null Object
80 | * 29 _Factory_
81 | * 31 _Composite_
82 | * 32 _Observer_
83 | * 33 Abstract Server, _Adapter_, & _Bridge_
84 | * 34 _Proxy_ & _Gateway_
85 | * 35 _Visitor_
86 |
87 |
88 | ---
89 |
90 | ### Exam eligibility
91 |
92 | Double check that you have your five mandatory assignments accepted on LearnIT.
93 |
94 | If that is not the case but you really want to take part in the exam, talk to me now.
--------------------------------------------------------------------------------
/sessions/swe_00/README.md:
--------------------------------------------------------------------------------
1 | The following describes what we would like you to do before the first session of the course _Analysis, Design and Software Architecture_ on Tuesday, Aug. 30th (10:00).
2 |
3 | We would like that you prepare the following four things:
4 |
5 | * [A) Reading](#A-reading)
6 | * [B) Register accounts](#B-register-accounts)
7 | * [C) Setup workstation](#C-setup-workstation)
8 | * [D) Get to know Docker](#D-get-to-know-docker)
9 |
10 | In case you have problems with installation of any of the tools, do not despair.
11 | You will have to ask the TAs for help during the first exercise session on Tuesday, Aug. 30th (12:00 - 14:00).
12 |
13 | --------------------------------------------------------------------------------
14 |
15 | # A) Reading
16 |
17 | Read chapter 15 from *Objects First with Java: A Practical Introduction Using BlueJ* (Sixth Edition). It is the book that you used in the first semester in *"Grundlæggende Programmering"*.
18 |
19 | --------------------------------------------------------------------------------
20 |
21 | # B) Register accounts
22 |
23 | ## Create an account on [GitHub.com](https://github.com)
24 |
25 | If you do not have an account on [GitHub.com](https://github.com) yet, sign-up via https://github.com/signup
26 |
27 | Note, in this course we are using GitHub.com **not*- https://github.itu.dk/.
28 |
29 | ## Discord
30 |
31 | In case you are not registered for Discord, navigate to https://discord.com/ and create a user there.
32 |
33 | ## Overleaf
34 |
35 | You might want to author LaTeX documents with the browser-based tool [Overleaf](https://www.overleaf.com/login)
36 |
37 | To use it choose:
38 |
39 | 1. `Login with ORCID`
40 | 1. `Access through your institution`
41 | 1. Enter `IT University of Copenhagen`
42 | 1. Login with your credentials
43 |
44 | ## *Optional*: Activate Azure credits
45 |
46 | Navigate to and log in with your `@itu.dk` credentials.
47 |
48 | --------------------------------------------------------------------------------
49 |
50 | # C) Setup workstation
51 |
52 | ## Install a package manager
53 |
54 | - Windows
55 | - Install [winget](https://docs.microsoft.com/en-us/windows/package-manager/winget/)
56 | - MacOS
57 | - Install [homebrew](https://brew.sh/) by running the following in your terminal:
58 |
59 | ```bash
60 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
61 | ```
62 |
63 | - Linux
64 | - Depending on your distribution, you have a package manager like `apt` (Debian-based distributions) or `rpm` (RedHat-based distributions), etc. already installed.
65 |
66 | ## Install software (latest versions)
67 |
68 | 1. Windows only:
69 | 1. Windows Terminal:
70 | 1. Custom prompt:
71 | 1. Windows Subsystem for Linux: with Ubuntu
72 | 1. Ubuntu
73 | 1. Visual Studio Code: with extensions:
74 | - C#
75 | - .NET Core Test Explorer
76 | - markdownlint
77 | - PowerShell
78 | - Remote Development
79 | - REST Client
80 | - Visual Studio IntelliCode
81 | - vscode-icons
82 | - Docker
83 | 1. .NET (for Windows also in WSL)
84 | 1. PowerShell (for Windows also in WSL)
85 | 1. Docker:
86 | 1. LaTeX:
87 | 1. Git:
88 | 1. *Optional*: Windows and Mac only:
89 | - Visual Studio Community:
90 | 1. *Optional*: JetBrains Rider:
91 | - Note that you can get a free student license for all JetBrais IDEs that you use during your education, see https://www.jetbrains.com/community/education/#students
92 |
93 | ## Choose and install a diagramming tool
94 |
95 | Identify a tool that you can use in the course to draw diagrams in general and UML diagrams in particular.
96 | Make sure that the tool can export the diagrams to image files that can include them in a LaTeX document.
97 |
98 | In case you do not have a favorite diagramming tool yet, you might consider the following:
99 |
100 | - Diagram markup languages:
101 |
102 | - [MermaidJS](https://mermaid-js.github.io/)
103 | - [PlantUML](https://plantuml.com/)
104 | - [GraphViz](https://graphviz.org/)
105 |
106 | - WYSIWYG diagram editors:
107 |
108 | - [Umbrello](https://umbrello.kde.org/)
109 | - [Dia](http://dia-installer.de/index.html.en)
110 | - [ArgoUML](http://argouml.tigris.org/)
111 | - [StarUML](http://staruml.io/)
112 | - [Papyrus](https://www.eclipse.org/papyrus/)
113 | - [OmniGraffle](https://www.omnigroup.com/omnigraffle) (commercial product)
114 |
115 | --------------------------------------------------------------------------------
116 |
117 | # D) Get to know Docker
118 |
119 | 1. Follow the tutorial presented on Docker Desktop:
120 | 1. Follow this guide: [Quickstart: Run SQL Server container images with Docker](https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker).
121 |
122 | By now you should be able to run SQL Server in a container on your local machine, connect to it and run T-SQL queries against it.
123 |
--------------------------------------------------------------------------------
/sessions/swe_01/Slides.md:
--------------------------------------------------------------------------------
1 | class: center, middle
2 |
3 |
4 |
5 | # Analysis, Design and Software Architecture
6 |
7 | ## Software Engineering Session 1
8 |
9 | Helge Pfeiffer, Assistant Professor,
10 | [Research Center for Government IT](https://www.itu.dk/forskning/institutter/institut-for-datalogi/forskningscenter-for-offentlig-it),
11 | [IT University of Copenhagen, Denmark](https://www.itu.dk)
12 | `ropf@itu.dk`
13 |
14 | ---
15 |
16 | class: center, middle
17 |
18 | # About this course
19 |
20 | ---
21 |
22 | ### Who are we?
23 |
24 | * TAs: Emily, Gustav, Mikkel, Mille, Tamara
25 | * Teachers: Helge, Rasmus
26 |
27 | Contact us and the TAs via Discord.
28 |
29 | ---
30 |
31 | ### The Teaching Assistants (in alphabetical order)
32 |
33 | * Emily
34 | * Gustav
35 | * Mikkel
36 | * Mille
37 | * Tamara
38 |
39 | ---
40 |
41 | ### Rasmus
42 |
43 | * You will meet him on Friday, where he will introduce himself.
44 |
45 | ---
46 |
47 | ### Helge
48 |
49 |
50 |
51 |
52 | * Dipl-Inf. in Software Engineering from Friedrich-Schiller Universität Jena
53 | * PhD in Software Engineering from ITU
54 | * Software engineer at DMI
55 | * Lecturer at Cphbusiness
56 | * Since January 2019 back to ITU as adjunkt in the Center for Government IT
57 |
58 | ---
59 |
60 | ### Who are you?
61 |
62 |
63 |
64 | ---
65 |
66 | ### Your Expectations
67 |
68 |
69 |
70 | ---
71 |
72 | ### Our Expectations
73 |
74 |
75 | * Having fun with our work.
76 | * Hopefully, presenting relevant aspects of software engineering that are representative for your future professional tasks.
77 | * That you support each other when working through the course material, on the assignments, and on the project.
78 | * That you work *continuously* (as we do) on this course.
79 | * That you work for the about **20-24 hours** per week on this course.
80 | - This is the amount of time corresponding to 15 ECTS.
81 | * That you work on the exercises during the exercise classes.
82 | * That you work collaboratively in public repositories on GitHub.
83 | * Do not be afraid to talk to me during classes.
84 |
85 |
86 | Note, be prepared for **quite a bit of work** and many **moments of despair** :(
87 |
88 | This is unfortunately how learning works. At the moment it hurts but once you know how to solve your problems, solutions appear to be easy and straight forward.
89 |
90 | ---
91 |
92 | ## Grade distribution BDSA 2021
93 |
94 |
102 |
103 | That is, more than a quarter of the students failed the exam and had to take the re-exam.
104 |
105 | From these numbers and from feedback, we know that many students believe that this is the most difficult course during your BSc. But that should not block you.
106 |
107 | ---
108 |
109 | ### Schedule and Material
110 |
111 | * Schedule: https://github.com/itu-bdsa/lecture-notes#schedule
112 | * Course's repository: https://github.com/itu-bdsa/lecture-notes
113 |
114 | ---
115 |
116 | ### LearnIT
117 |
118 | Find on LearnIT (https://learnit.itu.dk/course/view.php?id=3021292) the:
119 |
120 | * official course description,
121 | * intended learning outcomes, and
122 | * exam description
123 |
124 | ---
125 |
126 | ### Lectures are not recorded?
127 |
128 | * After almost two years of online and remote teaching, I want to reestablish the "real" thing.
129 | * Experience shows, that lectures are watched to a way lower degree than people believe.
130 |
131 | ---
132 |
133 | ### SW Eng. Lectures are not recorded?
134 |
135 | * Recording lectures does not contribute positively to student attendance and attainment, see e.g., Edwards et al. [_"A study exploring the impact of lecture capture availability and lecture capture usage on student attendance and attainment"_](https://link.springer.com/article/10.1007/s10734-018-0275-9)
136 |
137 |
138 |
139 | ---
140 | ### SW Eng. Lectures are not recorded?
141 |
142 | * Online videos are not climate friendly, see e.g., [_"Climate crisis: The unsustainable use of online video – A practical case study for digital sobriety"_ (2019).](https://theshiftproject.org/wp-content/uploads/2019/07/2019-02.pdf)
143 |
144 |
145 |
146 |
147 | ---
148 |
149 | ### Lectures are not recorded, what can I do?
150 |
151 | * Come **prepared** to the lecture and exercise sessions, i.e., study the preparation material *before* coming to class.
152 | * Take notes!
153 | * Either with pen and paper (best for your brain and retention, see e.g., [Mueller et al. "The Pen Is Mightier Than the Keyboard: Advantages of Longhand Over Laptop Note Taking "](https://journals.sagepub.com/doi/abs/10.1177/0956797614524581)) or some other technology.
154 | * Share your notes with each other.
155 | * If you want to, we can establish a note sharing channel, either on Discord, Teams, in a Git repository, physically, etc.
156 |
157 | ---
158 |
159 | class: center, middle
160 |
161 | # What are we going to do in this course?
162 |
163 | ---
164 |
165 | # What are we going to do in this course?
166 |
167 |
175 |
176 | * You know how to program in the object-oriented language Java (1st semester)
177 | * You executed a first software development project (2nd semester)
178 | * This term: how to develop software when nobody gives you a [well-prepared list of requirements for your project](https://learnit.itu.dk/pluginfile.php/318781/mod_resource/content/2/project.pdf).
179 |
180 |
181 | ---
182 |
183 | # What are we going to do in this course?
184 |
185 | > [previously], we assumed that we more or less know what the classes are that we should use to solve our problems. In a real software project, deciding what classes to use to implement a solution to a problem can be one of the most difficult tasks. [...]
186 | >
187 | > These initial steps of developing a software system are generally referred to as _analysis and design_. We analyze the problem, and then we design a solution.
188 | >
189 | > Barnes et al. _Objects First with Java: A Practical Introduction Using BlueJ_ (Sixth Edition)
190 |
191 | --
192 |
193 | ### What else do Barnes et al. describe?
194 |
195 | *
196 | *
197 | *
198 |
199 |
205 |
206 | ---
207 |
208 | # Case: Coronapas App
209 |
210 |
211 |
212 | --
213 |
214 | Not a small software project:
215 |
216 | > [...] den samlede pris for appen ventes at løbe op i 46,9 millioner kroner, mens udgiften til udviklingsfasen, der løber frem til udgangen af maj ventes at lande på 17,3 millioner kroner.
217 |
218 | > https://www.computerworld.dk/art/256654/her-kan-du-hente-danmarks-spritnye-coronapas-app
219 |
220 | ---
221 |
222 | # Case: Coronapas App
223 |
224 | ### Stakeholders:
225 | * Digitaliseringsstyrelsen
226 | * Netcompany and Trifork
227 | * ???
228 |
229 | ---
230 |
231 | # Case: Coronapas App — How do you think it works?
232 |
233 | --
234 |
235 |
236 |
237 |
238 | Source Whitepaper om coronapas-appen.
239 |
240 |
241 | ---
242 |
243 | # Case: Coronapas App — How do you think it works?
244 |
245 |
246 |
247 |
248 | Source Whitepaper om coronapas-appen.
249 |
250 |
251 | ---
252 |
253 | ### What to do now?
254 |
255 | * Before the next session on Friday you have two exercise sessions á 2 hours each.
256 | * I would like you to work in groups of 6.
257 | * Implode the Coronapas App. That is, each group answers the following questions and create two posters:
258 | - A knowledge map about the Coronapas App
259 | - An ignorance map about the Coronapas App
260 |
261 | ---
262 |
263 | ### What to do now?
264 |
265 | List of questions about the Coronapas App:
266 |
267 | 1. Who makes it? How is it made? What are its parts? What are the stages in its creation process?
268 | 1. What kind of professionals are involved in making expert decisions regarding its development, production, and dissemination?
269 | 1. What are the regulations concerning it? How do these regulations help constitute it?
270 | 1. How is it created after government decided to have one?
271 | 1. How can it be illustrated? How can its parts be illustrated?
272 | 1. Is there something that is reused during its creation, operation and maintenance?
273 | 1. What is done to make sure it works as intended?
274 | 1. How is it actually build and distributed?
275 | 1. How does it impact organizations (e.g., schools, businesses, governments)? How does it impact personal life (e.g., family, friendship)?
276 |
277 | ---
278 |
279 | ### What to do now?
280 |
281 | * Form groups of six people.
282 | * Map your answers to the questions above in a *knowledge map* (using for example the [mindmap notation](https://en.wikipedia.org/w/index.php?title=Mind_map#Gallery)) using pen and paper.
283 | - While doing that, **do not** google to increase your knowledge about the Coronapas App.
284 | * Thereafter, create an *ignorance map*. That is, note in a diagram as above everything that you do not know about the Coronapas App with respect to the questions above and with respect to your own questions.
285 | - While doing so try to figure out and note down where you could find answers to your questions and knowledge to topics that you don't know.
286 |
287 | Wednesday at the end of the exercise session take a picture of your posters and send them to me via the [LearnIT Hand-in](https://learnit.itu.dk/mod/assign/view.php?id=163238).
288 |
289 | ---
290 |
291 | ### Your turn!
292 |
293 | 
294 |
295 |
301 |
302 |
303 |
--------------------------------------------------------------------------------
/sessions/swe_01/images/coronapas_app_arkitektur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_01/images/coronapas_app_arkitektur.png
--------------------------------------------------------------------------------
/sessions/swe_01/images/coronapas_app_arkitektur2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_01/images/coronapas_app_arkitektur2.png
--------------------------------------------------------------------------------
/sessions/swe_01/images/first_names.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_01/images/first_names.png
--------------------------------------------------------------------------------
/sessions/swe_01/images/grades.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Grades plot
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/sessions/swe_01/menti_results.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_01/menti_results.pdf
--------------------------------------------------------------------------------
/sessions/swe_02/images/analysis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_02/images/analysis.png
--------------------------------------------------------------------------------
/sessions/swe_02/images/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_02/images/architecture.png
--------------------------------------------------------------------------------
/sessions/swe_02/images/coronapas_app_arkitektur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_02/images/coronapas_app_arkitektur.png
--------------------------------------------------------------------------------
/sessions/swe_02/images/design.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_02/images/design.png
--------------------------------------------------------------------------------
/sessions/swe_02/images/knowledge_maps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_02/images/knowledge_maps.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_148_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_148_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_163_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_163_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_166_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_166_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_180_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_180_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_190_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_190_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_191_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_191_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_1_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_1_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_216_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_216_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_krav_67_quiz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_krav_67_quiz.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_use_case.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_use_case.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_use_case_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_use_case_01.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_use_case_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_use_case_02.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_use_case_diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_use_case_diagram.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_use_case_diagram2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_use_case_diagram2.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/kombit_sapa_vision.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/kombit_sapa_vision.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/re_process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/re_process.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/se_nonfunc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/se_nonfunc.png
--------------------------------------------------------------------------------
/sessions/swe_03/images/use_case_diagram_se.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/images/use_case_diagram_se.png
--------------------------------------------------------------------------------
/sessions/swe_03/material/Kravspecifikation juli 2014 v. 1.0.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/material/Kravspecifikation juli 2014 v. 1.0.docx
--------------------------------------------------------------------------------
/sessions/swe_03/material/Kravspecifikation juli 2014 v. 1.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_03/material/Kravspecifikation juli 2014 v. 1.0.pdf
--------------------------------------------------------------------------------
/sessions/swe_04/images/Sommerville_activity_diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/Sommerville_activity_diagram.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_bubble_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_bubble_sort.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_class_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_class_diag.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_class_diag2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_class_diag2.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_class_diag3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_class_diag3.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_collab_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_collab_diag.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_collab_diag2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_collab_diag2.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_sequence_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_sequence_diag.png
--------------------------------------------------------------------------------
/sessions/swe_04/images/martin_state_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_04/images/martin_state_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/dip_uml_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/dip_uml_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/lsp_uml_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/lsp_uml_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_bubble_sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_bubble_sort.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_class_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_class_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_class_diag2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_class_diag2.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_class_diag3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_class_diag3.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_collab_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_collab_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_isp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_isp.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_srp_code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_srp_code.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/martin_srp_diag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/martin_srp_diag.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/ousterhout_complexity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/ousterhout_complexity.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/upsource-CR5-OCP-remove-if.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/upsource-CR5-OCP-remove-if.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/upsource-CR5-OCP-remove-if1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/upsource-CR5-OCP-remove-if1.png
--------------------------------------------------------------------------------
/sessions/swe_05/images/upsource-CR5-OCP3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_05/images/upsource-CR5-OCP3.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/Quiz.graffle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/Quiz.graffle
--------------------------------------------------------------------------------
/sessions/swe_06/images/alexander_square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/alexander_square.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/alexander_transport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/alexander_transport.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/alexander_transport_areas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/alexander_transport_areas.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/dp_paper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/dp_paper.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/facade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/facade.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/gof_command1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/gof_command1.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/gof_command2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/gof_command2.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/gof_observer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/gof_observer.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/gof_observer_case.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/gof_observer_case.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/larman_observer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/larman_observer.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/mediator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/mediator.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/mediator_case.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/mediator_case.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/observer_dotnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/observer_dotnet.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/singleton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/singleton.png
--------------------------------------------------------------------------------
/sessions/swe_06/images/strategy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_06/images/strategy.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/coronapas_app_arkitektur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/coronapas_app_arkitektur.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/kombit_sapa_vision.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/kombit_sapa_vision.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/kruchten_4plus1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/kruchten_4plus1.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_arch.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_client_server_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_client_server_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_client_server_pattern_fatness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_client_server_pattern_fatness.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_component.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_component.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_design_decisions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_design_decisions.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_distr_comp_arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_distr_comp_arch.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_distr_comp_arch2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_distr_comp_arch2.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_layered_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_layered_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_mvc_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_mvc_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_mvc_pattern_instance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_mvc_pattern_instance.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_p2p_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_p2p_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_p2p_pattern2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_p2p_pattern2.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_pipes_filters_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_pipes_filters_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/images/se_repo_pattern.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_07/images/se_repo_pattern.png
--------------------------------------------------------------------------------
/sessions/swe_07/plot.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import sys
3 |
4 |
5 | for line in sys.stdin:
6 | data, width = line.split(",")
7 | width = int(width)
8 | print("{:<30}{:=<{width}}".format(data, "", width=width))
9 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/Program.cs:
--------------------------------------------------------------------------------
1 | // Project was generated on Linux with:
2 | // dotnet new console --framework net6.0
3 |
4 | // Nice message is generated here:
5 | // https://patorjk.com/software/taag/#p=display&f=Bloody&t=Welcome%0A%20%20%20%20%20%20%20at%0A%20%20%20%20%20%20ITU
6 | string msg = @"
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 | Console.WriteLine(msg);
39 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/csharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/linux/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/linux/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/linux/nosc/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/linux/nosc/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sc/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sc/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sf-nosc/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sf-nosc/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sf-sc/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/linux/sf-sc/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/macos/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/macos/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/csharp/dist/windows/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/csharp/dist/windows/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/fpc/hello.pas:
--------------------------------------------------------------------------------
1 | program Hello;
2 | const
3 | S = ' █ █░▓█████ ██▓ ▄████▄ ▒█████ ███▄ ▄███▓▓█████ ' + LineEnding +
4 | '▓█░ █ ░█░▓█ ▀ ▓██▒ ▒██▀ ▀█ ▒██▒ ██▒▓██▒▀█▀ ██▒▓█ ▀ ' + LineEnding +
5 | '▒█░ █ ░█ ▒███ ▒██░ ▒▓█ ▄ ▒██░ ██▒▓██ ▓██░▒███ ' + LineEnding +
6 | '░█░ █ ░█ ▒▓█ ▄ ▒██░ ▒▓▓▄ ▄██▒▒██ ██░▒██ ▒██ ▒▓█ ▄ ' + LineEnding +
7 | '░░██▒██▓ ░▒████▒░██████▒▒ ▓███▀ ░░ ████▓▒░▒██▒ ░██▒░▒████▒' + LineEnding +
8 | '░ ▓░▒ ▒ ░░ ▒░ ░░ ▒░▓ ░░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ░ ░░░ ▒░ ░' + LineEnding +
9 | ' ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ ░ ▒ ░ ▒ ▒░ ░ ░ ░ ░ ░ ░' + LineEnding +
10 | ' ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ' + LineEnding +
11 | ' ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░' + LineEnding +
12 | ' ░ ' + LineEnding +
13 | ' ▄▄▄ ▄▄▄█████▓ ' + LineEnding +
14 | ' ▒████▄ ▓ ██▒ ▓▒ ' + LineEnding +
15 | ' ▒██ ▀█▄ ▒ ▓██░ ▒░ ' + LineEnding +
16 | ' ░██▄▄▄▄██░ ▓██▓ ░ ' + LineEnding +
17 | ' ▓█ ▓██▒ ▒██▒ ░ ' + LineEnding +
18 | ' ▒▒ ▓▒█░ ▒ ░░ ' + LineEnding +
19 | ' ▒ ▒▒ ░ ░ ' + LineEnding +
20 | ' ░ ▒ ░ ' + LineEnding +
21 | ' ░ ░ ' + LineEnding +
22 | ' ' + LineEnding +
23 | ' ██▓▄▄▄█████▓ █ ██ ' + LineEnding +
24 | ' ▓██▒▓ ██▒ ▓▒ ██ ▓██▒ ' + LineEnding +
25 | ' ▒██▒▒ ▓██░ ▒░▓██ ▒██░ ' + LineEnding +
26 | ' ░██░░ ▓██▓ ░ ▓▓█ ░██░ ' + LineEnding +
27 | ' ░██░ ▒██▒ ░ ▒▒█████▓ ' + LineEnding +
28 | ' ░▓ ▒ ░░ ░▒▓▒ ▒ ▒ ' + LineEnding +
29 | ' ▒ ░ ░ ░░▒░ ░ ░ ' + LineEnding +
30 | ' ▒ ░ ░ ░░░ ░ ░ ' + LineEnding +
31 | ' ░ ░ ' + LineEnding +
32 | ' ';
33 | begin
34 | writeln (S);
35 | end.
36 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/go/bdsa_greeter.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "bufio"
5 | "fmt"
6 | "os"
7 | "runtime"
8 | "strings"
9 | )
10 |
11 | func printGreeting() {
12 | // Got the ASCII art from here:
13 | // http://patorjk.com/software/taag/#p=display&f=Bloody&t=%20%20%20ITU
14 | fmt.Println("█ █░▓█████ ██▓ ▄████▄ ▒█████ ███▄ ▄███▓▓█████ ")
15 | fmt.Println("▓█░ █ ░█░▓█ ▀ ▓██▒ ▒██▀ ▀█ ▒██▒ ██▒▓██▒▀█▀ ██▒▓█ ▀ ")
16 | fmt.Println("▒█░ █ ░█ ▒███ ▒██░ ▒▓█ ▄ ▒██░ ██▒▓██ ▓██░▒███ ")
17 | fmt.Println("░█░ █ ░█ ▒▓█ ▄ ▒██░ ▒▓▓▄ ▄██▒▒██ ██░▒██ ▒██ ▒▓█ ▄ ")
18 | fmt.Println("░░██▒██▓ ░▒████▒░██████▒▒ ▓███▀ ░░ ████▓▒░▒██▒ ░██▒░▒████▒")
19 | fmt.Println("░ ▓░▒ ▒ ░░ ▒░ ░░ ▒░▓ ░░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ░ ░░░ ▒░ ░")
20 | fmt.Println("▒ ░ ░ ░ ░ ░░ ░ ▒ ░ ░ ▒ ░ ▒ ▒░ ░ ░ ░ ░ ░ ░")
21 | fmt.Println(" ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ")
22 | fmt.Println(" ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░")
23 | fmt.Println(" ░ ")
24 | fmt.Println("")
25 | fmt.Println(" ▄▄▄█████▓ ▒█████ ")
26 | fmt.Println(" ▓ ██▒ ▓▒▒██▒ ██▒")
27 | fmt.Println(" ▒ ▓██░ ▒░▒██░ ██▒")
28 | fmt.Println(" ░ ▓██▓ ░ ▒██ ██░")
29 | fmt.Println(" ▒██▒ ░ ░ ████▓▒░")
30 | fmt.Println(" ▒ ░░ ░ ▒░▒░▒░ ")
31 | fmt.Println(" ░ ░ ▒ ▒░ ")
32 | fmt.Println(" ░ ░ ░ ░ ▒ ")
33 | fmt.Println(" ░ ░ ")
34 | fmt.Println("")
35 | fmt.Println(" ██▓▄▄▄█████▓ █ ██ ")
36 | fmt.Println(" ▓██▒▓ ██▒ ▓▒ ██ ▓██▒")
37 | fmt.Println(" ▒██▒▒ ▓██░ ▒░▓██ ▒██░")
38 | fmt.Println(" ░██░░ ▓██▓ ░ ▓▓█ ░██░")
39 | fmt.Println(" ░██░ ▒██▒ ░ ▒▒█████▓ ")
40 | fmt.Println(" ░▓ ▒ ░░ ░▒▓▒ ▒ ▒ ")
41 | fmt.Println(" ▒ ░ ░ ░░▒░ ░ ░ ")
42 | fmt.Println(" ▒ ░ ░ ░░░ ░ ░ ")
43 | fmt.Println(" ░ ░ ")
44 | fmt.Println("")
45 | fmt.Println("")
46 | fmt.Println("")
47 | }
48 |
49 | func getName(name string) string {
50 | fmt.Print("Tell me your name: ")
51 |
52 | reader := bufio.NewReader(os.Stdin)
53 | text, _ := reader.ReadString('\n')
54 | return text
55 | }
56 |
57 | func main() {
58 | arguments := os.Args[1:]
59 | var name string
60 | var prg_name string
61 | if runtime.GOOS == "windows" {
62 | prg_name = "hello.exe"
63 | } else {
64 | prg_name = "hello"
65 | }
66 | if len(arguments) >= 2 {
67 | fmt.Println("Usage: " + prg_name + " [name]")
68 | os.Exit(1)
69 | }
70 |
71 | printGreeting()
72 |
73 | if len(arguments) == 0 {
74 | name = getName(name)
75 | } else {
76 | name = arguments[0]
77 | }
78 |
79 | fmt.Println("Hej " + strings.TrimSpace(name) + ", welcome at ITU!")
80 | }
81 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/go/dist/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/go/dist/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/python/bdsa_greeter/cli.py:
--------------------------------------------------------------------------------
1 | MSG = """
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 | def main():
36 | print(MSG)
37 |
38 |
39 | if __name__ == "__main__":
40 | main()
41 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/python/dist/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/bdsa_greeter/python/dist/.gitkeep
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/python/poetry.lock:
--------------------------------------------------------------------------------
1 | [[package]]
2 | name = "black"
3 | version = "22.10.0"
4 | description = "The uncompromising code formatter."
5 | category = "dev"
6 | optional = false
7 | python-versions = ">=3.7"
8 |
9 | [package.dependencies]
10 | click = ">=8.0.0"
11 | mypy-extensions = ">=0.4.3"
12 | pathspec = ">=0.9.0"
13 | platformdirs = ">=2"
14 | tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""}
15 |
16 | [package.extras]
17 | colorama = ["colorama (>=0.4.3)"]
18 | d = ["aiohttp (>=3.7.4)"]
19 | jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
20 | uvloop = ["uvloop (>=0.15.2)"]
21 |
22 | [[package]]
23 | name = "click"
24 | version = "8.1.3"
25 | description = "Composable command line interface toolkit"
26 | category = "dev"
27 | optional = false
28 | python-versions = ">=3.7"
29 |
30 | [package.dependencies]
31 | colorama = {version = "*", markers = "platform_system == \"Windows\""}
32 |
33 | [[package]]
34 | name = "colorama"
35 | version = "0.4.5"
36 | description = "Cross-platform colored terminal text."
37 | category = "dev"
38 | optional = false
39 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
40 |
41 | [[package]]
42 | name = "mypy-extensions"
43 | version = "0.4.3"
44 | description = "Experimental type system extensions for programs checked with the mypy typechecker."
45 | category = "dev"
46 | optional = false
47 | python-versions = "*"
48 |
49 | [[package]]
50 | name = "pathspec"
51 | version = "0.10.1"
52 | description = "Utility library for gitignore style pattern matching of file paths."
53 | category = "dev"
54 | optional = false
55 | python-versions = ">=3.7"
56 |
57 | [[package]]
58 | name = "platformdirs"
59 | version = "2.5.2"
60 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
61 | category = "dev"
62 | optional = false
63 | python-versions = ">=3.7"
64 |
65 | [package.extras]
66 | docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)", "sphinx (>=4)"]
67 | test = ["appdirs (==1.4.4)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)", "pytest (>=6)"]
68 |
69 | [[package]]
70 | name = "tomli"
71 | version = "2.0.1"
72 | description = "A lil' TOML parser"
73 | category = "dev"
74 | optional = false
75 | python-versions = ">=3.7"
76 |
77 | [metadata]
78 | lock-version = "1.1"
79 | python-versions = "^3.10"
80 | content-hash = "97c4a1e2c836e4cc3e26a0c52e01ed36707df0abd0ea0f9a46202a668d5af2c6"
81 |
82 | [metadata.files]
83 | black = []
84 | click = []
85 | colorama = []
86 | mypy-extensions = []
87 | pathspec = []
88 | platformdirs = []
89 | tomli = []
90 |
--------------------------------------------------------------------------------
/sessions/swe_08/bdsa_greeter/python/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.poetry]
2 | name = "bdsa_greeter"
3 | version = "0.1.0"
4 | description = "Demo CLI application printing a greeting"
5 | authors = ["HelgeCPH "]
6 | license = "MIT"
7 |
8 | [tool.poetry.dependencies]
9 | python = "^3.10"
10 |
11 | [tool.poetry.dev-dependencies]
12 | black = "^22.10.0"
13 |
14 | [build-system]
15 | requires = ["poetry-core>=1.0.0"]
16 | build-backend = "poetry.core.masonry.api"
17 |
18 | [tool.poetry.scripts]
19 | hello = "bdsa_greeter.cli:main"
20 |
--------------------------------------------------------------------------------
/sessions/swe_08/hello.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/hello.dll
--------------------------------------------------------------------------------
/sessions/swe_08/hello.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_08/hello.zip
--------------------------------------------------------------------------------
/sessions/swe_09/images/ISO_25000_internal_qual.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/ISO_25000_internal_qual.png
--------------------------------------------------------------------------------
/sessions/swe_09/images/SE_TDD.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/SE_TDD.png
--------------------------------------------------------------------------------
/sessions/swe_09/images/SE_test_process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/SE_test_process.png
--------------------------------------------------------------------------------
/sessions/swe_09/images/google_test_antipatterns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/google_test_antipatterns.png
--------------------------------------------------------------------------------
/sessions/swe_09/images/google_test_shares.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/google_test_shares.png
--------------------------------------------------------------------------------
/sessions/swe_09/images/google_test_sizes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_09/images/google_test_sizes.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/FSA_arch_characteristics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/FSA_arch_characteristics.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/FSA_overview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/FSA_overview.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/ISO_25000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/ISO_25000.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/ISO_25010_in_use.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/ISO_25010_in_use.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/ISO_25010_product.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/ISO_25010_product.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/ISO_25023.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/ISO_25023.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/boehm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/boehm.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/boehm_metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/boehm_metrics.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/se_metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/se_metrics.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/se_oo_metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/se_oo_metrics.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/se_qual_attributes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/se_qual_attributes.png
--------------------------------------------------------------------------------
/sessions/swe_10/images/se_quality_to_metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_10/images/se_quality_to_metrics.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/abstractness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/abstractness.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/ai_plot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/ai_plot.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/breaking_cycle_input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/breaking_cycle_input.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/cycle_dep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/cycle_dep.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/deps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/deps.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/gitinsight_components.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/gitinsight_components.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/instability.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/instability.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/pino_npm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/pino_npm.png
--------------------------------------------------------------------------------
/sessions/swe_11/images/vcpkg_gephi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_11/images/vcpkg_gephi.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/agilemanifesto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/agilemanifesto.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/helena_paper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/helena_paper.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/royce_waterfall_model1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/royce_waterfall_model1.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/royce_waterfall_model2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/royce_waterfall_model2.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/royce_waterfall_model3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/royce_waterfall_model3.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/royce_waterfall_model4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/royce_waterfall_model4.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_agile_principles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_agile_principles.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_extreme_cycle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_extreme_cycle.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_extreme_practices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_extreme_practices.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_iterative.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_iterative.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_iterative_dev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_iterative_dev.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_userstory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_userstory.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/se_waterfall_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/se_waterfall_model.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/statens_it_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/statens_it_model.png
--------------------------------------------------------------------------------
/sessions/swe_12/images/statens_it_model2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/swe_12/images/statens_it_model2.png
--------------------------------------------------------------------------------
/sessions/swe_12/project_demo.md:
--------------------------------------------------------------------------------
1 | # Schedule for Project Demo Days
2 |
3 | Please check the plan below to see when and in which room your project group presents their work.
4 |
5 | Each group has 15 minutes for presentation.
6 | That is, make sure to be a bit ahead of time in the respective rooms to make the presentation schedule fit.
7 |
8 |
9 |
10 | | Date | Room | Timeslot | TAs | Groups |
11 | |-------------|---------|---------------|-----------------|-----------------------------------------------------------|
12 | | Tue 6/12/22 | 3A12-14 | 12:15 - 13:00 | Mille + Helge | Zero, The fighting mongooses, Cat Squish Gang |
13 | | Tue 6/12/22 | 3A12-14 | 13:15 - 14:00 | Mille + Rasmus | U+1F921, SMB, NEWgIT |
14 | | Tue 6/12/22 | 4A14-16 | 12:15 - 13:00 | Gustav + Rasmus | Gruppe 7, Bravo, FS |
15 | | Tue 6/12/22 | 4A14-16 | 13:15 - 14:00 | Gustav + Helge | The Bear Minimum, Ape in space enterprise, Grupp1 |
16 | | Fri 9/12/22 | 2A12-14 | 12:15 - 13:00 | Mikkel + Rasmus | Bogos; Storskov Inc.; Bad Decisions, Suggestions Accepted |
17 | | Fri 9/12/22 | 4A14-16 | 12:15 - 13:00 | Tamara + Rasmus | InsertProfessionalGroupname, 404 group not found, lars |
18 | | Fri 9/12/22 | 4A14-16 | 13:15 - 14:00 | Tamara + Helge | JTG, gruppen, Ceenja Impact |
19 |
--------------------------------------------------------------------------------
/sessions/the_gilded_rose/images/gilded-rose.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/the_gilded_rose/images/gilded-rose.jpg
--------------------------------------------------------------------------------
/sessions/the_gilded_rose/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # The Gilded Rose
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Refactoring kata
19 |
20 | Kata: Japanese word, literally meaning “form”.
21 |
22 | ~ any basic form, routine, or pattern of behavior that is practiced to various levels of mastery
23 |
24 | Practice makes perfect
25 |
26 | ---
27 |
28 | # Background
29 |
30 | > Hi and welcome to team Gilded Rose. As you know, we are a small inn with a prime location in a prominent city ran by a friendly innkeeper named Allison. We also buy and sell only the finest goods...
31 |
32 | ---
33 |
34 | # Specification
35 |
36 | - All items have a **SellIn** value which denotes the number of days we have to sell the item
37 | - All items have a **Quality** value which denotes how valuable the item is
38 | - At the end of each day our system lowers both values for every item
39 |
40 | Pretty simple, right? Well this is where it gets interesting:
41 |
42 | ...
43 |
44 | We have recently signed a supplier of conjured items. This requires an update to our system:
45 |
46 | - "*Conjured*" items degrade in **Quality** twice as fast as normal items
47 |
48 | ---
49 |
50 | # Implement "*Conjured*"
51 |
52 | ```csharp
53 | using System.Collections.Generic;
54 |
55 | namespace GildedRose.Console
56 | {
57 | class Program
58 | {
59 | IList- Items;
60 | static void Main(string[] args)
61 | {
62 | System.Console.WriteLine("OMGHAI!");
63 |
64 | var app = new Program()
65 | {
66 | Items = new List
-
67 | {
68 | new Item {Name = "+5 Dexterity Vest", SellIn = 10, Quality = 20},
69 | new Item {Name = "Aged Brie", SellIn = 2, Quality = 0},
70 | new Item {Name = "Elixir of the Mongoose", SellIn = 5, Quality = 7},
71 | new Item {Name = "Sulfuras, Hand of Ragnaros", SellIn = 0, Quality = 80},
72 | new Item
73 | {
74 | Name = "Backstage passes to a TAFKAL80ETC concert",
75 | SellIn = 15,
76 | Quality = 20
77 | },
78 | new Item {Name = "Conjured Mana Cake", SellIn = 3, Quality = 6}
79 | }
80 |
81 | };
82 |
83 | app.UpdateQuality();
84 |
85 | System.Console.ReadKey();
86 |
87 | }
88 |
89 | public void UpdateQuality()
90 | {
91 | for (var i = 0; i < Items.Count; i++)
92 | {
93 | if (Items[i].Name != "Aged Brie" && Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
94 | {
95 | if (Items[i].Quality > 0)
96 | {
97 | if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
98 | {
99 | Items[i].Quality = Items[i].Quality - 1;
100 | }
101 | }
102 | }
103 | else
104 | {
105 | if (Items[i].Quality < 50)
106 | {
107 | Items[i].Quality = Items[i].Quality + 1;
108 |
109 | if (Items[i].Name == "Backstage passes to a TAFKAL80ETC concert")
110 | {
111 | if (Items[i].SellIn < 11)
112 | {
113 | if (Items[i].Quality < 50)
114 | {
115 | Items[i].Quality = Items[i].Quality + 1;
116 | }
117 | }
118 |
119 | if (Items[i].SellIn < 6)
120 | {
121 | if (Items[i].Quality < 50)
122 | {
123 | Items[i].Quality = Items[i].Quality + 1;
124 | }
125 | }
126 | }
127 | }
128 | }
129 |
130 | if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
131 | {
132 | Items[i].SellIn = Items[i].SellIn - 1;
133 | }
134 |
135 | if (Items[i].SellIn < 0)
136 | {
137 | if (Items[i].Name != "Aged Brie")
138 | {
139 | if (Items[i].Name != "Backstage passes to a TAFKAL80ETC concert")
140 | {
141 | if (Items[i].Quality > 0)
142 | {
143 | if (Items[i].Name != "Sulfuras, Hand of Ragnaros")
144 | {
145 | Items[i].Quality = Items[i].Quality - 1;
146 | }
147 | }
148 | }
149 | else
150 | {
151 | Items[i].Quality = Items[i].Quality - Items[i].Quality;
152 | }
153 | }
154 | else
155 | {
156 | if (Items[i].Quality < 50)
157 | {
158 | Items[i].Quality = Items[i].Quality + 1;
159 | }
160 | }
161 | }
162 | }
163 | }
164 |
165 | }
166 |
167 | public class Item
168 | {
169 | public string Name { get; set; }
170 |
171 | public int SellIn { get; set; }
172 |
173 | public int Quality { get; set; }
174 | }
175 |
176 | }
177 | ```
178 |
179 | ---
180 |
181 | > "make the change easy (warning: this may be hard), then make the easy change"
182 |
183 | Kent Beck, 2012
184 |
185 | ---
186 |
187 | # Refactoring
188 |
189 | But first: **MAKE THEN CHANGE SAFE!**
190 |
191 | Ensure ~100% code coverage in `Program.cs` - specifically the `UpdateQuality()` method.
192 |
193 | Test `Main` to verify that in generates the same output
194 |
195 | (```dotnet run > output.txt```)
196 |
197 | Now fix!
198 |
199 | Extract method --> Polymorphism
200 |
201 | ---
202 |
203 | # Code Coverage
204 |
205 | [Use code coverage for unit testing](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage)
206 |
207 | **TODO**: Confirm works and prints code coverage
208 |
209 | ```bash
210 | dotnet add package coverlet.msbuild
211 | dotnet test /p:CollectCoverage=true
212 | ```
213 |
214 | ```txt
215 | +-----------------------+------+--------+--------+
216 | | Module | Line | Branch | Method |
217 | +-----------------------+------+--------+--------+
218 | | GildedRose | 0% | 0% | 0% |
219 | +-----------------------+------+--------+--------+
220 | ```
221 |
222 | ---
223 |
224 | # Resources
225 |
226 | Martin Fowler on Refactoring:
227 |
228 | Sandy Metz on solving the Guilded Rose in Ruby:
229 |
230 | The original Gilded Rose by Terry Hughes and Bobby Johnson:
231 |
232 | More katas:
233 |
--------------------------------------------------------------------------------
/sessions/the_gilded_rose_recap/images/gilded-rose.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/itu-bdsa/lecture-notes/896656a0910eb43dfd371cce9917dd8a25a4bf58/sessions/the_gilded_rose_recap/images/gilded-rose.jpg
--------------------------------------------------------------------------------
/sessions/the_gilded_rose_recap/slides.md:
--------------------------------------------------------------------------------
1 | ---
2 | marp: true
3 | author: Rasmus Lystrøm
4 | theme: default
5 | class: invert
6 | ---
7 |
8 | # The Gilded Rose (Recap)
9 |
10 | 
11 |
12 | Rasmus Lystrøm
13 | Associate Professor
14 | ITU
15 |
16 | ---
17 |
18 | # Code Metrics (Visual Studio Enterprise)
19 |
20 | **Maintainabilityability Index**: Between 0 and 100. Higher is better. Aim for higher than 20
21 |
22 | **Cyclomaticmatic Complexity**: Lower is better. Split methods with complexity > 10
23 |
24 | **Lines of Source Code** / **Lines of Executable Code**
25 |
26 | **Inheritance of Inheritance**: Between 1 and infinity. Lower is better, but sometimes inheritance is good
27 |
28 | **Class Coupling**: Lower is better. Aim for max 9
29 |
30 | Source: [Code metrics values](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-values).
31 |
32 | ---
33 |
34 | # Code Metrics: Original
35 |
36 | | |Maintainability|Cyclomatic|Inheritance|Coupling|LoC|Exe.Code|
37 | |:----|:---:|:---:|:---:|:---:|:---:|:---:|
38 | |Program|50|22|1|4|131|34|
39 | |Item|100|6|1|0|8|0|
40 | |Total|75|28|1|4|144|34|
41 |
42 | ---
43 |
44 | # Approach
45 |
46 | Understand the task at hand – inspect the code
47 | Write tests to ensure the program works to specification
48 | Refactor, refactor, refactor
49 | Extract methods
50 | Implement *Conjured*
51 | Refactor, refactor, refactor
52 |
53 | 1. Introduce polymorphism?
54 | 1. Immutable, functional, pattern matching?
55 |
56 | ---
57 |
58 | # The Gilded Rose in C♯
59 |
60 | ## Demo
61 |
62 | ---
63 |
64 | # Code Metrics: Refactored (Make the Change Easy)
65 |
66 | | |Maintainability|Cyclomatic|Inheritance|Coupling|LoC|Exe.Code|
67 | |:----|:---:|:---:|:---:|:---:|:---:|:---:|
68 | |Program|58|3|1|5|52|9|
69 | |Item|100|6|1|0|8|0|
70 | |GildedRose|72|16|1|3|74|22|
71 | |Total|76|25|1|6|142|31|
72 |
73 | ---
74 |
75 | # Code Metrics: Refactored (Polymorphed)
76 |
77 | | |Maintainability|Cyclomatic|Inheritance|Coupling|LoC|Exe.Code|
78 | |:----|:---:|:---:|:---:|:---:|:---:|:---:|
79 | |Program|58|3|1|8|34|9|
80 | |Item|91|8|1|1|21|5|
81 | | AgedBrie|71|2|2|2|15|5|
82 | | Backst.P.|63|4|2|2|23|9|
83 | | Sulfuras|100|1|2|1|6|0|
84 | | Conjured|71|2|2|2|15|5|
85 | |Total|75|20|2|9|132|33|
86 |
87 | ---
88 |
89 | # Code Metrics: Refactored (Immutable/Functional)
90 |
91 | | |Maintainability|Cyclomatic|Inheritance|Coupling|LoC|Exe.Code|
92 | |:----|:---:|:---:|:---:|:---:|:---:|:---:|
93 | |Program|68|3|1|8|33|10|
94 | |GildedRose|69|12|1|6|81|30|
95 | |Item|100|1|1|1|1|0|
96 | |ItemType|100|1|1|0|1|0|
97 | |Total|84|17|1|10|125|40|
98 |
99 | ---
100 |
101 | # The Gilded Rose in F♯
102 |
103 | ## Demo
104 |
105 | ---
106 |
107 | # Summary
108 |
109 | | |Maintainability|Cyclomatic|Inheritance|Coupling|LoC|Exe.Code|
110 | |:----|:---:|:---:|:---:|:---:|:---:|:---:|
111 | |Original|75|28|1|4|144|34|
112 | |Refactored|76|25|1|6|142|31|
113 | |Polymorp.|75|20|2|9|132|33|
114 | |Functional|84|17|1|10|125|40|
115 | |F♯| | | | |64| |
116 |
117 | ---
118 |
119 | # Conclusion / Discussion
120 |
--------------------------------------------------------------------------------