<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yahya Touil</title>
    <description>The latest articles on DEV Community by Yahya Touil (@yahyatouil).</description>
    <link>https://dev.to/yahyatouil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3808581%2F1133b606-9bd7-45da-ab42-db01de995132.jpg</url>
      <title>DEV Community: Yahya Touil</title>
      <link>https://dev.to/yahyatouil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yahyatouil"/>
    <language>en</language>
    <item>
      <title>How I used the Strategy pattern in AL to build a maintainable Business Central extension</title>
      <dc:creator>Yahya Touil</dc:creator>
      <pubDate>Thu, 05 Mar 2026 20:33:17 +0000</pubDate>
      <link>https://dev.to/yahyatouil/how-i-applied-solid-principles-and-interface-patterns-in-al-to-build-an-appsource-ready-bc-extension-9ep</link>
      <guid>https://dev.to/yahyatouil/how-i-applied-solid-principles-and-interface-patterns-in-al-to-build-an-appsource-ready-bc-extension-9ep</guid>
      <description>&lt;p&gt;Most AL developers have written this at least once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight pascal"&gt;&lt;code&gt;&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;Strategy&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; 
 &lt;span class="n"&gt;Standard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
   &lt;span class="n"&gt;Score&lt;/span&gt; &lt;span class="p"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;CalculateStandard&lt;/span&gt;&lt;span class="p"&gt;(...);&lt;/span&gt; 
 &lt;span class="n"&gt;Weighted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
   &lt;span class="n"&gt;Score&lt;/span&gt; &lt;span class="p"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;CalculateWeighted&lt;/span&gt;&lt;span class="p"&gt;(...);&lt;/span&gt; 
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works.&lt;/p&gt;

&lt;p&gt;Until you add more strategies.&lt;/p&gt;

&lt;p&gt;Then the calculator starts knowing about every scoring algorithm, and every new strategy means modifying existing business logic.&lt;/p&gt;

&lt;p&gt;For my AL Strategy Pattern Risk Engine, I wanted to separate the scoring algorithms from the calculator.&lt;/p&gt;

&lt;p&gt;The core pattern is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Interface + Enum = selectable strategy&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight pascal"&gt;&lt;code&gt;&lt;span class="k"&gt;interface&lt;/span&gt; &lt;span class="n"&gt;ICFRRiskStrategy&lt;/span&gt;
&lt;span class="cm"&gt;{
    procedure CalculateScore(Customer: Record Customer): Decimal;
}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each scoring strategy implements the same interface.&lt;/p&gt;

&lt;p&gt;The TY Risk Strategy enum defines the available strategies and maps each enum value to its corresponding implementation.&lt;/p&gt;

&lt;p&gt;The calculator can then work with the selected strategy instead of knowing which specific implementation is being used:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Score := Strategy.CalculateScore(Customer);&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
The project currently includes two strategies:&lt;/p&gt;

&lt;p&gt;Standard&lt;br&gt;
→ returns a fixed baseline score of 50.&lt;/p&gt;

&lt;p&gt;Weighted&lt;br&gt;
→ calculates the score using customer information such as blocked status, missing credit limit, and balance due exceeding the credit limit.&lt;/p&gt;

&lt;p&gt;The extension also includes:&lt;/p&gt;

&lt;p&gt;Configurable scoring rules through a setup table instead of hardcoded weights and thresholds.&lt;br&gt;
Risk levels that classify the resulting score as Low, Medium, or High.&lt;br&gt;
Risk Assessment Log that records each assessment, including the customer, strategy, score, level, user, and date/time.&lt;br&gt;
A calculator that handles validation, strategy execution, score classification, and logging.&lt;br&gt;
A read-only assessment history providing an audit trail of the evaluations.&lt;/p&gt;

&lt;p&gt;The main thing I wanted to demonstrate with this project is how AL interfaces and enum implementations can be used to implement the Strategy pattern without putting every scoring algorithm inside one calculator.&lt;/p&gt;

&lt;p&gt;It keeps the scoring logic separated and makes the extension easier to extend when another strategy is needed.&lt;/p&gt;

&lt;p&gt;Full architecture breakdown 👉 &lt;a href="https://yahyatouil.com/posts/building-al-strategy-pattern-risk-engine/" rel="noopener noreferrer"&gt;https://yahyatouil.com/posts/building-al-strategy-pattern-risk-engine/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code 👉 &lt;a href="https://github.com/yahyatouil-dev/bc-al-strategy-pattern-risk-engine" rel="noopener noreferrer"&gt;https://github.com/yahyatouil-dev/bc-al-strategy-pattern-risk-engine&lt;/a&gt;&lt;/p&gt;

</description>
      <category>businesscentral</category>
      <category>solidprinciples</category>
      <category>development</category>
      <category>programming</category>
    </item>
    <item>
      <title>I built 7 VS Code tools for Business Central developers because the workflow pain was real</title>
      <dc:creator>Yahya Touil</dc:creator>
      <pubDate>Thu, 05 Mar 2026 20:26:32 +0000</pubDate>
      <link>https://dev.to/yahyatouil/i-built-7-vs-code-tools-for-business-central-developers-because-the-workflow-pain-was-real-4cgn</link>
      <guid>https://dev.to/yahyatouil/i-built-7-vs-code-tools-for-business-central-developers-because-the-workflow-pain-was-real-4cgn</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Field 19 of 43. Typed by hand. From a JSON response.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the moment I stopped accepting the workflow and started building something better.&lt;/p&gt;

&lt;p&gt;Business Central development carries a lot of invisible overhead, and none of it is the hard part. It's the boilerplate, the folder setup, the JSON-to-AL mapping, the constant Postman context switching. Mechanical work that consumes focus without earning it.&lt;/p&gt;

&lt;p&gt;I spent six months building BC HERO: a free VS Code extension with seven tools that eliminate the most painful parts of the AL development workflow.&lt;/p&gt;

&lt;p&gt;What's inside:&lt;/p&gt;

&lt;p&gt;🗂️ Quick Project Setup — select your AL component folders, preview the structure, generate in one click. No more five-minute directory rituals.&lt;/p&gt;

&lt;p&gt;🧱 AL Object Creator — all 16 AL object types, guided form, auto-calculated next available ID, batch queue. Generate everything in one pass.&lt;/p&gt;

&lt;p&gt;⚡ JSON → AL Generator — drop a JSON file (plain objects, arrays, OData { "value": [...] } all work). BC HERO infers AL types, lets you customise, outputs syntax-highlighted AL. 30 fields in about 3 minutes instead of 25.&lt;/p&gt;

&lt;p&gt;🔌 API Explorer — full HTTP client inside VS Code. Scans your workspace for API pages and queries. Basic Auth and OAuth 2.0. I haven't opened Postman for a BC project since I built this.&lt;/p&gt;

&lt;p&gt;🌍 Translation Assistant — visual XLIFF editor with progress bars, inline editing, validation, and batch updates. A 200-unit review cycle went from over an hour to under 20 minutes.&lt;/p&gt;

&lt;p&gt;📊 Schema Viewer — interactive force-directed graph of your table relationships with field metadata sidebar. First thing I open in an unfamiliar codebase.&lt;/p&gt;

&lt;p&gt;🔗 Dependency Graph — visualization of every object in your workspace, color-coded by type, with directed dependency edges.&lt;br&gt;
It's free and always will be.&lt;/p&gt;

&lt;p&gt;Full story and design rationale on my blog 👉 &lt;a href="https://yahyatouil.com/posts/bchero-vs-code-extension-business-central-dev/" rel="noopener noreferrer"&gt;blog link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VS Code Marketplace 👉 &lt;a href="https://marketplace.visualstudio.com/items?itemName=yahyatouil.bc-hero" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=yahyatouil.bc-hero&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub (issues, roadmap) 👉 &lt;a href="https://github.com/yahyatouil-dev/bc-hero-info" rel="noopener noreferrer"&gt;https://github.com/yahyatouil-dev/bc-hero-info&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>productivity</category>
      <category>businesscentral</category>
    </item>
  </channel>
</rss>
