This commit is contained in:
waldo1001 2021-12-01 14:50:51 +00:00
parent 5a801fae69
commit 2834098a70
135 changed files with 2660 additions and 2660 deletions

View file

@ -5,16 +5,16 @@
<meta name=generator content="Hugo 0.89.4">
<meta name=description content>
<title>Generic Method Pattern :: AL Guidelines</title>
<link href=/css/nucleus.css?1637566650 rel=stylesheet>
<link href=/css/fontawesome-all.min.css?1637566650 rel=stylesheet>
<link href=/css/featherlight.min.css?1637566650 rel=stylesheet>
<link href=/css/perfect-scrollbar.min.css?1637566650 rel=stylesheet>
<link href=/css/auto-complete.css?1637566650 rel=stylesheet>
<link href=/css/theme.css?1637566650 rel=stylesheet>
<link href=/css/theme-blue.css?1637566650 rel=stylesheet>
<link href=/css/variant.css?1637566650 rel=stylesheet>
<link href=/css/print.css?1637566650 rel=stylesheet media=print>
<script src=/js/jquery.min.js?1637566650></script>
<link href=/css/nucleus.css?1638370247 rel=stylesheet>
<link href=/css/fontawesome-all.min.css?1638370247 rel=stylesheet>
<link href=/css/featherlight.min.css?1638370247 rel=stylesheet>
<link href=/css/perfect-scrollbar.min.css?1638370247 rel=stylesheet>
<link href=/css/auto-complete.css?1638370247 rel=stylesheet>
<link href=/css/theme.css?1638370247 rel=stylesheet>
<link href=/css/theme-blue.css?1638370247 rel=stylesheet>
<link href=/css/variant.css?1638370247 rel=stylesheet>
<link href=/css/print.css?1638370247 rel=stylesheet media=print>
<script src=/js/jquery.min.js?1638370247></script>
<style>:root #header+#content>#left>#rlblock_left{display:none!important}</style>
</head>
<body data-url=/bcpatterns/generic-method-pattern/>
@ -32,9 +32,9 @@ ALGuidelines.Dev
<input data-search-input id=search-by type=search placeholder=Search...>
<span data-search-clear><i class="fas fa-times"></i></span>
</div>
<script src=/js/lunr.min.js?1637566650></script>
<script src=/js/auto-complete.js?1637566650></script>
<script src=/js/search.js?1637566650></script>
<script src=/js/lunr.min.js?1638370247></script>
<script src=/js/auto-complete.js?1638370247></script>
<script src=/js/search.js?1638370247></script>
</div>
<div class=highlightable>
<ul class=topics>
@ -335,7 +335,7 @@ The idea is to put the code in one <em>encapsulated</em> codeunit with the purpo
</ul>
<p><em>The UI layer</em>
The UI layer takes care of the UI, obviously. What is important in this case, is that you always make sure that there is a &ldquo;HideDialog&rdquo; parameter that the business logic can use to still decide whether to use the dialog or not.</p>
<p>These are the UI Layer parts, where you see the public function gets the HideDialog, and passes it to the UI-related procedures, where the business logic for showing the UI takes place. Also, the default answer of the confirmation is handled there as well (what if the businesslogic calls this method with HideDialog to &ldquo;true&rdquo;).</p>
<p>These are the UI Layer parts, where you see the public function gets the HideDialog, and passes it to the UI-related procedures, where the business logic for showing the UI takes place. Also, the default answer of the confirmation is handled there as well (what if the business logic calls this method with HideDialog to &ldquo;true&rdquo;).</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-AL data-lang=AL><span style=color:#66d9ef>codeunit</span> <span style=color:#ae81ff>53100</span> &#34;WLD BlockCustomer Meth&#34;
{
<span style=color:#66d9ef>internal</span> <span style=color:#66d9ef>procedure</span> BlockCustomer<span style=color:#f92672>(</span><span style=color:#66d9ef>var</span> Cust: <span style=color:#66d9ef>Record</span> Customer; HideDialog: <span style=color:#66d9ef>Boolean</span><span style=color:#f92672>)
@ -476,7 +476,7 @@ if you would apply this pattern to your product, at the customer, you&rsquo;ll b
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-AL data-lang=AL><span style=color:#66d9ef>Codeunit</span><span style=color:#f92672>.</span>Run<span style=color:#f92672>(</span><span style=color:#66d9ef>Codeunit</span>::&#34;Sales-Post&#34;, SalesHeader<span style=color:#f92672>)</span>;
</code></pre></div><p>you simply get</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-AL data-lang=AL>SalesHeader<span style=color:#f92672>.</span>Post<span style=color:#f92672>()</span>;
</code></pre></div><p>THAT is readabile. The previous is not! That is just something we got used to.</p>
</code></pre></div><p>THAT is readable. The previous is not! That is just something we got used to.</p>
<h3 id=testability>Testability</h3>
<p>There are two things in terms of testability where this pattern helps a lot.</p>
<p><em>Unit testing</em>
@ -521,12 +521,12 @@ And because of that, it so much more maintainable, upgradable, readable, .. . On
<div style=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px>
<div style=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div>
</div>
<script src=/js/clipboard.min.js?1637566650></script>
<script src=/js/perfect-scrollbar.min.js?1637566650></script>
<script src=/js/perfect-scrollbar.jquery.min.js?1637566650></script>
<script src=/js/jquery.svg.pan.zoom.js?1637566650></script>
<script src=/js/featherlight.min.js?1637566650></script>
<script src=/js/modernizr.custom-3.6.0.js?1637566650></script>
<script src=/js/relearn.js?1637566650></script>
<script src=/js/clipboard.min.js?1638370247></script>
<script src=/js/perfect-scrollbar.min.js?1638370247></script>
<script src=/js/perfect-scrollbar.jquery.min.js?1638370247></script>
<script src=/js/jquery.svg.pan.zoom.js?1638370247></script>
<script src=/js/featherlight.min.js?1638370247></script>
<script src=/js/modernizr.custom-3.6.0.js?1638370247></script>
<script src=/js/relearn.js?1638370247></script>
</body>
</html>