index.html 16.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<html>
<head>
	<title>Patterns und Frameworks</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/bootstrap-4-navbar.css">
	<link rel="stylesheet" href="css/prism.css">
	<link rel="stylesheet" href="css/preloader.min.css">
	<link rel="shortcut icon" href="img/favicon.ico">
	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" async></script>
	<script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} });</script>
	<script src="js/bootstrap-4-navbar.js"></script>	
17
18
	<script src="js/prism.js"></script>
	<script src="https://kit.fontawesome.com/083ef4a4ae.js"></script>
19
20
21
22
	<script>

  // document ready handler
	$(function() {
Jens Ehlers's avatar
Jens Ehlers committed
23
		if (document.location.hash == "") document.location.hash = "unit-goals"; 
24
25
26
		displayUnit(document.location.hash);
		$(".dropdown-item").on("click", function() { displayUnit('#'+$(this).attr("id")); });
		
Jens Ehlers's avatar
Jens Ehlers committed
27
28
29
30
31
		// back and forward navigation
		window.onhashchange = function() {	
			displayUnit(document.location.hash);
		};

32
33
34
35
36
37
38
39
40
41
42
43
		$("label").prepend("Abb.: ");
		$(".source").each(function() {
			var source = $(this).html();
			$(this).html('Quelle: <a href="' + source + '">' + source + '</a>');
		}); 
		
		$('div[id^="code"]').each(function() {
			$(this).css('margin-top', '20px');
			var id = $(this).attr('id');
			$(this).load('code/'+id+'.html');
		});
		
Jens Ehlers's avatar
Jens Ehlers committed
44
		// load module units
45
46
47
48
		$('div[class="unit-part"]').each(function() {
			var filename = $(this).attr('id');
			$(this).load(filename + '.html', function() { // try this with $.get
				Prism.highlightAll();
Jens Ehlers's avatar
Jens Ehlers committed
49

50
				// add repo links
Jens Ehlers's avatar
Jens Ehlers committed
51
				$("#" + filename + " .repo-link").each(function() {
Jens Ehlers's avatar
Jens Ehlers committed
52
					var href = 'https://git.mylab.th-luebeck.de/oncampus/patterns-and-frameworks/blob/master' + $(this).attr('href');
53
54
					$(this).attr('href', href);
				});
Jens Ehlers's avatar
Jens Ehlers committed
55
56
57
58

				// open external links in new tab
				$("#" + filename + " a").each(function() {
					 var href = $(this).attr('href');
59
					 if (typeof href !== "undefined" && href.startsWith("http")) $(this).attr('target', '_blank'); 
Jens Ehlers's avatar
Jens Ehlers committed
60
				});
61
62
63
64
65
66
67
68
69
70
71

				// generate listing titles for print view
				$("#" + filename +  " .tab-pane").each(function() {
					var title = $('a[href="#'+ $(this).attr('id') +'"]').html();
					$(this).prepend('<div class="print-title">' + title + '</div>');
				});
				
				// display all listings below each other for print view
				if (urlParams.get('show') == "all") {
					$('.tab-pane').css('display', 'block');
				}
72
73
74
75
76
			});

			var id = $(this).parent().attr('id').replace('content-', '');
			var title = $('#' + id).html();
			$("#content-" + id).prepend("<h3>"+title+"</h3>");
77
78
79
			
			// page break before each h3 in print view
			$("h3").each(function() { $(this).addClass('page-break'); });
80
81
		});

Jens Ehlers's avatar
Jens Ehlers committed
82
		// search event handlers
83
84
85
86
		$('#search input').on('focusout', function() {
			search($(this).val().toLowerCase());
		});
		$('#search input').keypress(function(e) {
Jens Ehlers's avatar
Jens Ehlers committed
87
88
			if (e.which == 13) { // enter key
				search($(this).val().toLowerCase());
89
90
91
			}
		});

92
93
94
95
96
97
98
99
100
101
102
103
		// display all units for pdf export
		var urlParams = new URLSearchParams(window.location.search);
		if (urlParams.get('show') == "all") {
			$("[id^=content-unit-]").show();
		}

		// generate toc for print view
		$('.toc').append($('.navbar-nav').clone());
		$('.toc').find('.navbar-nav').removeClass('navbar-nav');
		$('.toc').find('.dropdown-menu').removeClass('dropdown-menu');
		$('.toc').find('.dropdown-toggle').removeClass('dropdown-toggle');

Jens Ehlers's avatar
Jens Ehlers committed
104
		// finish preloading animation
105
		$(window).on("load", function() {
Jens Ehlers's avatar
Jens Ehlers committed
106
107
			$("body").addClass("loaded");
		});
108
109
110
111
112
113
	});

	function displayUnit(id) {
		if (id == "#undefined") return;
		document.location.hash = id;
		$("[id^=content-unit-]").hide();
Jens Ehlers's avatar
Jens Ehlers committed
114
115
116
		
		var id_nohash = id.substring(1);
		if (id.startsWith("#cite-")) id_nohash = 'unit-goals';
117
		$("#content-"+id_nohash).show();
Jens Ehlers's avatar
Jens Ehlers committed
118
119
120
		
		var top = (id.startsWith("#cite-") && $(id).offset() !== undefined) ? $(id).offset().top : 0;
		window.scrollTo(0, top);
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
	}

	function search(searchTerm) {
		if (searchTerm.length < 3) return;
		$('#search-results').empty();
		$("[id^=content-unit-]").each(function() {
			var id = $(this).attr('id').replace('content-', '');
			var title = $(this).children('h3').html();
			$(this).children('.unit-part').find('h4, p, span, li:not(.nav-item)').each(function() {
				if ($(this).html().toLowerCase().indexOf(searchTerm) != -1) { // search term found
					var text = $(this).html();
					term = searchTerm.replace(/(\s+)/,"(<[^>]+>)*$1(<[^>]+>)*");
					var pattern = new RegExp("("+term+")", "gi");
					text = text.replace(pattern, "<mark>$1</mark>");
					text = text.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\/mark>)/,"$1</mark>$2<mark>$4");
					$('#search-results').append('<div class="search-result"><a href="#' + id + '" class="navigate"><h4>' + title + '</h4></a>' + text + '</div>');
					$(".navigate").on("click", function() { displayUnit($(this).attr("href")); });
				}
			});
		});
		if ($('#search-results').children().length == 0) {
			$('#search-results').html("Keine Suchtreffer.");
		}
		displayUnit('#unit-search-results');
	}

	</script>
	<style>
		video, iframe { width: 600px; max-width: 100%; }
		iframe { margin: 20px; display: block; }
		label { display: block; font-size: 13px; font-style: italic; font-weight: 600; margin: 10px 0 15px 0; }
		h4 { font-size: 20px; margin-top: 20px; }
		img { max-width: 100%; margin-top: 10px; }
		.func_module { color: #007bff; }
		.source { color: #007bff; font-size: 12px; margin-top: -12px; margin-bottom: 15px; position: relative; top: -15px; }
		.term { font-style: italic; }
		.less_important { color: #cccccc !important; }
		.cite { padding: 8px; background-color: #333333; color: white; font-style: italic; margin-bottom: 10px; border-radius: 4px;}
		.cite a { color: white; }
		.cite a:hover { text-decoration: none; }
		.title { position: relative; background-image: url('img/bg_min.jpg'); background-repeat: no-repeat; background-size: 100% auto; margin-bottom: 0; height: 270px; }
		@media only screen and (max-width: 880px) { .title { background-size: auto 100%; }}
		.title h1 { position: relative; color: #fff;  }
		.title .overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; opacity: 0.75; }
		.title .lead { position: relative; color: #fff; }
		#content { max-width: 1170px; margin-left: auto; margin-right: auto; }
		nav { background-color: #eee; }
		.dropdown-menu { background-color: #fcfcfc; border-color: #ccc; }
		.dropdown-item:hover { background-color: #007bff; color: #fff !important; }
		.search-result { margin-bottom: 30px; }
		mark { background-color: yellow; }
		b, th { font-weight: 600; }
		td { vertical-align: top; }
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
		.table-head-row { background-color: #ccc; }
		#pdf { z-index: 100; position: absolute; top: 10px; right: 10px; width: 24px; }
		#pdf a { color: #ffffff; font-size: 24px; }
		
		@media screen { .credits, .toc, .print-title { display: none; } }
		@media print {
			@page { margin: 2cm; }
			.page-break { page-break-before: always; }
			#content { display: table; }
			.jumbotron { background-image: none; background-color: white; }
			.jumbotron .lead, .jumbotron h1 { color: #212529; }
			.jumbotron .lead { font-size: 20pt; margin-bottom: 31cm; }
			.credits, .toc { color: #212529; padding-left: 15px; page-break-after: always; }
			#pdf, .nav-tabs, .overlay { display: none; }
			.print-title { font-weight: 600; }
			.tab-pane { page-break-inside: avoid; }
			pre code { font-size: 12px; }
		}
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
	</style>
</head>
<body>
	<div id="loader-wrapper">
			<div class="loader">
				<div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div>				
		</div>
		<div class="text">Das Modul wird geladen.</div>
	</div>
	<div class="jumbotron jumbotron-fluid title">	
		<div class="overlay"></div>
	  <div class="container">
			<h1 class="display-4">Patterns und Frameworks</h1>
			<p class="lead">für die Entwicklung paralleler und verteilter Anwendungen in Java</p>
		</div>
207
208
209
210
211
		<div class="credits">
			<p>Verfasser: Prof. Dr. Jens Ehlers, Technische Hochschule Lübeck</p>
			<p>Webseite: <a href="https://oncampus.pages.th-luebeck.de/patterns-and-frameworks">https://oncampus.pages.th-luebeck.de/patterns-and-frameworks</a></p>
			<p>GitLab: <a href="https://git.mylab.th-luebeck.de/oncampus/patterns-and-frameworks">https://git.mylab.th-luebeck.de/oncampus/patterns-and-frameworks</a></p>
		</div>
212
	</div>
213
	<div class="toc"><h3>Inhaltsverzeichnis</h3></div>
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268

	<nav class="navbar navbar-expand-lg navbar-light">
	  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
		<span class="navbar-toggler-icon"></span>
	  </button>

	  <div class="collapse navbar-collapse" id="navbar">
		<ul class="navbar-nav mr-auto">		
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">Einleitung</a>
			<ul class="dropdown-menu">
				<li><a class="dropdown-item" id="unit-goals">Ziele und Struktur des Moduls</a></li>
			  <li><a class="dropdown-item" id="unit-exam">Softwareprojekt als Prüfungsleistung</a></li>				
			  <li><a class="dropdown-item" id="unit-uml">Objektorientierung und UML-Klassendiagramm</a></li>
			</ul>			
		  </li>		
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">Entwurfsmuster</a>
			<ul class="dropdown-menu">
			  <li><a class="dropdown-item" id="unit-design-patterns-intro">Einführung in Entwurfsmuster</a></li>
			  <li><a class="dropdown-item dropdown-toggle">Erzeugungsmuster</a>
				<ul class="dropdown-menu">
				  <li><a class="dropdown-item" id="unit-singleton">Singleton</a></li>
				  <li><a class="dropdown-item" id="unit-factory_method">Fabrikmethode</a></li>
				  <li><a class="dropdown-item" id="unit-dependency_injection">Dependency Injection</a></li>
				</ul>			  
			  </li>
			  <li><a class="dropdown-item dropdown-toggle">Strukturmuster</a>			  
				<ul class="dropdown-menu">
				  <li><a class="dropdown-item" id="unit-composite">Kompositum</a></li>
				  <li><a class="dropdown-item" id="unit-adapter">Adapter</a></li>
				  <li><a class="dropdown-item" id="unit-facade">Fassade</a></li>
				  <li><a class="dropdown-item" id="unit-proxy">Proxy</a></li>
				</ul>
			  </li>
			  <li><a class="dropdown-item dropdown-toggle">Verhaltensmuster</a>
				<ul class="dropdown-menu">
				  <li><a class="dropdown-item" id="unit-observer">Beobachter</a></li>
				  <li><a class="dropdown-item" id="unit-strategy">Strategie</a></li>
				</ul>
			  </li>				  
			</ul>			
		  </li>
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">Architektur</a>
			<ul class="dropdown-menu">
			  <li><a class="dropdown-item" id="unit-architecture">Modularisierung und Architektur</a></li>			
			  <li><a class="dropdown-item" id="unit-tiers">Schichtenarchitektur</a></li>
			  <li><a class="dropdown-item" id="unit-mvc">Model-View-Controller</a></li>
			  <li><a class="dropdown-item" id="unit-mvc-mvvm-javafx">MVC und MVVM in JavaFX</a></li>
			  <!-- <li><a class="dropdown-item" id="unit-microservices">Microservices</a></li> -->
			</ul>			
		  </li>
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">Verteilte Programmierung</a>
269
270
271
272
273
274
275
276
277
278
			<ul class="dropdown-menu">			  
				<li><a class="dropdown-item" id="unit-distributed-communication">Kommunikation und Skalierbarkeit im verteilten System</a></li>
			  <li><a class="dropdown-item" id="unit-rmi">Remote Method Invocation (RMI)</a></li>
				<li><a class="dropdown-item" id="unit-soap">SOAP-Webservices</a></li>	  
				<li><a class="dropdown-item" id="unit-rest">REST-Webservices</a></li>
				<li><a class="dropdown-item" id="unit-orm">Object-Relational Mapping (ORM)</a></li>
				<li><a class="dropdown-item" id="unit-spring">REST und Reactive Streams in Spring</a></li>
				<li><a class="dropdown-item" id="unit-websocket">WebSockets</a></li>
				<li><a class="dropdown-item" id="unit-socket">Sockets</a></li>			  
			</ul>
279
280
281
		  </li> 		  		  
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">Nebenläufige Programmierung</a>
282
283
284
285
286
			<ul class="dropdown-menu">
				<li> <a class="dropdown-item" id="unit-threads">Threads in Java</a></li>
				<li> <a class="dropdown-item" id="unit-sync">Synchronisation von Threads</a></li>
				<li> <a class="dropdown-item" id="unit-streams">Futures und parallele Streams</a></li>
			</ul>
287
288
289
		  </li> 
		  <li class="nav-item dropdown">
			<a class="nav-link dropdown-toggle" data-toggle="dropdown">UI-Frameworks</a>
290
291
292
293
			<ul class="dropdown-menu">
				<li><a class="dropdown-item" id="unit-javafx">Desktop-Anwendungen mit JavaFX</a></li>
				<li><a class="dropdown-item" id="unit-web">Web-Anwendungen mit jQuery und Angular</a></li>
			</ul>
294
295
296
297
298
		  </li>	
		</ul>
		<div id="search">
			<input class="form-control" type="text" placeholder="Suche (min. 3 Zeichen)" aria-label="Search">
			<span id="unit-search-results" style="display: none">Suchergebnisse</span>
299
		</div>			
300
301
302
303
	  </div>
	</nav>
	
	<div id="content" style="padding:30px">
304
		<div id="pdf"><a href="patterns-and-frameworks.pdf"><i class="far fa-file-pdf"></i></a></div>	
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373

		<div id="content-unit-goals">			
			<div class="unit-part" id="intro-goals"></div>	
		</div>	

		<div id="content-unit-exam">			
				<div class="unit-part" id="intro-exam"></div>	
			</div>

		<div id="content-unit-uml">			
			<div class="unit-part" id="intro-uml"></div>	
		</div>			
		
		<div id="content-unit-design-patterns-intro">			
			<div class="unit-part" id="design-patterns"></div>	
		</div>

		<div id="content-unit-singleton">			
			<div class="unit-part" id="design-patterns-singleton"></div>	
		</div>	

		<div id="content-unit-factory_method">			
			<div class="unit-part" id="design-patterns-factory_method"></div>	
		</div>			
		
		<div id="content-unit-dependency_injection">			
			<div class="unit-part" id="design-patterns-dependency_injection"></div>	
		</div>	
		
		<div id="content-unit-adapter">			
			<div class="unit-part" id="design-patterns-adapter"></div>	
		</div>
		
		<div id="content-unit-composite">			
			<div class="unit-part" id="design-patterns-composite"></div>	
		</div>	

		<div id="content-unit-facade">			
			<div class="unit-part" id="design-patterns-facade"></div>	
		</div>	
		
		<div id="content-unit-proxy">			
			<div class="unit-part" id="design-patterns-proxy"></div>	
		</div>	
		
		<div id="content-unit-observer">			
			<div class="unit-part" id="design-patterns-observer"></div>	
		</div>			
		
		<div id="content-unit-strategy">			
			<div class="unit-part" id="design-patterns-strategy"></div>	
		</div>		
		
		<div id="content-unit-architecture">			
			<div class="unit-part" id="architecture-components"></div>	
		</div>
		
		<div id="content-unit-tiers">			
			<div class="unit-part" id="architecture-tiers"></div>	
		</div>		

		<div id="content-unit-mvc">			
			<div class="unit-part" id="architecture-mvc"></div>	
		</div>
		
		<div id="content-unit-mvc-mvvm-javafx">			
			<div class="unit-part" id="architecture-mvc-mvvm-javafx"></div>	
		</div>
		
Jens Ehlers's avatar
Jens Ehlers committed
374
		<!-- <div id="content-unit-microservices">			
375
			<div class="unit-part" id="architecture-microservices"></div>	
Jens Ehlers's avatar
Jens Ehlers committed
376
		</div> -->
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
		
		<div id="content-unit-distributed-communication">			
			<div class="unit-part" id="distributed-communication"></div>	
		</div>

		<div id="content-unit-rmi">			
			<div class="unit-part" id="distributed-rmi"></div>	
		</div>
		
		<div id="content-unit-soap">			
			<div class="unit-part" id="distributed-soap"></div>	
		</div>	

		<div id="content-unit-rest">			
			<div class="unit-part" id="distributed-rest"></div>	
		</div>	

		<div id="content-unit-orm">			
			<div class="unit-part" id="distributed-orm"></div>	
		</div>	
		
		<div id="content-unit-spring">			
			<div class="unit-part" id="distributed-spring"></div>	
		</div>					
		
		<div id="content-unit-socket">			
			<div class="unit-part" id="distributed-socket"></div>	
		</div>	

		<div id="content-unit-websocket">			
			<div class="unit-part" id="distributed-websocket"></div>	
		</div>

		<div id="content-unit-threads">			
			<div class="unit-part" id="concurrency-threads"></div>	
		</div>		
		
		<div id="content-unit-sync">			
			<div class="unit-part" id="concurrency-sync"></div>	
		</div>	
		
		<div id="content-unit-streams">
			<div class="unit-part" id="concurrency-streams"></div>
		</div>

		<div id="content-unit-javafx">			
			<div class="unit-part" id="ui-javafx"></div>	
		</div>
		
		<div id="content-unit-web">			
			<div class="unit-part" id="ui-web"></div>	
		</div>		

		<div id="content-unit-search-results">
				<div id="search-results"></div>	
		</div

	</div>
</body>
</html>