Skip to content

Commit

Permalink
deploy: 195b165
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonajo committed May 7, 2024
1 parent c4cbfe8 commit 65b00e6
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docs/database-access/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">05 JPMS, Lambda and Streams</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/database-access/ class="block border-l pl-4 -ml-px
border-slate-500 dark:border-slate-400 text-black dark:text-slate-200">06 Database Access JDBC</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/javafx/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">07 JavaFX</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/statemachine/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_java_database_connectivity>Java DataBase Connectivity</a><ol class="toc-list level-2"><li><a href=#_database_connection_credentials_and_java_properties>DataBase connection credentials and Java Properties</a></li><li><a href=#_using_a_data_source>Using a Data source</a></li><li><a href=#_resultset>ResultSet</a></li><li><a href=#_anatomy_of_a_prepared_statement>Anatomy of a prepared statement</a></li><li><a href=#_database_meta_information>Database Meta Information</a></li><li><a href=#_check_constraints>Check constraints</a></li></ol></li><li><a href=#_transactions>Transactions</a></li><li><a href=#_using_stored_procedures>Using Stored Procedures</a></li></ol></nav><section class="doc-section level-1"><h2 id=_java_database_connectivity>Java DataBase Connectivity</h2><section class="doc-section level-2"><h3 id=_database_connection_credentials_and_java_properties>DataBase connection credentials and Java Properties</h3><p>Some things do <mark>NOT</mark> belong in source code. In particular do not put <strong>credentials</strong> of any kind
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/reflection/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">09 Reflection</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_java_database_connectivity>Java DataBase Connectivity</a><ol class="toc-list level-2"><li><a href=#_database_connection_credentials_and_java_properties>DataBase connection credentials and Java Properties</a></li><li><a href=#_using_a_data_source>Using a Data source</a></li><li><a href=#_resultset>ResultSet</a></li><li><a href=#_anatomy_of_a_prepared_statement>Anatomy of a prepared statement</a></li><li><a href=#_database_meta_information>Database Meta Information</a></li><li><a href=#_check_constraints>Check constraints</a></li></ol></li><li><a href=#_transactions>Transactions</a></li><li><a href=#_using_stored_procedures>Using Stored Procedures</a></li></ol></nav><section class="doc-section level-1"><h2 id=_java_database_connectivity>Java DataBase Connectivity</h2><section class="doc-section level-2"><h3 id=_database_connection_credentials_and_java_properties>DataBase connection credentials and Java Properties</h3><p>Some things do <mark>NOT</mark> belong in source code. In particular do not put <strong>credentials</strong> of any kind
inside files that are committed to a version control system, such as source code. Make sure you configure your
version control system such that such files are excluded from commits.</p><p>Instead put credentials in separate files, that are easily understood by both a human that uses it
to configure access to a resource, and also by the programming language.<br>In java the tradition is to use so called properties files, which, also traditionally, have a file extension <code>.properties</code>.
Expand Down
3 changes: 2 additions & 1 deletion docs/design-for-testability/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">05 JPMS, Lambda and Streams</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/database-access/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">06 Database Access JDBC</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/javafx/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">07 JavaFX</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/statemachine/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_faking_as_a_testing_technique>Faking as a testing technique</a><ol class="toc-list level-2"><li><a href=#_stay_cool_have_a_mockito>Stay cool, have a Mockito.</a></li><li><a href=#_to_mock_or_to_configure>To Mock or To Configure</a></li></ol></li><li><a href=#_design_for_test_ability>Design for Test-ability</a><ol class="toc-list level-2"><li><a href=#_business_class_fit_for_testing>Business class fit for testing</a></li></ol></li></ol></nav><section class="doc-section level-1"><h2 id=_faking_as_a_testing_technique>Faking as a testing technique</h2><p><strong class=big>"When you can’t or won’t make it, Fake it"</strong></p><p>Let’s revisit the movie making metaphor. We know that almost everything in that industry
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/reflection/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">09 Reflection</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_faking_as_a_testing_technique>Faking as a testing technique</a><ol class="toc-list level-2"><li><a href=#_stay_cool_have_a_mockito>Stay cool, have a Mockito.</a></li><li><a href=#_to_mock_or_to_configure>To Mock or To Configure</a></li></ol></li><li><a href=#_design_for_test_ability>Design for Test-ability</a><ol class="toc-list level-2"><li><a href=#_business_class_fit_for_testing>Business class fit for testing</a></li></ol></li></ol></nav><section class="doc-section level-1"><h2 id=_faking_as_a_testing_technique>Faking as a testing technique</h2><p><strong class=big>"When you can’t or won’t make it, Fake it"</strong></p><p>Let’s revisit the movie making metaphor. We know that almost everything in that industry
is fake, or maybe more politely <em>make-belief</em>. In that it only needs to look convincing without being the real thing.
So for instance, when someone needs to be hit hard in the face, it will not really be done and to make sure nothing untoward happens to
the expensive actors, they may be replaced by <em>stunt</em> men and women, so the punch will never land on the pretty face.</p><p>In our industry we have other reasons to <em>not</em> use the real thing.</p><div class=ulist><ul><li>It is not available (yet).</li><li>It is expensive (as in slow) to use and we want our tests to be quick.</li><li>We want to test behavior under circumstances that are rare, and difficult to achieve with the real thing.</li><li>It is inconvenient to use.</li></ul></div><p>What we do is replace the <strong>"Dependent On Components"</strong> by so called <strong class=blue>mocks</strong>.<br><strong>In all cases</strong>, the System Under Test (SUT), the class we are testing <strong>is always used as is</strong>. So we have no stunt doubles for our protagonist.
Expand Down
3 changes: 2 additions & 1 deletion docs/generics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">05 JPMS, Lambda and Streams</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/database-access/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">06 Database Access JDBC</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/javafx/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">07 JavaFX</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/statemachine/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_generics>Generics</a><ol class="toc-list level-2"><li><a href=#_generics_the_fine_print>Generics, the fine print</a></li><li><a href=#_cheating_the_compiler>Cheating the compiler</a></li><li><a href=#_wildcard_and_bounds>Wildcard and bounds</a></li><li><a href=#_lower_bound_or_contra_variant>Lower bound or Contra variant</a></li><li><a href=#_self_use_in_generic_definitions>Self use in Generic definitions</a></li></ol></li><li><a href=#_dynamic_type_information>Dynamic type information</a><ol class="toc-list level-2"><li><a href=#_isassignablefrom_will_a_cast_work>isAssignableFrom. Will a cast work?</a></li><li><a href=#_testing_generics>Testing generics</a></li></ol></li><li><a href=#_reading>Reading</a></li></ol></nav><section class="doc-section level-1"><h2 id=_generics>Generics</h2><p>Generics is mainly a compiler feature. In java (at least the versions up to this moment, March 2022) it
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">08 The State of Things</a></li><li><a href=https://fontysvenlo.github.io/prc2/docs/reflection/ class="block border-l pl-4 -ml-px
border-transparent hover:border-slate-400 dark:hover:border-slate-400 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-200">09 Reflection</a></li></ul></li></ul></nav></aside><div class=lg:pl-[19.5rem]><div class="max-w-3xl mx-auto xl:max-w-none xl:ml-0 xl:mr-[15.5rem] xl:pr-16"><article id=main-content class="prose prose-slate dark:prose-invert max-w-none dark:prose-a:text-fuchsia-400 prose-a:text-fuchsia-500"><nav id=toc class=toc role=doc-toc><h2 id=toc-title>Table of Contents</h2><ol class="toc-list level-1"><li><a href=#_generics>Generics</a><ol class="toc-list level-2"><li><a href=#_generics_the_fine_print>Generics, the fine print</a></li><li><a href=#_cheating_the_compiler>Cheating the compiler</a></li><li><a href=#_wildcard_and_bounds>Wildcard and bounds</a></li><li><a href=#_lower_bound_or_contra_variant>Lower bound or Contra variant</a></li><li><a href=#_self_use_in_generic_definitions>Self use in Generic definitions</a></li></ol></li><li><a href=#_dynamic_type_information>Dynamic type information</a><ol class="toc-list level-2"><li><a href=#_isassignablefrom_will_a_cast_work>isAssignableFrom. Will a cast work?</a></li><li><a href=#_testing_generics>Testing generics</a></li></ol></li><li><a href=#_reading>Reading</a></li></ol></nav><section class="doc-section level-1"><h2 id=_generics>Generics</h2><p>Generics is mainly a compiler feature. In java (at least the versions up to this moment, March 2022) it
is even more so, because after the compiler had it’s go with it, it largely discards the generic information, and the runtime, the JVM,
does not really care about generics and does not use it. The role of generics is to keep the programs type-safe.
The compiler will check that a use of a method, field, or class complies with its definition,
Expand Down
Loading

0 comments on commit 65b00e6

Please sign in to comment.