<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[EQS Engineering Blog - Medium]]></title>
        <description><![CDATA[EQS Group is one of Europe’s leading technology providers for corporate compliance and investor relations solutions. In this tech blog, our great engineering teams around the world share their expertise and learnings while coding best-in-class software products. www.eqs.com - Medium]]></description>
        <link>https://medium.com/eqs-tech-blog?source=rss----1c67e6caba09---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>EQS Engineering Blog - Medium</title>
            <link>https://medium.com/eqs-tech-blog?source=rss----1c67e6caba09---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:55:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/eqs-tech-blog" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Modern Frontend Architecture — Part 2]]></title>
            <link>https://medium.com/eqs-tech-blog/modern-frontend-architecture-part-2-b78c3ee25455?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/b78c3ee25455</guid>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[web-components]]></category>
            <dc:creator><![CDATA[Erdi Taner Gökalp]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 15:26:37 GMT</pubDate>
            <atom:updated>2025-12-15T15:26:37.620Z</atom:updated>
            <content:encoded><![CDATA[<h3>Modern Frontend Architecture — Part 2</h3><blockquote>From Mystery to Mastery — Web Components</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2rzKlJ5cPI8tN8ViG4Gnw.jpeg" /></figure><p><em>This article is part of a multi-part series covering the modernization of the EQS Group frontend ecosystem. In this part, I focus on how we built our framework-agnostic Custom Element Component library. If you did not read part 1, check it out </em><a href="https://medium.com/eqs-tech-blog/modern-frontend-architecture-part-1-12203f55bb62"><em>here</em></a><em>.</em></p><h3>Introduction</h3><p>Modern frontend ecosystems evolve fast, and a product organization with many teams and projects needs UI consistency without slowing everyone down. As I mentioned in the previous article, we initially relied on PrimeNG components with heavy customization, which became brittle over time due to risky upgrades, conflicting overrides, and divergent UI behavior across applications.</p><p>This pushed us to rethink our foundation entirely — a framework-independent, fully encapsulated <strong>Custom element component library with a solid design system.</strong></p><h3>Hidden Problems of External UI Libraries</h3><p>External UI libraries are handy for giving you a quick start when building a prototype or proof of concept, and you don’t have to worry about branding. However, this dramatically changes when you start tweaking the components to look in a “certain way”. This usually comes with not only colors but also icons, additional info texts, and compound components where the library does not exactly have what you need.</p><p>I favor external UI libraries as well, but not just because they are implemented in a certain framework, because they save significant time on documentation, testing, and accessibility challenges. However, the moment you start customizing, you can not run away from re-documenting and re-testing the changes. And this is where “a good idea” turns into a bad one.</p><h3>Why Custom Elements?</h3><h4>1. Framework Independence = Zero Rewrite Cost</h4><p>External UI libraries are mainly tied to frameworks, forcing complete rewrites when the framework changes:</p><ul><li>Angular → React → Svelte? Rewrite.</li><li>React → Angular? Rewrite again.</li><li>Vue 2 → Vue 3? Rewrite parts.</li><li>AngularJS → Angular? Full rewrite.</li><li>Angular + RxJS -&gt; Angular + Signals? Rewrite parts.</li></ul><p>However<strong>, Custom Elements outlive frameworks</strong> because they run directly on the browser platform, and they <strong>become portable assets</strong> independent of the surrounding tech stack. This protects organizations from framework churn, migration costs, long rewrite projects, vendor lock-in, and dependency risks.</p><h4>2. Perfect for Polyglot Frontend Architecture</h4><p>Large organizations expand, merge, and change over time, and it’s very likely to end up with different technologies, such as:</p><ul><li>CRM in Angular</li><li>Whistleblowing system in Next.js</li><li>Supply chain manager in Vue</li><li>Micro frontends in multiple frameworks</li><li>Embedded widgets in third-party pages</li></ul><p>A framework-bound UI library can’t unify them, but <strong>Custom Elements work in <em>all</em> of them. </strong>They are the only UI technology that naturally supports multi-framework environments.</p><h4>3. Lower Long-Term Maintenance Cost</h4><p>Framework-specific libraries age quickly:</p><ul><li>Angular Material v12 → v13 → v14 (breaking changes)</li><li>MUI major version every 2–3 years</li><li>Community libraries are becoming unmaintained</li></ul><p>Custom Elements:</p><ul><li>have stable browser standards</li><li>no breaking changes forced by external maintainers</li><li>don’t depend on framework lifecycle changes</li></ul><p>You maintain the components, not the framework’s API integrations.</p><h4>4. Technology Longevity &amp; Standards Foundation</h4><p>Custom Elements are part of the Web Platform spec, like:</p><ul><li>&lt;dialog&gt;</li><li>&lt;video&gt;</li><li>Shadow DOM</li><li>Custom Element Registry</li><li>Declarative custom elements (coming)</li><li>Scoped custom element registries</li></ul><p>Browser-native primitives don’t get deprecated the way frameworks do.</p><p>You get <strong>future-proof UI primitives</strong>.</p><h4>5. Better distribution (internal &amp; external)</h4><p>Custom Elements allow you to ship:</p><ul><li>widgets for external partners</li><li>drop-in components for client portals</li><li>embeddable interactive content</li><li>microwidgets without framework bundles</li></ul><p>You can deliver a &lt;my-widget&gt; that they embed anywhere.</p><p>This becomes impossible with a framework-based library.</p><h4>6. Improved performance for isolated components</h4><p>Framework UI libraries carry:</p><ul><li>full framework runtime</li><li>hydration logic</li><li>component lifecycle overhead</li></ul><p>Custom Elements:</p><ul><li>instantiate directly in the DOM</li><li>have no framework runtime</li><li>Run leaner when isolated</li><li>only render inside their own boundary</li></ul><h4>7. Custom Elements scale well organizationally</h4><p>Framework component libraries tend to:</p><ul><li>Lock teams to one framework</li><li>conflict with refactors</li><li>require synchronized upgrades</li><li>create bottlenecks in platform teams</li></ul><p>Custom Elements:</p><ul><li>empower all teams</li><li>scale across multiple apps</li><li>allow gradual adoption</li><li>Reduce overhead for framework migrations</li><li>allow mixing components without rewrite risk</li></ul><h3>Anatomy of Custom Elements</h3><p>Custom elements, aka Web components, are a set of native browser APIs that let you create <strong>reusable, encapsulated UI components</strong> — without needing a framework like Angular, React, or Vue.</p><pre>class UserCard extends HTMLElement {<br>  connectedCallback() {<br>    this.innerHTML = `Hello, ${this.getAttribute(&#39;name&#39;)}`;<br>  }<br>}<br>customElements.define(&#39;user-card&#39;, UserCard);</pre><pre>&lt;user-card name=&quot;Erdi&quot;&gt;&lt;/user-card&gt;</pre><p>The custom component above has the encapsulation logic and is ready to be used as a unit in every browser without any framework overhead.</p><p>However, this is a very primitive example and certainly not enough to qualify as a UI library core. You almost can’t build any mid-level to advanced components with complexity in a reasonable way.</p><p>This, as in the example, would be nothing more than a poor attempt to present to tens of developers and convince them that we should build components in this way. However, this can change in a few steps:</p><h4>Step 1 — Smooth transition by design</h4><p>Familiar patterns lower the cognitive barrier to adoption. When new technology looks and feels like what people already know, they’re more likely to trust it, try it, and use it correctly. When concepts transfer cleanly, teams spend less time learning the tool and more time solving real problems, and the closer a new system aligns with existing mental models, the faster people feel productive with it.</p><p>For this, <strong>bringing the existing habits into the loop</strong> was important in the design phase. We use Angular in most of our applications, and Angular has certain patterns: <strong>decorated components</strong>, <strong>component inputs</strong>, <strong>parent-child communication</strong>, <strong>encapsulated styles</strong>, <strong>change detection</strong>, and <strong>dependency injection</strong>.</p><p>We wanted to bring that in; except for <strong>HTML</strong> templates, we used <strong>JSX</strong>, since many build tools today have built-in support for JSX transformation, and it’s the easiest way to have reactivity with an efficient diffing logic. As a result, we ended up with components looking like these:</p><p>Toast component:</p><pre>import { Subject, takeUntil } from &#39;rxjs&#39;;<br><br>import { CustomElement } from &#39;@custom-element/custom-element&#39;;<br>import { Component, Inject, Output } from &#39;@decorators/decorators&#39;;<br>import { h } from &#39;@v-dom/h&#39;;<br>import { Fragment } from &#39;@v-dom/fragment&#39;;<br>import { CustomEventEmitter } from &#39;@events/events&#39;;<br><br>import style from &#39;./toast.component.scss&#39;;<br>import { ToastService } from &#39;./toast.service&#39;;<br><br>import type { ToastMessage } from &#39;./toast.types&#39;;<br><br>type ToastState = {<br>    messages: ToastMessage[];<br>};<br><br>@Component({<br>    selector: &#39;wc-toast&#39;,<br>    style,<br>})<br>export class ToastComponent extends CustomElement&lt;ToastState&gt; {<br>    readonly #destroy$ = new Subject&lt;void&gt;();<br><br>    state: ToastState = { messages: [] };<br><br>    @Output()<br>    onClick = new CustomEventEmitter&lt;ToastMessage&gt;();<br><br>    constructor(@Inject(ToastService) private readonly toastService: ToastService) {<br>        super();<br>    }<br><br>    override willMount(): void {<br>        this.toastService.messages$.pipe(takeUntil(this.#destroy$)).subscribe((messages) =&gt; {<br>            this.setState({ messages });<br>        });<br>    }<br><br>    override willUnmount(): void {<br>        this.toastService.clear();<br><br>        this.#destroy$.next();<br>        this.#destroy$.complete();<br>    }<br><br>    render(): JSX.Element {<br>        return (<br>            &lt;Fragment&gt;<br>                {this.state.messages.map((message: ToastMessage, index: number) =&gt; (<br>                    &lt;wc-toast-item-animation-wrapper<br>                        key={message.key}<br>                        message={message}<br>                        stackIndex={index}<br>                        onClose={(event: CustomEvent&lt;ToastMessage&gt;): void =&gt; this.toastService.remove(event.detail)}<br>                        onclick={(): void =&gt; this.onClick.emit(message)}<br>                    &gt;&lt;/wc-toast-item-animation-wrapper&gt;<br>                ))}<br>            &lt;/Fragment&gt;<br>        );<br>    }<br>}</pre><p>Input switch component:</p><pre>import { CustomElement } from &#39;@custom-element/custom-element&#39;;<br>import { Component, HostListener, Input, Output } from &#39;@decorators/decorators&#39;;<br>import { CustomEventEmitter } from &#39;@events/events&#39;;<br>import { h } from &#39;@v-dom/h&#39;;<br>import { Fragment } from &#39;@v-dom/fragment&#39;;<br><br>import style from &#39;./input-switch.component.scss&#39;;<br><br>import type { ICustomFormElement } from &#39;@custom-element/custom-element.interface&#39;;<br><br>@Component({<br>    selector: &#39;wc-input-switch&#39;,<br>    style,<br>})<br>export class InputSwitchComponent extends CustomElement implements ICustomFormElement&lt;boolean&gt; {<br>    @Input()<br>    value!: boolean;<br><br>    @Input()<br>    error?: string;<br><br>    @Input()<br>    hint?: string;<br><br>    @Output()<br>    onChange = new CustomEventEmitter&lt;boolean&gt;();<br><br>    @HostListener(&#39;click&#39;)<br>    toggle(): void {<br>        this.value = !this.value;<br>        this.onChange.emit(this.value);<br>    }<br><br>    render(): JSX.Element {<br>        return (<br>            &lt;Fragment&gt;<br>                &lt;div className=&quot;input-switch-input&quot;<br>                     $attribute={{<br>                        checked: this.value,<br>                        error: this.value &amp;&amp; !!this.error<br>                     }}<br>                &gt;&lt;/div&gt;<br>                &lt;label className=&quot;input-switch-label&quot;&gt;<br>                    &lt;div className=&quot;text&quot;&gt;<br>                        &lt;slot&gt;&lt;/slot&gt;<br>                    &lt;/div&gt;<br>                    {this.hint || this.error ? (<br>                        &lt;div className=&quot;hint-and-error&quot;&gt;<br>                            {this.hint ? &lt;wc-input-label className=&quot;label-xs&quot;&gt;{this.hint}&lt;/wc-input-label&gt; : null}<br>                            {this.error ? (<br>                                &lt;wc-input-label className=&quot;label-xs invalid&quot;&gt;{this.error}&lt;/wc-input-label&gt;<br>                            ) : null}<br>                        &lt;/div&gt;<br>                    ) : null}<br>                &lt;/label&gt;<br>            &lt;/Fragment&gt;<br>        );<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ligIhH-FHMg3Q4db8ofi4Q.gif" /><figcaption>Custom Storybook for custom elements library</figcaption></figure><h4>Step 2 — Developer Experience</h4><p>The next step is to provide a solid developer experience, such as IDE suggestions, error highlights, and auto-completions via:</p><p><a href="https://github.com/webcomponents/custom-elements-manifest">Custom element manifest</a>: A file format for describing custom elements. Added to <em>package.json</em> as <strong>customElements</strong> property as follows:</p><pre>{<br>  &quot;name&quot;: &quot;...&quot;,<br>  &quot;customElements&quot;: &quot;./node_modules/@packages/web-components/custom-elements.json&quot;,<br>  ...<br>}</pre><p><a href="https://github.com/JetBrains/web-types">Web types</a>: a JSON format for documenting web component libraries. If you are using JetBrains IDEs, this is also a supplementary addition to <em>package.json</em> as the <strong>web-types</strong> property, as follows:</p><pre>{<br>  &quot;name&quot;: &quot;...&quot;,<br>  &quot;web-types&quot;: &quot;./node_modules/@packages/web-components/web-types.json&quot;,<br>  ...<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBDwzkbLaiRIejFQlHBy_w.gif" /><figcaption>Auto completions and suggestions from WebStorm for custom elements</figcaption></figure><h4>Step 3 — First-class Angular citizenship with reactive forms</h4><p>We introduced a generic value accessor directive to work with custom elements in reactive forms; each form custom element that can be used in forms implements an interface with a <strong>value </strong>property and an <strong>onChange </strong>custom event, and the value accessor utilizes that:</p><p><strong>Web component value accessor</strong>:</p><pre>import { Directive, ElementRef, HostListener, inject, Input, Renderer2 } from &#39;@angular/core&#39;;<br>import { FormGroupDirective, NG_VALUE_ACCESSOR } from &#39;@angular/forms&#39;;<br>import { CustomElement } from &#39;@packages/web-components&#39;;<br><br>import type { AbstractControl, ControlValueAccessor } from &#39;@angular/forms&#39;;<br><br>@Directive({<br>    selector: &#39;[wcValueAccessor]&#39;,<br>    providers: [<br>        {<br>            provide: NG_VALUE_ACCESSOR,<br>            useExisting: WebComponentExtendedValueAccessorDirective,<br>            multi: true,<br>        },<br>    ],<br>    standalone: false,<br>})<br>export class WebComponentValueAccessorDirective implements ControlValueAccessor {<br>    readonly #element = inject&lt;ElementRef&lt;CustomElement&gt;&gt;(ElementRef);<br><br>    readonly #renderer = inject(Renderer2);<br><br>    readonly #formGroupDirective = inject(FormGroupDirective);<br><br>    onChange!: (value: string) =&gt; void;<br><br>    onTouched!: () =&gt; void;<br><br>    @Input()<br>    formControlName: string | null = null;<br><br>    @HostListener(&#39;onChange&#39;, [&#39;$event.detail&#39;])<br>    handleOnChange(value: string): void {<br>        this.onChange(value);<br>    }<br><br>    @HostListener(&#39;blur&#39;, [&#39;$event.target&#39;])<br>    handleBlurEvent(): void {<br>        this.onTouched();<br>    }<br><br>    writeValue(value: string): void {<br>        this.setProperty(&#39;value&#39;, this.getControl()?.value ?? value);<br>        this.setRequiredState();<br>        this.setAttributeFromFormControl(&#39;invalid&#39;);<br><br>        this.setAttributeFromFormControl(&#39;valid&#39;);<br>    }<br><br>    registerOnChange(functionToRegister: (value: string) =&gt; void): void {<br>        this.onChange = (value): void =&gt; {<br>            functionToRegister(value);<br>            this.setAttributeFromFormControl(&#39;dirty&#39;);<br>            this.setAttributeFromFormControl(&#39;invalid&#39;);<br>            this.setAttributeFromFormControl(&#39;valid&#39;);<br>        };<br>    }<br><br>    registerOnTouched(functionToRegister: () =&gt; void): void {<br>        this.onTouched = (): void =&gt; {<br>            functionToRegister();<br>            this.setAttributeFromFormControl(&#39;touched&#39;);<br>        };<br>    }<br><br>    setDisabledState(isDisabled: boolean): void {<br>        this.setProperty(&#39;disabled&#39;, isDisabled);<br>        this.setAttributeFromFormControl(&#39;invalid&#39;);<br>        this.setAttributeFromFormControl(&#39;valid&#39;);<br>    }<br><br>    private setRequiredState(): void {<br>        const control = this.getControl();<br>        if (!control) {<br>            return;<br>        }<br><br>        // hack for getting required info explicitly<br>        const validator = control.validator ? control.validator({} as AbstractControl) : null;<br>        const { required } = validator?.required ? validator : { required: false };<br><br>        this.setAttribute(&#39;required&#39;, `${required || false}`);<br><br>        if (control.disabled) {<br>            this.setAttribute(&#39;disabled&#39;, &#39;true&#39;);<br>        }<br>    }<br><br>    private getControl(): AbstractControl | null {<br>        if (!this.formControlName) {<br>            console.error(&#39;please provide formControlName&#39;);<br><br>            return null;<br>        }<br><br>        try {<br>            return this.#formGroupDirective.control.controls[this.formControlName];<br>        } catch {<br>            console.error(&#39;no form group or control name is present&#39;);<br><br>            return null;<br>        }<br>    }<br><br>    private setAttributeFromFormControl(key: &#39;dirty&#39; | &#39;invalid&#39; | &#39;touched&#39; | &#39;valid&#39;): void {<br>        const control = this.getControl();<br><br>        if (!control) {<br>            return;<br>        }<br><br>        control.updateValueAndValidity({ onlySelf: true, emitEvent: false });<br><br>        this.#renderer.setAttribute(this.#element.nativeElement, key, `${control[key]}`);<br>    }<br><br>    private setAttribute(key: string, value: string): void {<br>        this.#renderer.setAttribute(this.#element.nativeElement, key, value);<br>    }<br><br>    private setProperty(key: string, value: unknown): void {<br>        this.#renderer.setProperty(this.#element.nativeElement, key, value);<br>    }<br>}</pre><p>Usage in templates:</p><pre>&lt;wc-overlay [formGroup]=&quot;form&quot; (onBackgroundClick)=&quot;close()&quot;&gt;<br>    &lt;wc-dialog-box<br>        class=&quot;dialog-md&quot;<br>        [closeable]=&quot;true&quot;<br>        [cancelLabel]=&quot;&#39;Cancel&#39;&quot;<br>        [confirmLabel]=&quot;&#39;Create&#39;&quot;<br>        [confirmDisabled]=&quot;form.invalid&quot;<br>        (onClose)=&quot;close()&quot;<br>        (onConfirm)=&quot;submitForm()&quot;<br>    &gt;<br>        &lt;div class=&quot;col-12&quot; slot=&quot;header&quot;&gt;Create&lt;/div&gt;<br>        &lt;div class=&quot;col-12&quot; slot=&quot;body&quot;&gt;<br>            &lt;div class=&quot;row gap-200&quot;&gt;<br>                &lt;wc-input-field<br>                    class=&quot;col-12&quot;<br>                    wcValueAccessor<br>                    formControlName=&quot;name&quot;<br>                    [attr.required]=&quot;true&quot;<br>                    [label]=&quot;&#39;Title&#39;&quot;<br>                    [maxLength]=&quot;128&quot;<br>                /&gt;<br>                &lt;wc-text-area<br>                    class=&quot;col-12&quot;<br>                    wcValueAccessor<br>                    formControlName=&quot;description&quot;<br>                    sharedValidation<br>                    [label]=&quot;&#39;Description&#39;&quot;<br>                    [rows]=&quot;4&quot;<br>                    [maxLength]=&quot;300&quot;<br>                /&gt;<br>            &lt;/div&gt;<br>        &lt;/div&gt;<br>    &lt;/wc-dialog-box&gt;<br>&lt;/wc-overlay&gt;</pre><h3>Why Custom Implementation?</h3><p>There are pretty valuable packages out there for custom element development, such as <a href="https://lit.dev/">lit</a>, <a href="https://github.com/matthewp/haunted">haunted</a>, <a href="https://github.com/skatejs/skatejs">skate-js</a>, <a href="https://fast.design/">fast</a>, and <a href="https://stenciljs.com/">stencil</a>. Angular also has the <a href="https://angular.dev/guide/elements">@angular/elements</a> package.</p><p>As part of the Micro Frontend Architecture, modules are brought together in the runtime, and there are no shared packages between them, including the host application. By design, this becomes a problem considering the singleton and first-come, first-served nature of the <strong>CustomElementRegistry</strong> in the browser, without the proposal of the <a href="https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Scoped-Custom-Element-Registries.md">scoped custom element registry</a>:</p><blockquote>This proposal allows for multiple custom element definitions for a single tag name to exist within a page.</blockquote><blockquote>This is accomplished by allowing user code to create multiple custom element registries and associate them with shadow roots that function as scopes for element creation and custom element definitions. Potentially custom elements created within a scope use the registry for that scope to perform upgrades. New element construction APIs are added to ShadowRoot to allow element creation to be associated with a scope.</blockquote><p>Just by including the <a href="https://www.npmjs.com/package/@webcomponents/scoped-custom-element-registry">polyfill</a>, the scoped registry is at the service of the appropriate design to make use of it.</p><p>Without the scoped-registry, this is what happens in the browser when you load the application, then navigate to MFE-1, and then navigate to MFE-2:</p><pre>HOST uses Button, Card, Dropdown components at version v2.0.0.<br>MFE-1 uses Badge, Button, Card components at version v2.5.0.<br>MFE-2 uses Badge, Button, Tabs components at version v1.9.0.</pre><p>1 — <strong>HOST</strong> application loaded, and registered <strong>button</strong>, <strong>card</strong>, and <strong>dropdown</strong> components at version v2.0.0</p><p>2 — <strong>MFE-1</strong> application is loaded, and registered only the <strong>badge</strong> component since the <strong>button</strong> and the <strong>card</strong> components are already registered by the <strong>HOST</strong> application.</p><p>3 — <strong>MFE-2</strong> application is loaded, and registered only the <strong>tabs</strong> component since the rest were already registered in the 1st and 2nd steps.</p><p>Now we end up in a weird situation; in the custom element registry, the components are defined:</p><pre>- button@v2.0.0<br>- card@v2.0.0<br>- dropdown@v2.0.0<br>- badge@v2.5.0<br>- tabs@v1.9.0</pre><p>This is, with one word, a mess. When you face an issue, even the reproduction of the issue is not deterministic, depending on which path you took. The sole certainty here is that host application components will always be registered first, but the versions of the other components will depend on which micro frontend you navigate first.</p><p>This is where <strong>scoped-registry</strong> kicks in:</p><pre>1 - each micro frontend should have a namespace (aka, module-id)<br>2 - on micro frontend load, bootstrap of custom elements<br>    creates an html element with an id=namespace and attaches a shadow root<br>3 - bootstrap function defines the custom elements in the created element&#39;s<br>    shadow root&#39;s custom element registry</pre><p>These steps ensure the component isolation by module. However, the way we create the elements should also be adjusted:</p><pre>export class DOMManager {<br>    readonly propsManager = new PropsManager();<br><br>    constructor(private readonly documentRoot: DocumentRoot) {}<br><br>    createElement(parent: Node, vNode: VNode): Node {<br>        if (vNode.type === Fragment) {<br>            const fragment = document.createDocumentFragment();<br>            for (const childVNode of vNode.children) {<br>                fragment.append(this.createElement(fragment, childVNode));<br>            }<br>            (parent as Element).append(fragment);<br>            vNode.el = parent;<br><br>            return fragment;<br>        }<br><br>        if (vNode.type === &#39;TEXT_ELEMENT&#39;) {<br>            vNode.el = document.createTextNode(vNode.props.nodeValue);<br><br>            return vNode.el;<br>        }<br>        // this below looks up only in window.customElements registry<br>        // const element = document.createElement(vNode.type as keyof HTMLElementTagNameMap);<br>        // *** magic for scoped custom elements with nested custom elements ***<br>        const element = this.documentRoot.createElement(vNode.type as keyof HTMLElementTagNameMap);<br>        for (const childVNode of vNode.children) {<br>            element.append(this.createElement(element, childVNode));<br>        }<br>        this.propsManager.setProps(element, {}, vNode.props);<br>        vNode.el = element;<br><br>        return vNode.el;<br>    }<br><br>    // rest of the implementation ...<br>}</pre><p>Since <strong>document</strong> and <strong>shadow roots</strong> are isolation points, <strong>createElement</strong> calls should also respect that.</p><pre>// looks up custom elements in window.customElements<br>document.createElement(tagName, options)<br>// looks up custom elements in shadowRoot.customElements first,<br>// then falls back to window.customElements<br>shadowRoot.createElement(tagName, options)<br>// createElement on shadowRoot is defined in the polyfill</pre><p>The change in the <strong>DOM Manager</strong> above now creates the custom elements from the correct isolation point in the nested custom elements, such as:</p><pre>// rest of the implementation<br><br>render(): JSX.Element {<br>    return (<br>        &lt;Fragment&gt;<br>            { /* now created from the same registry as the parent component */}<br>            &lt;wc-info-banner<br>                icon={this.message.icon}<br>                severity={this.message.severity}<br>                closeable={true}<br>                onClose={(): void =&gt; this.closeHandler()}<br>                onActionClick={(): void =&gt; this.actionClickHandler()}<br>            &gt;<br>                &lt;span&gt;{this.#sanitizedSummary}&lt;/span&gt;<br>            &lt;/wc-info-banner&gt;<br>        &lt;/Fragment&gt;<br>    );<br>}</pre><p>But, how about the host framework, in this case, Angular?</p><p>Angular allows you to customize/override the behavior of <a href="https://github.com/angular/angular/blob/main/packages/core/src/render/api.ts#L67-L249">Renderer2</a>, which is used to manipulate the DOM. But Angular uses <a href="https://github.com/angular/angular/blob/16364514e3f9d99ebf304e19c9f5b61b0304dd3f/packages/platform-browser/src/dom/dom_renderer.ts#L131">DomRendererFactory2</a> to create corresponding <strong>DOM renderers</strong> based on component configuration. Internally, this is what Angular uses to create component templates, and it’s not part of the public API.</p><p>To trap <strong>createElement</strong> calls from the DOM renderer in the same way, we bent the fences by overriding the <strong>private</strong> DomRendererFactory2:</p><pre>import { inject, Injectable } from &#39;@angular/core&#39;;<br>// private classes / methods are exported with ɵ<br>import { ɵDomRendererFactory2 as DomRendererFactory2 } from &#39;@angular/platform-browser&#39;;<br>import { Runtime } from &#39;@packages/web-components&#39;;<br><br>import { SCOPED_REGISTRY_RUNTIME } from &#39;../scoped-registry.tokens&#39;;<br><br>import type { Renderer2, RendererFactory2, RendererType2 } from &#39;@angular/core&#39;;<br><br>@Injectable()<br>export class CustomRendererFactory2 implements RendererFactory2 {<br>    readonly domRendererFactory2 = inject(DomRendererFactory2);<br><br>    readonly runtime = inject&lt;Runtime&gt;(SCOPED_REGISTRY_RUNTIME);<br><br>    createRenderer(hostElement: HTMLElement | null, type: RendererType2 | null): Renderer2 {<br>        return this.domRendererFactory2.createRenderer(hostElement, type);<br>    }<br>}</pre><p>And the <strong>public</strong> Renderer2:</p><pre>import type { NgZone, Renderer2, RendererStyleFlags2 } from &#39;@angular/core&#39;;<br>import type { Runtime } from &#39;@packages/web-components&#39;;<br><br>export class CustomRenderer2 implements Renderer2 {<br>    readonly data: Record&lt;string, unknown&gt;;<br><br>    readonly contentAttr?: string;<br><br>    constructor(private readonly renderer2: Renderer2, private readonly ngZone: NgZone, readonly runtime: Runtime) {<br>        this.data = this.renderer2.data;<br>        this.contentAttr = (this.renderer2 as Renderer2 &amp; { contentAttr?: string }).contentAttr;<br>        if (!this.runtime.documentRoot) {<br>            throw new Error(`scoped-registry with id ${this.runtime.namespace} does not exist`);<br>        }<br>    }<br><br>    createElement(name: string, namespace?: string): unknown {<br>        // *** only thing we need for scoped registry to work within angular ***<br>        // *** delegates element creation to scoped registry&#39;s shadow root ***<br>        if (this.runtime.registry?.get(name)) {<br>            // *** this is where the magic happens ***<br>            const element = this.runtime.documentRoot.createElement(name);<br>            // this is important for styles to work properly<br>            if (this.contentAttr) {<br>                this.renderer2.setAttribute(element, this.contentAttr, &#39;&#39;);<br>            }<br>            return element;<br>        }<br>        return this.renderer2.createElement(name, namespace);<br>    }<br><br>    // the rest is the same interface that proxies injected renderer2<br>}</pre><p>If you use <strong>@angular/animations</strong>, you’ll need to override <strong>private</strong> <a href="https://github.com/angular/angular/blob/16364514e3f9d99ebf304e19c9f5b61b0304dd3f/packages/animations/browser/src/render/animation_renderer.ts#L20">AnimationRendererFactory</a> as well:</p><pre>import {<br>    ɵAnimationEngine as AnimationEngine,<br>    ɵAnimationRendererFactory as AnimationRendererFactory,<br>} from &#39;@angular/animations/browser&#39;;<br>import { inject, Injectable, NgZone } from &#39;@angular/core&#39;;<br>import { ɵDomRendererFactory2 as DomRendererFactory2 } from &#39;@angular/platform-browser&#39;;<br><br>@Injectable()<br>export class CustomAnimationRendererFactory extends AnimationRendererFactory {<br>    constructor() {<br>        const domRendererFactory2 = inject(DomRendererFactory2);<br>        const engine = inject(AnimationEngine);<br>        const zone = inject(NgZone);<br><br>        super(domRendererFactory2, engine, zone);<br>    }<br>}</pre><p>And finally, we expose these providers:</p><pre>import { RendererFactory2 } from &#39;@angular/core&#39;;<br>import { bootstrap } from &#39;@packages/web-components&#39;;<br>import { ɵDomRendererFactory2 as DomRendererFactory2 } from &#39;@angular/platform-browser&#39;;<br><br>import { CustomAnimationRendererFactory } from &#39;./renderer/custom.animation-renderer-factory&#39;;<br>import { CustomRendererFactory2 } from &#39;./renderer/custom.renderer-factory2&#39;;<br>import { SCOPED_REGISTRY_RUNTIME } from &#39;./scoped-registry.tokens&#39;;<br>import { CustomDomRendererFactory2 } from &#39;./renderer/custom.dom-renderer-factory2&#39;;<br><br>import type { Class, Runtime } from &#39;@packages/web-components&#39;;<br>import type { Provider } from &#39;@angular/core&#39;;<br><br>// if you want scoped custom element usage, use this provider<br>// combined with one of the below<br>export const provideScopedRegistry = (webComponentsModule: Class, namespace?: string): Provider[] =&gt; [<br>    {<br>        provide: SCOPED_REGISTRY_RUNTIME,<br>        // this is how the custom elements are registered via namespace (aka, module-id)<br>        useFactory: (): Runtime =&gt; bootstrap(webComponentsModule, namespace),<br>    },<br>    {<br>        provide: DomRendererFactory2,<br>        useClass: CustomDomRendererFactory2,<br>    },<br>];<br>// if you are using angular animations, add this provider<br>export const provideScopedRegistryAnimationRendererFactory = (): Provider[] =&gt; [<br>    {<br>        provide: RendererFactory2,<br>        useClass: CustomAnimationRendererFactory,<br>    },<br>];<br>// if you are not using angular animations, add this provider<br>export const provideScopedRegistryCustomRendererFactory2 = (): Provider[] =&gt; [<br>    {<br>        provide: RendererFactory2,<br>        useClass: CustomRendererFactory2,<br>    },<br>];</pre><p>Now we can use the providers in any module to enable isolated custom element creation:</p><pre>// ... rest<br>providers: [<br>  ...provideScopedRegistry(AppWebComponents, scopedRegistryName),<br>  ...provideScopedRegistryCustomRendererFactory2(),<br>]</pre><h3>Conclusion</h3><p>For over 3 years, our custom elements have been part of our daily work. Many developers from different teams are contributing to the component library and consumer components from the library daily.</p><p>When I look back and think about the experience we had, I see it as one of the best decisions we took. Of course, adopting a proposal as core and hooking into the internals of Angular had risks, but when I think about it today, it was worth it. We could certainly have had easier, but questionable alternatives to the scoped-registry, such as tagging components differently per module, and that could have solved the technical issues, but we were invested in doing it the right way.</p><p>I imagine a web development without complex frameworks one day, the way the JS community is marching forward, I think it will be very possible with the new standards and browser APIs. In that direction, I am also happy to see Safari (<a href="https://caniuse.com/?search=scoped+registry">click to see on caniuse.com</a>) now has support for scoped-registry.</p><p>I hope you enjoyed the series of articles and gave you a little inspiration and ideas about how to tackle similar challenges in the future. Thank you for reading through</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b78c3ee25455" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/modern-frontend-architecture-part-2-b78c3ee25455">Modern Frontend Architecture — Part 2</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modern Frontend Architecture — Part 1]]></title>
            <link>https://medium.com/eqs-tech-blog/modern-frontend-architecture-part-1-12203f55bb62?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/12203f55bb62</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[micro-frontends]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Erdi Taner Gökalp]]></dc:creator>
            <pubDate>Tue, 02 Dec 2025 17:33:00 GMT</pubDate>
            <atom:updated>2025-12-02T18:01:03.552Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>From Fragmentation to Federated Agility</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*92aiKpOWLnlpTpfO2YV9Ow.png" /><figcaption>An examplary Micro Frontend Architecture</figcaption></figure><p><em>This article is part of a multi-part series covering the modernization of the EQS Group frontend ecosystem. In this part, I focus on the architectural challenges we faced and the foundational transformation to independent deployments, faster delivery, and true autonomy for our engineering teams. Part 2 will dive deep into how we built our framework-agnostic Web Component library.</em></p><h3>Introduction</h3><p>Modernizing a large enterprise frontend is never a single project — it’s an architectural journey. At EQS Group, two of our major products have more than a dozen modules developed by independent teams. While this structure provides strong ownership, it also creates challenges when the underlying architecture forces tight coupling.</p><p>This is the story of how we transformed a slow, version-locked, PrimeNG-dependent Angular monolith into a federated, version and dependency-agnostic ecosystem that supports rapid upgrades, unrestricted deployments, and true team independence.</p><h3>Challenges</h3><p>Before I continue, I believe it’s important to get an overview of the team structures and existing workflows to get a better understanding of the challenges.</p><h4>1. Product Landscape &amp; Team Structure</h4><p>At EQS Group, two of our platforms consist of multiple independently-owned modules:</p><p><strong>Investor Relations: </strong><em>CMS</em>, <em>Mailing</em>, <em>CRM</em>, <em>Roadshow Manager (as of date)</em>, <em>Investors</em>, <em>Webcast</em>, <em>News &amp; Disclosure,</em> and <em>IR Cockpit (host application that orchestrates modules)</em></p><p><strong>Compliance: </strong><em>Data Center</em>, <em>Approval Manager</em>, <em>Policy Manager</em>, <em>Integrity Line</em>, <em>Third Party Manager</em>, <em>Risk Manager</em>, <em>Campaign Manager</em>, <em>Analytics</em>, and <em>Compliance Cockpit (host application that orchestrates modules)</em></p><p><strong>A cross-functional team owns each module, consisting of: </strong><em>Engineering Manager</em>, <em>Product Manager</em>, <em>Product Designer</em>, <em>2+ Frontend Developers</em>, <em>2+ Backend Developers</em>, <em>QA (Optional)</em>, <em>Staff Engineer (Occasional)</em></p><p>Each team plans its own roadmap, priorities, and OKRs. So we had organizational independence… but not an architectural one.</p><h4><strong>2. Deployment Coupling</strong></h4><p>Modules were published as npm packages to the private registry and triggered an upstream pipeline to create an MR for the bumped package version.</p><p>On some days when things did not go as planned, deployments blocked each other due to bugs/issues in one of the packages.</p><p>In addition, double pipeline runs for module package publishing + host application with the new package version usually took around <strong>~40 minutes </strong>and left a constant coordination overhead.</p><h4><strong>3. Upgrade Hell</strong></h4><p>When I joined EQS Group in 2021, we attempted an Angular upgrade from v8 → v12. Since teams have full autonomy and feature development rarely stops at the same time for all teams, attempts resulted in constant rebasing and long-lived feature branches, leading to inevitable bugs.</p><p>Since the coordination was quite costly, and often upgrades were merely a dream, each upgrade attempt faced multiple version jumps with the accumulated number of breaking changes for core dependencies such as Angular, PrimeNG, etc.</p><p>In the end, the upgrade took <strong>~3 months</strong>, with often follow-up bug fixes and, of course, frustration.</p><h4>4. UI Fragmentation &amp; Component Divergence</h4><p>In my ~13 years of frontend experience, I have developed a humble opinion about the things that should not be mingled, and two of them are <em>Commercial/open source UI / component libraries</em> and <em>in-house design teams</em>. Mixing these two usually ends up with lots of bugs, limitations, and lots of frustration for everyone involved.</p><p>What we had was exactly that. PrimeNG was the main UI library, and heavy branding and customization were all over the place; and with a lack of discipline, eventually, visual inconsistencies and drifted components were everywhere. And this made the upgrades just as messy as it gets when you jump multiple versions, god knows after how many years.</p><p>For example, a Dropdown component had at least 2–3 versions in the component library, and some of the modules had their own versions for whatever reason.</p><h3>Action</h3><p>We had been talking about concepts for a while, such as <em>Webpack Module Federation</em> and <em>Single SPA, </em>and one very cool thing we have at EQS Group is that we have at least one hackathon per year focusing on product, AI, performance, or security. And this was the opening I was looking for, and we took the opportunity to make it happen to prove the concept and the benefits.</p><p>We came up with the high-level plan:</p><ul><li>Transform npm packages to federated Angular applications with runtime dependencies to eliminate deployment dependencies</li><li>Enable multi-version federated applications to eliminate runtime version dependencies</li><li>Replace PrimeNG with a framework-agnostic component library to eliminate dependency upgrades</li></ul><p>Let’s dive into the first two steps of the plan:</p><h4>Stage 1: NPM packages to Federated Applications</h4><p>We tailored <strong>webpack module federation </strong>to our setup by:</p><ul><li>Converting each module from an npm package to a federated Angular application</li><li>storing build outputs in S3 along with a manifest file to load a flexible “version” for any application</li></ul><p>I would like to mention the structure we have in S3, because it enabled us to unlock cutting-edge testing and deployment strategies in our development style:</p><pre>modules/<br>  mailing/<br>    3.4.7/<br>      main.js<br>      assets/<br>    3.4.8/<br>      main.js<br>      assets/<br>    feature-branch-x/<br>      main.js<br>      assets/<br>    mfe-manifest.json</pre><p>Host application loads mfe-manifest.json for each remote module to determine the version to load, with the ability to allow query parameters to override the application <em>version</em> to any branch name for automated or user acceptance tests.</p><p>The result was impressive. No more MR mesh for version bumps or rollbacks, or 3rd party dependency related conflicts, cross-team deployment blocking due to bugs/issues, branch-to-production time reduced from <strong>~40 minutes → ~8 minutes, </strong>and as a new capability, we can<strong> </strong>test changes without merging to main branches, even e2e tests can benefit from query parameter overriding.</p><h4>Stage 2: Multi-version Federated Applications</h4><p>When we started this sequence of changes, we knew it was a long way, lots of unknowns, structural changes, adaptation time for each team, and step-by-step execution. Step 1 was the fundamental change and the ground for the exponential impact of the plan.</p><p>As a result, we were still bound to the same Angular and PrimeNG major version, and upgrades still needed a grand alignment to go all at once.</p><p>This is where the second phase began — and where the true architectural shift happened:</p><ul><li>Move to a <strong>Framework-Agnostic Web Component Library</strong>: <em>(Part 2 of this series will cover the Web Component system in depth.)</em></li><li><strong>Zero shared / runtime dependencies</strong> between the host and remote applications</li></ul><p>We had one simple, basic requirement: “<em>Host or remote applications can add/update/remove their dependencies independent from each other.</em>” No version coupling in the Angular DI system, or unpredictable runtime collisions, or cross-team alignment for fundamental changes.</p><p>What we did was actually pretty simple. Instead of storing state in an Angular service, we stored it in a global data store (session/user info), and services picked up data from the store on startup. <strong>This ensured </strong>no runtime angular dependency and coupling, and predictable integration, and we kept using the same angular services in the host and remote applications.</p><p>And as the final touch, we bootstrapped each remote Angular application in a custom element created with `@angular/elements` gave a little boost to `@angular/router` to activate within the remote application.</p><h4>Stage 3: Web component library</h4><p>In business, acquisitions are part of the reality. Imagine your growing company acquires a promising start-up, or a well-established one. And you eventually incorporate the branding, and then merge the infrastructure, tech, etc. Imagine the luxury of having a mature, documented, framework-agnostic component library with a proper design system that you can just start using in a Vue, React, or Angular application. It would be pretty neat, wouldn’t it?</p><p>When it comes to framework versions, the concept is pretty similar, except for the big component library duplication and multiple maintenance of the same component library in Angular, React, and Vue. At EQS Group, the component library is a shared project and does not have team ownership. Our motivation was clear: <strong>we don’t want the component library to be a thing for framework upgrades</strong>, to put it simply. But more will come later <em>(Part 2 of this series will cover the Web Component system in depth.)</em></p><h3>Result</h3><p>For the last 2 years, teams could maintain dependency upgrades independently, and we never had the hot topic “Angular upgrade” in OKR meetings, because it is a matter of a few hours instead of months of work, and without cross-team alignment.</p><p>I would also like to mention the great impact of the new component library strategy with <strong>web components</strong>. Most of the time during upgrades was spent adjusting the customized components, custom style fixes that did not work anymore, and many more. We could still achieve the independent upgrades with PrimeNG or any other UI library, but I am not quite sure we would be able to reach the speed we are now. But this is the topic of the next blog post.</p><h3>Conclusion</h3><p>As a football fan, I love the quote attributed to Johan Cruyff: “<em>Playing football is simple, but it’s difficult to play simple</em>”. I very much think the same about software and software design as well. Micro-Frontends are certainly doable and maintainable; however, it’s never a top requirement. It’s an architectural decision based on conditions, limitations, team maturity, and organization. What we did was to <strong>scale the organization</strong>, not only the tech. We enabled teams to maximize their throughput, build more secure applications, and benefit from what’s the latest state-of-the-art software out there.</p><h3>What’s Next in This Series</h3><p>This modernization journey produced a blueprint for scalable frontend architecture for such organizational structures, and it deserves a deeper look. I will write about how and why we decided to go with <strong>Building a Framework-Agnostic Web Component Library:</strong></p><ul><li>Unexpected Challenges of Micro Frontends and Web Components</li><li>Why we chose a custom web components implementation</li><li>How we improved DevX with such custom component libraries</li></ul><p>Thanks for being patient and reading through the whole article. I hope you enjoyed it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12203f55bb62" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/modern-frontend-architecture-part-1-12203f55bb62">Modern Frontend Architecture — Part 1</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Practical ETL Pipeline for Chatbots: From Confluence to ChromaDB using GitLab]]></title>
            <link>https://medium.com/eqs-tech-blog/etl-pipeline-for-chatbots-using-gitlab-71b3ce5b343e?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/71b3ce5b343e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chromadb]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Jaouher Kharrat]]></dc:creator>
            <pubDate>Sun, 24 Dec 2023 15:01:16 GMT</pubDate>
            <atom:updated>2023-12-24T15:01:16.603Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.atlassian.com/software/confluence">Confluence</a> has long stood as a pillar for organizations to store and share their knowledge. Yet, simply having a rich knowledge base is only the start. With the rising popularity of chatbots, there’s a pressing need to make this knowledge easily accessible through conversational interfaces. The first step in this evolution? Migrating that knowledge to a structured format, like vector databases, paves the way for intelligent, interactive information exchange internally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdO654aNwXCqHGI_AzLEvQ.png" /><figcaption>Gitlab Pipelines</figcaption></figure><p>This article isn’t mere data migration; it’s about refining and supercharging access to knowledge and enhancing searches and operations. Explore the depths of ETL pipeline creation, utilizing <a href="https://about.gitlab.com/">GitLab</a> for seamless Confluence-vector database integration, through a guide that aims to light the path for data engineers and knowledge managers. Ready to bridge the gap from static to dynamic knowledge use?</p><h3>A. Before we dive:</h3><h4>a. What is a Vector Database?</h4><p><a href="https://en.wikipedia.org/wiki/Vector_database">Vector databases</a>, part of the <a href="https://en.wikipedia.org/wiki/NoSQL">NoSQL</a> family, manage data as vectors — mathematical constructs representing data in multi-dimensional spaces. These databases excel at handling complex data, like machine learning embeddings. Vector databases typically implement one or more <a href="https://en.wikipedia.org/wiki/Nearest_neighbor_search#Approximation_methods">Approximate Nearest Neighbor</a> (ANN) algorithms.<em><br></em>Their hallmark? Swift similarity searches. Submit a query vector, and they’ll pinpoint its closest matches in the dataset. When searching for a Kitten, you will find it near Cats as the nearest neighbor followed by Tigers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*8-D8MBgXwExawpr4-p4sXg.png" /><figcaption>Very simple visualization of similar words presentation in a vector space</figcaption></figure><h4>b. What is an ETL?</h4><ul><li><strong>Extract</strong>: Pull data from varied sources like databases or spreadsheets.</li><li><strong>Transform</strong>: Process the data, enhancing its consistency and reliability through cleaning, enriching, and restructuring steps.</li><li><strong>Load</strong>: Deposit the curated data into a destination (like Chroma DB) for optimized access and use.</li></ul><h3>B. Prerequisites</h3><p>Before exploring the ETL pipeline development for integrating a Confluence Knowledge Base with a vector database, let’s identify what we need first:</p><ul><li><strong>Confluence API Access</strong>: To extract data from a Confluence Knowledge Base, secure API access is a. must. For security reasons. We require a user who can access only internally public data, safeguarding against the disclosure of confidential information.</li><li><strong>Vector Database: </strong>we will use a hosted ChromaDB, accessible from the GitLab pipeline. To ensure secure access, it’s crucial to leverage API keys behind a gateway.</li><li><strong>GitLab</strong>: We will require an adequately privileged account and crucial <a href="https://docs.gitlab.com/ee/ci/">CI/CD configurations</a>. This entails setting up runners, embedding environment variables like API keys, and constructing a “.gitlab-ci.yml” file to secure and define the pipeline efficiently.</li></ul><h3>1. Extracting Knowledge from Confluence</h3><p>The act of obtaining information from Confluence is intricate, particularly when handling diverse data forms such as text, video, attachments, and so on. In this article, however, we’ll focus solely on the textual content of the html output.</p><h4>a. Connecting to Confluence API</h4><p>The extraction process commences with the <em>fetchConfluenceData</em> function. It’s designed to make authenticated HTTP GET requests to the Confluence API using axios. Authentication is handled using a Basic Auth token:</p><pre>const fetchConfluenceData = async (url, authToken) =&gt; {<br> // … other code …<br> const response = await axios.get(url, {<br> headers: {<br> Authorization: `Basic ${authToken}`,<br> &#39;Content-Type&#39;: &#39;application/json&#39;,<br> Accept: &#39;application/json&#39;,<br> },<br> });<br> // … other code …<br>};</pre><p>This token is generated using the Confluence username and password, then encoded in Base64 and passed in the request header.</p><h4>b. Fetching Active Spaces</h4><p>Identifying active spaces is a pivotal step, conducted by <em>fetchAllActiveSpaces</em>. It interrogates the /rest/api/space endpoint of the API:</p><pre>const fetchAllActiveSpaces = async (baseUrl, authToken) =&gt; {<br> const url = `${baseUrl}/rest/api/space?type=global&amp;limit=500`;<br> // … other code …<br> const response = await fetchConfluenceData(url, authToken);<br> // … other code …<br>};</pre><p>PS: you can instead of fetching If specific spaces are preconfigured in config.insight_space, it sidesteps the API call, otherwise, it retrieves all spaces, respecting the pagination limit set by Confluence.</p><h4>c. Retrieving Pages from Spaces</h4><p>With the space keys in hand, each space’s content is fetched through <em>fetchAllPagesInSpace</em>, which continuously requests pages until all are retrieved:</p><pre>const fetchAllPagesInSpace = async (baseUrl, spaceKey, authToken) =&gt; {<br> // … other code …<br> while (hasMoreData) {<br> const url = `${baseUrl}/rest/api/content?spaceKey=${spaceKey}&amp;limit=${limit}&amp;start=${start}`;<br> const data = await fetchConfluenceData(url, authToken);<br> // … other code …<br> }<br> // … other code …<br>};</pre><p>This method is robust against API limitations by incrementing the start parameter to loop through paginated results.</p><h4>d. Challenges and their Mitigation</h4><p><strong>1. Rate Limiting</strong>:</p><ul><li><strong>Challenge</strong>: Confluence API might have rate limits, which can hinder the extraction process if you’re making frequent requests.</li><li><strong>Mitigation</strong>: Implementing rate limit handling in your Node.js scripts, using retries with exponential backoff, or pre-fetching data at non-peak times can help.</li></ul><p><strong>2. Incomplete or Inconsistent Data</strong>:</p><ul><li><strong>Challenge</strong>: Not all data in Confluence might be structured or complete, leading to potential gaps in the extracted data.</li><li><strong>Mitigation</strong>: Data validation checks during extraction can identify and flag incomplete data, allowing for manual intervention or automated fill mechanisms.</li></ul><p><strong>3. Large Attachments</strong>:</p><ul><li><strong>Challenge</strong>: Some attachments in Confluence might be heavy, causing delays or potential failures during extraction.</li><li><strong>Mitigation</strong>: Breaking down large files into chunks, optimizing the extraction process to deal with large files separately, or temporarily storing them in ChromeDB before processing can help.</li></ul><p><strong>4. Data Security and Privacy Concerns</strong>:</p><ul><li><strong>Challenge</strong>: Extracting sensitive or private data might raise security and compliance issues.</li><li><strong>Mitigation</strong>: Ensure that all data extraction adheres to GDPR, CCPA, or other regional data privacy laws. Additionally, anonymize or mask sensitive data during the extraction phase if needed.</li></ul><h3>2. Transforming Data for Vector Database</h3><p>Once the data is extracted from Confluence, the transform phase manipulates this raw data into a more analytically valuable form. This process involves sanitizing text, enriching data, and preparing it for loading into ChromaDB.</p><h4>Text Sanitization and Normalization</h4><p>The raw HTML content from Confluence pages is converted into plain text to simplify analysis. This conversion might look something like the following:</p><pre>const transformPageContent = (htmlContent) =&gt; {<br>    const textContent = htmlToText(htmlContent, {<br>        wordwrap: null,<br>        ignoreImage: true,<br>        uppercaseHeadings: false<br>    });<br>    return textContent.trim();<br>};</pre><p>Here, htmlToText is a function that converts HTML to plain text, stripping out any formatting and images to leave behind the raw, unstyled content.</p><h4>Data Structuring</h4><p>During the transformation phase, it’s essential to structure the data into a more coherent form that reflects the requirements of the target data store or the analytical tools to be used later. This might involve creating a uniform schema or data model:</p><pre>const structureData = (pageData) =&gt; {<br>    return {<br>        title: pageData.title,<br>        content: transformPageContent(pageData.body.storage.value),<br>        metadata: {<br>            author: pageData.version.by.displayName,<br>            createdDate: pageData.version.when,<br>            url: `ConfluenceURL/pages/viewpage.action?pageId=${pageData.id}`<br>            // other relevent metadata<br>        }<br>    };<br>};</pre><p>This structureData function demonstrates the process of taking the unstructured page data and organizing it into a more defined format.</p><p>If your data has inherent relationships (like hierarchies in Confluence pages or related tags), understand how these relationships can be represented within the vector database.</p><h4>Content Enrichment</h4><p>The transformation phase may also include enriching the data with additional context or metadata, which could involve appending related tags, categories, or any other relevant data that can provide more depth to the analysis.</p><pre>const enrichData = (structuredData) =&gt; {<br>    // Example of adding a tag based on content analysis or other criteria<br>    // you can also leverage LLMs to make such categorization<br>    if (structuredData.content.includes(&quot;urgent&quot;)) {<br>        structuredData.metadata.priority = &quot;High&quot;;<br>    }<br>    return structuredData;<br>};</pre><p>The enrichData function showcases a simple conditional enrichment, where a priority level is assigned to the data based on the content.</p><h4>Data Filtering</h4><p>Sometimes, the transformation phase includes filtering the data to remove unnecessary or irrelevant information:</p><pre>const filterData = (structuredData) =&gt; {<br>    return structuredData.filter((page) =&gt; page.content.length &gt; 100);<br>};</pre><p>In this filterData function, only pages with more than 100 characters are kept, filtering out pages with less content which might be considered less valuable.</p><h4>Chunking data</h4><p>Now we split the elements into chunks less or equal to 512 characters with an overlap of 20 characters.</p><pre>const textSplitter = new RecursiveCharacterTextSplitter({<br>            chunkSize: 512,<br>            chunkOverlap: 20,<br>        });<br>const splitDocs = await textSplitter.splitDocuments(rawData);</pre><p>Generating these chunks can make the IDs of the original article id obsolete. the simplest way is to auto-increment an integer as a suffix to the original ID.</p><pre>let previousBaseId = &#39;&#39;;<br>let suffix = 0;<br>splitDocs.forEach((doc, index) =&gt; {<br>    let baseId = doc.metadata.id;<br><br>    // If the baseId is different from the previous one, reset the suffix<br>    if (baseId !== previousBaseId) {<br>        suffix = 0;<br>        previousBaseId = baseId;<br>    }<br><br>    // Generate newId by appending the suffix to the baseId<br>    let newId = `${baseId}-${suffix}`;<br><br>    // Adding the calculated glId to the document&#39;s metadata<br>    doc.metadata.glId = newId;<br><br>    // Increment suffix for next document<br>    suffix++;<br>});</pre><h4>Possible Challenges and Measures</h4><p><strong>1. Identifying and Addressing Null Values</strong>:</p><ul><li>Missing or null values can hinder the efficiency of a vector database. Identify these gaps and either fill them with default values, <a href="https://www.kaggle.com/code/pagenotfound/mean-and-median-imputation">mean/median imputation</a> or use advanced techniques like <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/AliMeekPredictiveModelsOfFormFillingTechReport.pdf">predictive filling</a>.</li></ul><p><strong>2. Removing Duplicates</strong>:</p><ul><li>Confluence data might have redundancies, especially with repeated information across different pages or sections. Identify and eliminate these duplicates to ensure uniqueness.</li></ul><p><strong>3. Standardizing Formats / Data Normalization</strong>:</p><ul><li>Ensure that date, currency, text formats, etc., are consistent. This is especially important when dealing with global data that might have regional variations.</li></ul><p><strong>4. Handling Non-textual Data</strong>:</p><ul><li>Images, videos, and other rich media extracted from Confluence can be represented in vector form using feature extraction techniques. Tools like <a href="https://en.wikipedia.org/wiki/Convolutional_neural_network">convolutional neural networks (CNN)</a> for images can be instrumental in this regard.</li></ul><p><strong>5. Categorization and Tagging</strong>:</p><ul><li>Apply <a href="https://huggingface.co/models?pipeline_tag=text-classification&amp;sort=trending">classification models</a> or clustering techniques to categorize the data. This can be valuable for quick retrieval or segmentation within the vector database. Can be part of <a href="https://pub.towardsai.net/advanced-rag-techniques-an-illustrated-overview-04d193d8fec6">Advanced RAG techniques</a>.</li></ul><h3>3. Loading Data into Vector Database</h3><p>After the data has been extracted from Confluence and transformed into a structured and enriched format, the final step in the ETL pipeline is to load the data into ChromaDB.</p><h4>Preparation</h4><p>The code begins by importing the necessary modules and reading the data_transformed.json file containing the transformed data ready to be loaded.</p><pre>const splitDocs = JSON.parse(await readFile(&#39;data_transformed.json&#39;, &#39;utf-8&#39;));</pre><h4>Embedding and Database Initialization</h4><p>The ChormaDB leverages machine learning models to embed the documents for similarity searches. The code initializes a Hugging Face model to perform the embedding:</p><pre>const model = new TransformersEmbeddingFunction({<br>    model: &quot;Xenova/bge-small-en-v1.5&quot;,<br>});</pre><p>Then, it connects to ChromaDB and either retrieves or creates a new collection to store the documents:</p><pre>const chroma = new ChromaClient({path: config.chroma_server_host});<br>const collection = await chroma.getOrCreateCollection({name: &quot;confluence&quot;, embeddingFunction: model});</pre><h4>Loading Documents</h4><p>Documents are added to the CHROMA database in batches. The code iterates over each document and adds it to the specified collection:</p><pre>await addDocumentsToChromaDB(collection, splitDocs);</pre><p>Each document consists of its content and associated metadata, including a globally unique identifier (glId).</p><h4>Strategies for Efficient Data Loading</h4><p><strong>1. Batch Processing</strong>:</p><ul><li>Instead of loading data in real-time or one-by-one, utilize batch processing. This approach aggregates data and loads it in chunks, ensuring efficiency and reduced strain on the database.</li></ul><p><strong>2. Parallel Loading</strong>:</p><ul><li>If your infrastructure and the vector database support it, parallelize the data loading process. This means multiple streams of data can be loaded simultaneously, speeding up the entire operation.</li></ul><p><strong>3. Error Handling</strong>:</p><ul><li>Always anticipate potential issues during loading, such as data mismatches or server timeouts. Implement error handling mechanisms that can either retry, log, or notify about such disruptions.</li></ul><p><strong>4. Prioritization</strong>:</p><ul><li>If specific data segments are more critical than others, prioritize their loading. This ensures that the most vital data is available for querying even if the loading process isn’t complete.</li></ul><h3>4. Validation and Verification Procedures</h3><p>Loading data into a vector database might seem like the last step of the ETL journey, but in many ways, it’s just the beginning of realizing the true value of your data. Some checks can ensure you did the previous steps well.</p><h4><strong>Data Integrity Checks</strong>:</h4><ul><li>Once data is loaded, compare a sample against its transformed counterpart to ensure no data loss or corruption has occurred during the loading phase.</li></ul><h4><strong>Performance Benchmarks</strong>:</h4><ul><li>Conduct speed and performance tests to verify that data can be retrieved efficiently. This will help you gauge if the loading was not just successful but also optimized for future operations.</li></ul><h4><strong>User Feedback</strong>:</h4><ul><li>Allow a subset of users to interact with the newly loaded data. Their feedback can provide insights into any anomalies, errors, or inefficiencies that might have been overlooked.</li></ul><h4><strong>Auditing</strong>:</h4><ul><li>Maintain logs of the data loading process. This will not only aid in troubleshooting but also ensure compliance and offer transparency about the data’s lineage and any transformations it underwent.</li></ul><h3>5. Orchestrating ETL with GitLab</h3><p>This section will showcase how to set up a GitLab CI/CD pipeline to streamline the ETL process for data from Confluence, with additional stages for Testing and Resetting the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6wx4DUUa5trqlaaB1L9xfQ.png" /></figure><h3>Stages Definition</h3><p>The stages keyword is used to define the order of execution:</p><pre>stages:<br>  - Extract<br>  - Transform<br>  - Load<br>  - Test<br>  - Reset</pre><h3>Extract Stage</h3><p>The “Extract” stage is defined by the job 💫 E-confluence. It is responsible for pulling data from a Confluence instance:</p><pre>💫 E-confluence:<br>  stage: Extract<br>  script:<br>    - npm install<br>    - npm run confluence:extract --option=$EXTRACT_OPTION<br>  variables:<br>    INSIGHT_URL: $INSIGHT_URL<br>    INSIGHT_PASSWORD: $INSIGHT_PASSWORD<br>    INSIGHT_USERNAME: $INSIGHT_USERNAME<br>  when: manual  # This line makes the job manual<br>  allow_failure: false  # If you want the job to be marked as &#39;failed&#39; if any script fails<br>  artifacts:<br>    paths:<br>      - data_raw.json<br>      - node_modules/   # Add the node_modules directory as an artifact<br>    expire_in: 24 hours  # Artifacts expire in 24 hours</pre><p>Key features:</p><ul><li>Installation of project dependencies using npm install.</li><li>Manual trigger (when: manual), which means this job runs when initiated by the user.</li><li>Use of project-specific variables like INSIGHT_URL, which are assumed to be set in the CI/CD settings.</li><li>Artifact creation for data_raw.json and the node_modules directory with a 24-hour expiry.</li></ul><h3>Transform Stage</h3><p>The “Transform” stage is defined by the job 🔧 T-confluence, which modifies the extracted data into a structured format:</p><pre>🔧 T-confluence:<br>  stage: Transform<br>  script:<br>    - npm run confluence:transform<br>  when: manual  # This line makes the job manual<br>  artifacts:<br>    paths:<br>      - data_transformed.json  # Assuming this file is produced by the transform.js script<br>  dependencies:<br>    - 💫 E-confluence</pre><p>Key features:</p><ul><li>The job is also manually triggered.</li><li>It depends on the successful completion of the 💫 E-confluence job.</li><li>The transformed data is saved in data_transformed.json, which is preserved as an artifact.</li></ul><h3>Load Stage</h3><p>The “Load” stage is defined by the job ✍ L-confluence, which loads the transformed data into a vector database:</p><pre>✍ L-confluence:<br>  stage: Load<br>  script:<br>    - npm install<br>    - npm run confluence:load<br>  when: manual  # This line makes the job manual<br>  dependencies:<br>    - 🔧 T-confluence</pre><p>Key features:</p><ul><li>This stage is manually triggered.</li><li>It depends on the 🔧 T-confluence job to ensure data is transformed before loading.</li></ul><h3>Test Stage</h3><p>The “Test” job 👨‍🎓 T-confluence handles the testing of the ETL process to ensure the integrity of the data:</p><pre>👨‍🎓 T-confluence:<br>  stage: Test<br>  script:<br>    - npm install<br>    - npm run confluence:test<br>  # ...other actions...</pre><p>Key features:</p><ul><li>The job is manually triggered.</li><li>It is dependent on the 💫 E-confluence job, suggesting that it tests the extraction process or the end-to-end ETL pipeline.</li></ul><h3>Reset Stage</h3><p>Finally, the “Reset” job ⚠⚠⚠ RESET ⚠⚠⚠ is defined as resetting the environment, cleaning up, or reinitializing as needed:</p><pre>⚠⚠⚠ RESET ⚠⚠⚠:<br>  stage: Reset<br>  script:<br>    - npm install<br>    - npm run confluence:reset<br>  # ...other configurations...</pre><p>Key features:</p><ul><li>Manually triggered for controlled cleanup operations.</li><li>This is typically used to clear databases, remove temporary files, or revert settings to a baseline state.</li></ul><h4><strong>Possible enhancements</strong></h4><p><strong>1. Trigger-based Workflows</strong>:</p><ul><li>Automate your ETL workflows to initiate based on specific triggers, such as data updates in Confluence or periodic time intervals.</li></ul><p><strong>2. Rollbacks and Error Handling</strong>:</p><ul><li>Configure your pipeline to handle errors gracefully, with potential rollback mechanisms or notifications for manual intervention.</li></ul><p><strong>3. Logging and Reporting</strong>:</p><ul><li>Ensure detailed logging of each ETL step, aiding in troubleshooting, performance benchmarking, and audit compliance.</li></ul><p><strong>4. Alerts and Notifications</strong>:</p><ul><li>Set up notifications to be alerted about any disruptions, failures, or successful completion of ETL jobs.</li></ul><h3>Conclusion</h3><p>In closing, remember that the integration of Confluence, vector databases, and GitLab is not just a technical upgrade but a step towards a more innovative and efficient future. This is an evolving field, and the possibilities are vast. Stay curious and keep exploring new ways to enhance data accessibility and knowledge sharing. Your willingness to innovate and adapt will not only benefit your organization but also contribute to the broader community’s growth in this exciting domain. Let’s embrace these tools and approaches with enthusiasm and a spirit of discovery, continually pushing the boundaries of what’s possible in knowledge management.</p><p>I’d love to hear your thoughts on this process. Have you embarked on similar journeys? Any challenges or successes you’d like to share? Let’s enrich this discussion with diverse experiences!</p><p>Passionate about shaping the future of SaaS products? At EQS Group, we’re on the hunt for enthusiastic individuals ready to bring their talents to our dynamic team. Discover opportunities tailored for you: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71b3ce5b343e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/etl-pipeline-for-chatbots-using-gitlab-71b3ce5b343e">Practical ETL Pipeline for Chatbots: From Confluence to ChromaDB using GitLab</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of LLM Prompting]]></title>
            <link>https://medium.com/eqs-tech-blog/the-art-of-llm-prompting-9d28300c4092?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/9d28300c4092</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[prompt]]></category>
            <dc:creator><![CDATA[Jaouher Kharrat]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 12:18:57 GMT</pubDate>
            <atom:updated>2023-10-13T18:28:11.182Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>The Art of Prompting: A Deep Dive Into 5 Remarkable ChatGPT “Frameworks”</strong></h3><p>Navigating the nuanced pathways of ChatGPT/LLMs for around a year, both as a prompt explorer and a developer crafting an alternative at <a href="https://www.eqs.com/">EQS Group</a>, has rendered a rich tapestry of insights into the art and knowledge of effective prompting. The interplay between machine and human communication is a delicate dance, one where strategic prompting can provide a spectrum of possibilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dP06GtrS5C76Az1G2MYh6w.jpeg" /><figcaption>Mastering the art of prompting</figcaption></figure><p>In this article, I will share five personally tested prompt frameworks that have significantly enriched my interactions with ChatGPT. To illustrate each, I’ll harness the persona of a carpenter building a laptop stand.</p><h4>1. Simplifying Complexity: The RTF Framework</h4><p>Being the most widely-used framework due to its intuitive nature, RTF harnesses three pivotal points:</p><ul><li><strong>R</strong>ole</li><li><strong>T</strong>ask</li><li><strong>F</strong>ormat</li></ul><p>It functions as a universal tool for crafting prompts, simplifying them into a question, such as: “Act like a [role]. Can you [insert task] in [format] format?” Such a structure is not only easy to remember but also effortlessly applicable across varied scenarios, ensuring improved, tailored outputs.</p><blockquote><strong>Example:</strong><br>“Act like a skilled carpenter. Can you guide me through building a laptop stand using wood in a step-by-step instruction format?”</blockquote><p>Outcome:</p><p><a href="https://chat.openai.com/share/59e151fe-d02a-4b45-847c-e30b798a5883">Build Wooden Laptop Stand</a></p><h4>2. Meticulous Outputs with RODES</h4><p>The <strong>RODES </strong>framework shines, especially when examples similar to the anticipated output are at hand:</p><ul><li><strong>R</strong>ole</li><li><strong>O</strong>bjective</li><li><strong>D</strong>etails</li><li><strong>E</strong>xamples</li><li><strong>S</strong>ense Check</li></ul><p>Leveraging the <strong>RODES </strong>framework, the model is well-guided through the task with clear objectives, detailed information, real-life examples, and a final checkpoint to ensure the output aligns seamlessly with the expectations.</p><blockquote><strong>Example:</strong><br>Taking on the Role of a master woodworker, help me to define a clear Objective in creating a functional laptop stand, offering all relevant Details and Specifics, perhaps providing Examples of similar designs, and conducting a Sense Check to ensure practicality and feasibility in a home woodworking setting.</blockquote><p>Outcome:</p><p><a href="https://chat.openai.com/share/afc4a3f3-2c0e-48b4-91f5-bc9bedd3a8ae">Wooden Laptop Stand Guide</a></p><h4>3. Navigating Detailed Tasks: The RISEN Framework</h4><p><strong>RISEN </strong>lays down a structured path, especially when dealing with tasks that mandate a specific framework and discernible guidelines, such as writing tasks with constraints or crafting detailed plans:</p><ul><li><strong>R</strong>ole</li><li><strong>I</strong>nstructions</li><li><strong>S</strong>teps</li><li><strong>E</strong>nd Goal</li><li><strong>N</strong>arrowing (Constraints)</li></ul><p>By incorporating these elements, the model is offered a clear pathway to navigate through the task, aligning closely with predefined guidelines and achieving the desired end goal efficiently.</p><blockquote><strong>Example:</strong><br>Assuming the Role of a seasoned DIY expert, with clear Instructions, guide me through the Steps to create a wooden laptop stand, ensuring we achieve the End Goal of a sturdy and aesthetically pleasing stand, while Narrowing our focus to using readily available tools and materials.</blockquote><p>Outcome:</p><p><a href="https://chat.openai.com/share/4c7adb4e-0453-4096-a60f-c50bab5d3eb9">Using RISEN: Build Wooden Laptop Stand</a></p><h4>4. Step-wise Clarity: The Chain of Thought Method</h4><p>Achieving clarity and coherence in complex tasks like analytical endeavors, decision-making, and problem-solving becomes approachable with the Chain of Thought method. By merely appending, “Let’s think step-by-step” to your prompt, you invoke a sequentially reasoned output from the model, enabling it to demonstrate a visibly logical and structured thought process.</p><blockquote><strong>Example:</strong><br>Could you assist me in developing a design for a wooden laptop stand? Let’s think step-by-step about the materials, dimensions, and assembly process.</blockquote><p>Outcome:</p><p><a href="https://chat.openai.com/share/b84cee45-f819-471f-8e3f-6be492b5da64">Using Chain of Thoughts: Build Wooden Laptop Stand</a></p><h4>5. Recursive Excellence: The Chain of Density Method</h4><p>Navigating through tasks that necessitate a depth of recursion to produce progressively better outputs, the Chain of Density is a method to consider. Particularly potent for creating summaries, refining prompts, and generating valuable long-form content, this approach utilizes recursion to incrementally enhance and polish the outputs, optimizing them for usability and coherence.</p><blockquote><strong>Example:</strong><br>Could you help me refine and elaborate on this initial idea: ‘Create a sturdy laptop stand using standard wood planks and screws’, progressively improving and detailing each subsequent version of the prompt to finally provide a comprehensive guide on building a laptop stand?</blockquote><p>Outcome:</p><p><a href="https://chat.openai.com/share/f1c95dd4-81ab-409c-b3f4-2e54aa127db8">Using Chain of Density: Build Wooden Laptop Stand</a></p><h3>Conclusion</h3><p>Mastering ChatGPT or any other LLM involves not only understanding its capabilities but also effectively communicating tasks to it — and that’s where strategic prompting comes into play. The above frameworks have emerged as key allies in unlocking enhanced, targeted outputs from ChatGPT. Tailoring your prompts using these frameworks ensures that your interactions with ChatGPT are not only fruitful but also reliably consistent, optimizing your tasks and reducing the effort invested in refining outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rsPnAVXAzvAdBaAgc-aR3w.jpeg" /><figcaption>Exchange knowledge for the future</figcaption></figure><p>Your insights and experiences matter to us. Engage in the dialogue — share with us other frameworks or personal prompts that have proven effective in your ChatGPT explorations. Let’s continue to unravel the mysteries and capabilities of ChatGPT together, building a community where knowledge and experiences are shared openly and constructively.</p><p>Passionate about shaping the future of SaaS products? At EQS Group, we’re on the hunt for enthusiastic individuals ready to bring their talents to our dynamic team. Discover opportunities tailored for you: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d28300c4092" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/the-art-of-llm-prompting-9d28300c4092">The Art of LLM Prompting</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why You Should Use Psalm for PHP]]></title>
            <link>https://medium.com/eqs-tech-blog/why-you-should-use-psalm-for-php-1a11b00d5f1c?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/1a11b00d5f1c</guid>
            <category><![CDATA[static-analysis]]></category>
            <category><![CDATA[analysis-tools]]></category>
            <category><![CDATA[psalms]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Mokhtar Tlili]]></dc:creator>
            <pubDate>Mon, 19 Dec 2022 13:08:48 GMT</pubDate>
            <atom:updated>2022-12-19T13:08:47.944Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1O3pBPzYL0T6SOpA_2Ktw.png" /></figure><h3><strong>What is Psalm:</strong></h3><p>Psalm is a type-checking static analysis tool for PHP that finds bugs humans can miss and improves code quality. It is designed to be useful on both large legacy codebases and small modern ones. It can help you prevent the vast majority of type-related runtime errors and also enables you to take advantage of safe coding patterns popular in other languages.</p><p>Some people might insinuate that “PSALM” refers to something religious, but in fact, it’s short for PHP Static Analysis Linting Machine (PSALM).</p><h3><strong>Why Psalm is important:</strong></h3><p>One of the main reasons developers get more stressed while extending or debugging code is a lack of type-hinting on many properties, methods, or functions. While this code works initially, as our applications mature and our codebase grows, more clarity is needed to maintain our code, leading to more regressions and unstable services.</p><p>In addition:</p><ul><li>You might need to add more and more test cases to cover all types.</li><li>Your codebase might be confusing for new developers.</li><li>Your codebase might be unreadable or unmaintainable.</li><li>You may face the appearance of unexpected errors.</li></ul><p>Introducing a static analysis tool, such as Psalm, can be very helpful in tackling those problems.</p><h3><strong>What Psalm can do:</strong></h3><ul><li>Detect type errors</li><li>Detect dead code</li><li>Detect usages of unknown classes</li><li>Fix some detected bugs auto</li><li>And <a href="https://psalm.dev/docs/">more</a> …</li></ul><h3><strong>How Psalm works:</strong></h3><p>When using Psalm, you have to take into consideration two main parameters. Error levels and code issues.</p><p><strong>Errors levels:</strong></p><ul><li>Psalm has different levels of strictness from 1 to 8.</li><li>Level 1 is the strictest.</li><li>Level 8 is the most lenient.</li><li>The default error level is 2.</li><li>Treating errors based on level.</li></ul><p><strong>Code issues:</strong></p><ul><li><strong>error</strong> — This will cause Psalm to print a message, and ultimately terminate with a non-zero exit status.</li><li><strong>info</strong> — This will cause Psalm to print a message.</li><li><strong>suppress</strong> — This will cause Psalm to ignore the code issue entirely.</li></ul><p>When Psalm detects an issue will treat it based on error/code issue levels.</p><p>Example:</p><pre>function foo() {<br>    return &quot;foo&quot;;<br>}</pre><p>As you can see, this function returns a string value, but the return type is missing. Psalm will consider it as a code issue called <strong>MissingReturnType</strong>.</p><p>That code issue belongs to error levels 1 and 2, which means:</p><ul><li>In error level 3 or above, the issue will be ignored.</li><li>In error levels 1 or 2, the issue will be treaty as an error.</li><li>In error levels 1 or 2 with suppress configuration like ‘<a href="http://twitter.com/psalm"><strong>@psalm</strong></a><strong>-suppress MissingReturnType</strong>’ above the function. Psalm will ignore the code issue on that function only.</li></ul><p><strong><em>Notes:</em></strong></p><p>There are two places where you can <strong>suppress</strong> code issues:</p><ul><li>In Psalm configuration.</li><li>In the Docblock function, e.g. :</li></ul><pre>&lt;?php<br>/**<br> * @psalm-suppress InvalidReturnType<br> */<br>function (int $a) : string {<br>  return $a;<br>}</pre><h3><strong>How to use Psalm:</strong></h3><p>The latest stable Psalm version requires at least PHP v7.4 and Composer</p><pre>composer require --dev vimeo/psalm</pre><p>Psalm is smart enough to initialize the configuration and add the appropriate error level predicated on your codebase:</p><pre>vendor/bin/psalm --init</pre><p>A new XML file configuration will be added and might look like this:</p><pre>&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;psalm errorLevel=&quot;6&quot;&gt;<br>    &lt;projectFiles&gt;<br>        &lt;directory name=&quot;src&quot; /&gt;<br>        &lt;ignoreFiles&gt;<br>            &lt;directory name=&quot;vendor&quot; /&gt;<br>        &lt;/ignoreFiles&gt;<br>    &lt;/projectFiles&gt;<br>&lt;/psalm&gt;</pre><p>The configuration is quite simple. It defines error levels, scans directories, and ignores directories. You can find other possible configuration options on the official <a href="https://psalm.dev/">website</a>.</p><p>To start scanning, run the following command:</p><pre>vendor/bin/psalm</pre><p>Psalm can automatically fix some issues based on codes issues, e.g.:</p><pre>vendor/bin/psalm --alter --issues=InvalidReturnType</pre><h3><strong>Bonus:</strong></h3><p>For better use of Psalm, especially in a big project:</p><ul><li>Commit your code before running Psalm to avoid mixing your functional changes with Psalm changes, which might lead to a difficult recovery.</li><li>Initially, run Psalm with a high error level, and if you get many errors, try to:<br> ▹ Update the configuration to exclude code issues you do not need.<br> ▹ Use a lenient error level (5–6–7) at the beginning.<br> ▹ Split scanning by directories.</li><li>Test code after each update to make sure everything works.</li><li>Run Psalm before pushing your commits or inject it using Git hook.</li><li>Add Psalm to your CI pipeline.</li></ul><p>Done.</p><p>Hope you enjoyed reading it. Feel free to criticize.</p><p>Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a11b00d5f1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/why-you-should-use-psalm-for-php-1a11b00d5f1c">Why You Should Use Psalm for PHP</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cypress Tests Parallelization With X-Server In Gitlab CI]]></title>
            <link>https://medium.com/eqs-tech-blog/cypress-tests-parallelization-with-x-server-in-gitlab-ci-3482dd2e1709?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/3482dd2e1709</guid>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[cypress]]></category>
            <category><![CDATA[e2e-testing]]></category>
            <category><![CDATA[test-parallelization]]></category>
            <dc:creator><![CDATA[Nithin Ramesha]]></dc:creator>
            <pubDate>Mon, 24 Oct 2022 13:31:54 GMT</pubDate>
            <atom:updated>2022-10-24T17:40:49.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikmDEyhVzi9r_p1r3CNohQ.png" /></figure><p>We all have a massive amount of spec files that take an eternity to go through our pipelines. Any good end-to-end tests in a CI process should be developer friendly for developers to receive early feedback on their newest changes with the test results from the CI pipeline.</p><p>This article will aid you in parallelizing your test/spec files to reduce test execution time if you use a Cypress-Gitlab configuration in your project.</p><h3>X Server Conflict</h3><blockquote>Since Cypress requires a x11 server, and in order to progress, please familiarize yourself with the <a href="https://docs.cypress.io/guides/continuous-integration/introduction#Xvfb">xvfb</a> concept.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*YYwRUlMIYY31M9xkE1oKbQ.png" /><figcaption>The below error is thrown by the jobs Test 2 and Test 3</figcaption></figure><pre><em>_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed </em></pre><pre><a href="https://gitlab.eqs.tools/investor-relations/cockpit/mailing/cx0-mailing-feature/-/jobs/77463#L59"><em>59</em></a><em>_XSERVTransMakeAllCOTSServerListeners: server already running</em></pre><pre><a href="https://gitlab.eqs.tools/investor-relations/cockpit/mailing/cx0-mailing-feature/-/jobs/77463#L60"><em>60</em></a><em>(EE)</em></pre><pre><a href="https://gitlab.eqs.tools/investor-relations/cockpit/mailing/cx0-mailing-feature/-/jobs/77463#L61"><em>61</em></a><em>Fatal server error:</em></pre><pre><a href="https://gitlab.eqs.tools/investor-relations/cockpit/mailing/cx0-mailing-feature/-/jobs/77463#L62"><em>62</em></a><em>(EE) Cannot establish any listening sockets - Make sure an X server isn&#39;t already running(EE)</em></pre><p>Do you recognize the trouble code seen above? Otherwise, proceed to the solution section.</p><p>You probably have separated your tests to run in multiple parallel jobs in GitLab, which led to the problem. The error code attempts to convey a lot of information.</p><ul><li>The cypress instance has already established an X server in the <strong>Test 1</strong> job.</li><li>Jobs <strong>Test 2</strong> and <strong>Test 3</strong> are attempting to reach the same X server initially created and occupied by the cypress instance in Job <strong>Test 1</strong>, resulting in the &#39;server already running&#39; error.</li><li>It requests a new/available X server to avoid conflict with others.</li></ul><h3>Solution</h3><p>We use double digits to define the port to spawn different instances of the x11 server in the background, such as :99, but it can be any value between :10 and:99. By doing so, we avoid clashing x11 servers.</p><pre><strong>Xvfb :99 &amp;<br>export DISPLAY=:99</strong></pre><p>Now, let&#39;s see how we can configure the xvfb in our GitLab script.</p><pre><strong>job A</strong>:<br> <strong>stage</strong>: e2e-tests<br> <strong>script</strong>:<br>  - Xvfb :<strong>59 </strong>&amp;<br>  - export DISPLAY=:<strong>59</strong><br>  - npx cypress run --<strong>spec test1</strong>.cy.ts,<strong>test2</strong>.cy.ts,<strong>test3</strong>.cy.ts<br> <strong>after_script</strong>:<br>  - rm -rf /tmp/.<strong>X59</strong>-lock</pre><pre><strong>job B</strong>:<br> <strong>stage</strong>: e2e-tests<br> <strong>script</strong>:<br>  - Xvfb :<strong>58 </strong>&amp;<br>  - export DISPLAY=:<strong>58</strong><br>  - npx cypress run --<strong>spec test4</strong>.cy.ts,<strong>test5</strong>.cy.ts,<strong>test6</strong>.cy.ts<br> <strong>after_script</strong>:<br>  - rm -rf /tmp/.<strong>X58</strong>-lock</pre><pre><strong>job C</strong>:<br> <strong>stage</strong>: e2e-tests<br> <strong>script</strong>:<br>  - Xvfb :<strong>57 </strong>&amp;<br>  - export DISPLAY=:<strong>57</strong><br>  - npx cypress run --<strong>spec test7</strong>.cy.ts,<strong>test8</strong>.cy.ts,<strong>test9</strong>.cy.ts<br> <strong>after_script</strong>:<br>  - rm -rf /tmp/.<strong>X57</strong>-lock</pre><p>First, let&#39;s divide our test/spec files into groups to add them to the GitLab jobs. For example, we pass the following spec files for job A: <strong>test1</strong>.cy.ts, <strong>test2</strong>.cy.ts, <strong>test3</strong>.cy.ts, and so on. Depending on the number of test/spec files, you can have as many jobs as you desire.</p><blockquote><strong>Tip</strong>: In the <strong>after_script</strong>: section, we include a short piece of code that deletes the lock file generated during runtime for the port used for our Cypress test execution. So that the next time you execute the job, it won’t clash with the prior residue files in the server for the respective ports.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WF6qOVZ4uEsGVAAn0MZg7A.png" /><figcaption>An example of our internal pipeline with parallelization of e2e-tests</figcaption></figure><p>We at <a href="https://medium.com/u/687ae76fbf1">EQS Group</a> have lowered our test execution times from approximately 22 minutes to less than 5 minutes. I hope this helps you reduce your projects&#39; execution times; best wishes.</p><p>Does your heart beat for developing exciting SaaS products? We are always looking for motivated new team members. Please take a look at our vacancies: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3482dd2e1709" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/cypress-tests-parallelization-with-x-server-in-gitlab-ci-3482dd2e1709">Cypress Tests Parallelization With X-Server In Gitlab CI</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Unnecessary OOP vs Functional Programming Battle.]]></title>
            <link>https://medium.com/eqs-tech-blog/the-unnecesary-oop-vs-functional-programming-battle-488e768e20d1?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/488e768e20d1</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Javier Begarie]]></dc:creator>
            <pubDate>Fri, 14 Oct 2022 15:36:18 GMT</pubDate>
            <atom:updated>2022-10-19T10:22:03.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V275-_z9hMRSMrJ2Tm3rfA.png" /><figcaption>(self-made image)</figcaption></figure><p>In the last years, we have seen how <strong>functional programming (FP) </strong>has taken a big portion of <strong>what used to be</strong> purely <strong>Object Oriented Programming</strong>. React and Redux being important FP exponents in the frontend ecosystem have earned the respect of several developers for delivering predictable behavior which was harder to achieve with just traditional OOP constructs.</p><p>I find that the<strong> “OOP is obsolete”</strong> mindset is leaving behind highly valuable knowledge that can help break down intimidating tasks into a scalable and predictable set of pieces.</p><p>The <strong>purpose of this article</strong> is to avoid an attitude I dislike, which is simply tagging these topics as “Everyone chooses what they like” or “It’s just a balance” and abandoning any intention of <strong>crafting defined criteria</strong>. There will be people joining the programming industry every day, probably they will be looking for answers on these topics and at least we can try to appease some doubts, concerns, and questions which are usually hard to express at the beginning of such a career.</p><p>I hope you enjoy it.</p><h3>OOPsies</h3><h4>Classical Inheritance</h4><p>If you are not that familiar with the theory, OOP “allows” a class to <strong>inherit</strong> the properties from <strong>only 1</strong> different <strong>class</strong>. The reason: imagine your class tries to extend other 2 Classes, and such parent Classes have at least <strong>1 single equal member</strong>, there is no tool in the theory to <strong>decide which member</strong> should be the one being passed down to the child class.</p><p>Several languages have <strong>tried to solve</strong> this theoretical limitation with their own implementation. Sadly, having some languages implementing their own way of multiple or combinatory inheritance, and others not having it at all adds some sort of <strong>stigma</strong> to every <strong>inheritance</strong> mechanism.</p><p>In the case of Javascript, which started as a <strong>classless</strong> language (still Object Oriented), appealed to <strong>prototype inheritance</strong> which is less declarative than Classical Inheritance, but enables the developer to come up with his/her own way of inheriting behavior from any object.</p><p>I appreciate having <strong>prototype inheritance</strong> every day more as my need to control the technology I manage grows consistently.</p><p>Of course, <strong>it’s a practice I avoid</strong> (and most of the time I don’t even think about), yet probably some new convenient pattern can be conceived over this open mechanism and I will not be facing “theoretical” limitations.</p><h4>Encapsulation and State in Big Codebases</h4><p>In the early years of OOP, encapsulation alongside a limiting resource-wise environment kept the <strong>cognitive load </strong>of developers in an optimal state. Most developers were able to keep a <strong>holistic image</strong> of what the code did, as no one expected <strong>computers</strong> to develop so well and <strong>so fast</strong>, the paradigm positioned itself quite <strong>solidly</strong> without too many revisits.</p><p>This soon changed, computers were able to do exponentially more every year, and forwarding to our current times we find ourselves, often enough, trying to maintain codebases of <strong>hundreds </strong>of classes, with an over-abstracted stack of concepts, and every single class from DTOs to OmnipotentOverseerManagerFactory, acts as a “middle man” thus adding an <strong>accumulative</strong> <strong>probability</strong> of undesired <strong>side effects</strong>.</p><p>So elaborating in other terms, imagine we have hundreds of black boxes, someday a black box containing magnets will be put beside another one containing needles and there won’t be a way of knowing till that happens.</p><p>The <strong>abuse of encapsulation</strong> had led to opaque transparency a good codebase shouldn’t be afraid of having, likewise <strong>state becomes more unpredictable</strong> when there’s a lot of code having references to a single piece of data, and consequently, developers end up writing <strong>defensive code</strong> against their code.</p><h4>A Glorified Law of Instrument</h4><blockquote>“If the only tool you have is a hammer, it is tempting to treat everything as if it were a nail”</blockquote><p><strong>Exaggeratedly</strong> translated to our case would be like:</p><blockquote>“Every single code should be contained in a template and you cannot run it till having an instance of such template. When you have enough templates, you will need to have Factories, Adapters, DTOs because an anonym but significantly big enough group of people say these are the best unquestionable practices ever conceived by humanity. “.</blockquote><blockquote>Said probably no one ever but perceived as it by several developers.</blockquote><p>However, this point is more of a critique of the <strong>ecosystem and communities</strong> than the paradigm per se.</p><p>The jargon and mechanical mindsets became so present it was more common to see a boilerplate of patterns and unnecessarily long names than a simple anonymous function, making the learning curve gradually steeper and therefore reducing the willingness of newcomer programmers to dig in certain areas.</p><h3>Where OOP shines</h3><h4>Reflecting Existences and Managing Resources.</h4><p>Another way of looking at the intention in <strong>functional programming</strong> is achieving predictability by minimizing the information held by a piece of code or state.</p><p>Nevertheless, sometimes we DO want to hold a piece of information: usually monitor the state of a resource (when reading and modifying a file programmatically, keeping a network connection) or the state of an entity that can be affected by external inputs (for example, an Input Text Element in the UI)</p><p>Not saying we aren’t able to achieve the same with pure functions, but Objects come with a natural life cycle that matches the creation, availability, or removal of something. What’s more, you can control the number of instances of a certain object with private constructors and static properties.</p><p>In <strong>functional programming</strong>, there’s natural scalability for running several functions in different threads, but there’s no limit of calls and trying to make the function aware of the available resources to be executed will render it <a href="https://www.syncfusion.com/blogs/post/pure-and-impure-functions-in-javascript-a-complete-guide.aspx">impure</a> and ergo unpredictable.</p><blockquote>In a daring sentence, we can say OOP can help us to minimize resource usage while FP can help us to maximize data processing.</blockquote><h4>A Function Is a Better Atomic Artifact Than a Class, but a Class Is a Better “Mid-Size” Artifact Than HO Functions.</h4><p>I think <strong>High Order (HO)</strong> function as a <strong>concept</strong> is very <strong>wide</strong>. My problem isn’t Functors, Currying, Monads, etc, as they keep the same <strong>spirit</strong> of a plain <strong>pure function</strong>.</p><p>But when it comes to <strong>uncategorized</strong> HO Functions that decide the role, order of execution of the functions they receive as params, and also may even trigger some side effects (because in the end, our information flows out of our process) can be problematic.</p><p>The <strong>lack of “guidelines”</strong> on how to glue functions together can lead to several functions having a redundant responsibility, a too long set of parameters, unclear behavior or undesired code coupling.</p><p>On the other hand, <strong>classes</strong> are meant to have <strong>autonomy</strong> in the sense of “I know where information is and who to ask for” whereas <strong>functional programming</strong> is more about “spoon feeding” every single param that is necessary for the function to work. Classes have several ways to associate other classes and pieces of code which breaks this accumulative dependency of parameters we can suffer in <strong>functional programming</strong> when having HO functions inside other HO functions.</p><p><strong>Classes</strong> “feel” <strong>robust</strong> enough that we can <strong>delegate</strong> some <strong>autonomy</strong> to them.</p><h4>A Decent Bridge for Business and Technical Mindsets.</h4><p>In the same way, a <strong>mechanic</strong> will repair a car faster when its pieces are easy to identify, a <strong>developer</strong> will be able to maintain code bases <strong>better</strong> when a class communicates <strong>clearly</strong> what is its impact on our <strong>product</strong>.</p><p>This may sound <strong>contradictory</strong> enough, but in this part, I’m <strong>glad FP</strong> became more present, as it allows us to <strong>avoid making classes</strong> that actually have a way smaller impact than the code required to maintain them.</p><p>Still, <strong>class graphs</strong> are very useful for communicating our information domain, finding weird information couplings, presenting architectural designs, and showing big-picture ideas in seconds. Even if the final implementation isn’t exactly the early diagram, the split of a single class into smaller chunks doesn’t break the overall vision.</p><p>As our applications and services end up managing hundreds of variables, at some point is easier to conceive them as organisms and one of the most organic tools we have are class diagrams. It’s hard to represent the whole vision with constructs that only perform an atomic action, a pure function will be more predictable in behavior but it’s hard to track the role of hundreds of pieces in a single congruent concept.</p><h3>“We Should Just Use Real Sciences”</h3><p>I’d like to address this strong <strong>arguable stigma</strong> going around, which is a personal and oversimplified interpretation goes like this:</p><blockquote>“OOP is not mathematical while<strong> functional programming</strong> is, therefore Functional programming has a solid deterministic pillar OOP lacks”</blockquote><p>Personally, I answer the previous totally imagined quote in this way:</p><blockquote>“Science is not about the truth, it’s about useful models”</blockquote><p>We can <strong>dislike</strong> and criticize <strong>OOP</strong> as much as we want, but we <strong>cannot deny</strong> it is a successful model, what’s more, it is a model that allows programmers and engineers to create other useful and potentially <strong>successful models</strong>.</p><p>In comparison, Newtonian physics is nowadays obsolete in several fields, yet, many of its derivated fields (Statics) are still producing predictable outputs. A regular house won’t fall because its calculations were made with Newtonian physics.</p><p>The existence of <strong>better models</strong> does not necessarily render <strong>older models</strong> useless. There is an <strong>advantage</strong> one should not underestimate in running models that a <strong>wider audience</strong> can understand.</p><p>Additionally, we can say with good confidence <strong>all the code</strong> running in a computer is <strong>deterministic</strong>. Even when our code breaks down, it’s because at a certain point some code was defined to fail. So the paradigm is not taking determinism (one of the most robust properties Math has) out of our plate.</p><p><em>So… what does </em><strong><em>functional programming</em></strong><em> bring?</em></p><p><strong>It ensures predictability at a certain leve</strong>l.</p><p>If mathematicians make extensive use of them, it’s because they’re theoretically <strong>predictable</strong> and can be <strong>conceptually exploited</strong> as it’s easier to make affirmations about <strong>simple constructs</strong> than complex ones.</p><p>However, I do not think that the <strong>lack</strong> (or unpopularity) of a <strong>Mathematical model</strong>, one that can sustain the existence of classes and objects, should <strong>suggest</strong> we generate <strong>aversion for OOP</strong>. As I criticized OOP for not considering multiple inheritances, I have to criticize the “If it’s not written in Math, we don’t do it” obsession.</p><p>Probably the actual problem is renouncing pragmatism in favor of a theory that <strong>may</strong> have an answer written for all our problems in the pages we haven’t read yet. As Computer Science is a young discipline I would personally bet that’s not true today.</p><p>Additionally, why aren’t we widely using Prolog or Haskell which follow the most predictive constructs we can conceive in programming? Web Assembly should allow us to do such things right now. Maybe some people just want Functional Flavored Object Oriented Programming (FFOOP?, sounds funny).</p><h4>We Risk Losing Valuable Knowledge</h4><p>Quite often I find pro FP programmers (mostly in Frontend) <strong>missing</strong> certain <strong>principles</strong> that are very present in OOP communities but are not exclusive to the paradigm, and I’m talking about <strong>GRASP Design principles</strong> and <strong>GoF Design Patterns</strong>.</p><p>These are the <strong>main villains</strong> in the <strong>Law of Instrument</strong> pointed out earlier in this article, still what they solve has been translated into several shapes because while they may not enumerate every single challenge we face, they <strong>account</strong> for several <strong>common problems</strong> the current state of programming brings and its <strong>solution</strong>.</p><p>The well-known <a href="https://angular.io/guide/content-projection"><strong>Content Projection</strong></a> pattern in the frontend can be seen as an alternate Visitor Pattern. One part of your implementation is opening the door for a third party to do what pleases providing a limited context.</p><p>MutationObserver, IntersectionObserver, and ResizeObserver are clear implementations of the <strong>Observer</strong> pattern that allow us to write cheaper reactive code instead of spamming throttled <em>while(true) </em>against our DOM elements<em>.</em></p><p>The experimental decorator feature we get with Typescript is a sugar syntax of the <strong>Decorator</strong> pattern, which is clearly the enhancement or enrichment of a piece of code and kind of addresses the limitations inheritance have.</p><p>From my side, just in the frontend, I have made use of Builders, Factories, Strategies, Façade, Adapters, and Singleton patterns which have made my <strong>bigger tasks</strong> much <strong>easier</strong> than what could’ve been without knowing those patterns, and additionally I’m enabling other developers who are familiar with them being able to maintain such structures.</p><p>I know there are <strong>people</strong> who <strong>overuse</strong> these patterns (which is not good), yet we have to acknowledge this high-level jargon communicates entire dynamics by just making use of a single word or suffix.</p><p>It requires less effort to teach a person that knows the entire toolbox to not use all the tools every time <strong>than</strong> teaching a person the whole toolbox from zero.</p><p>If you are not familiar with most of these patterns yet, there is no rush. I can recommend trying to map what they solve to a problem you had or trying to re-imagine in one of these patterns how certain library solves specific difficulties helps<strong>.</strong></p><h3>Symbiosis Is Better Than a Rivalry</h3><p>As I clarified in the beginning, I’m not the kind of person that likes to summarize everything in the very trite phrase “it’s a balance”. I do believe when 2 ideological poles clash with each other, applying objective criteria allows anyone to choose the <strong>most useful parts of one</strong> and the <strong>most useful parts of the other</strong> given a situation.</p><p>Personally, I think in most Frontend ecosystems, we want to <strong>maximize</strong> the number of <strong>pure functions</strong> and <strong>immutable objects</strong> as our scripting should only take care of what’s shown on the screen and interact with a server, we have minimal needs for programmatic persistence, null file system management, and the browser takes care of the low-level I/O behavior.</p><p>Having said that, we still have good examples of implementations that combine both approaches:</p><p><strong>RxJS</strong>: Observables are objects, but most of their operators are Functors that allows us to work over the information stream without worry our code can affect the original information. Furthermore, as observables are objects we can manage their creation and destruction at any desired time.</p><p><strong>Luxon</strong>: Date and Time library. Makes use of immutable objects, and any operation to a given object will create another object.</p><p><strong>MobX</strong>: State management with Observables.</p><p>Combining both approaches seems to bring big advantages. We can see reactive programming exploiting both paradigms for bringing maintainable asynchronous code without much burden.</p><p>From the top of my mind, we could also have class-based immutable objects as in:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd1ac4ee02d36c84eb6e68d0f736bc81/href">https://medium.com/media/cd1ac4ee02d36c84eb6e68d0f736bc81/href</a></iframe><p>Which could fit scenarios in languages that don’t have literal objects such as Javascript.</p><h4>Conclusion</h4><p><strong>Functional programming</strong> has come to stay and for solid reasons, however, that shouldn’t make us blindly go to throw away the vast development OOP communities have provided over the last decades. Probably a good portion of the community has to admit the praxis bias made them go to an extreme, but if the techniques are still bringing robustness and confidence in certain aspects ignoring them can be too costly.</p><p>On the other hand, I do believe OOP needs a revision or to be willing to evolve in a useful manner continuously.</p><p>The fact several languages and book authors recommend avoiding or “working around” the core flaws of the theory when put into reality should trigger alarms in the Computer Science community, these are our most popular and promoted academic tools.</p><p>Still, I guess we will see both paradigms coexisting and empowering each other for the next decade.</p><p>Even when different developers get to grow their own defined preferences the potentials of both paradigms building each other can open better, more predictable, and efficient ways of programming, which in the end, benefits us all.</p><p>Personally, I’m sure using both makes me a better professional than using just one.</p><p>Thanks for making it this far. Have a nice day.</p><p>Does your heart beat for developing exciting SaaS products? We are always looking for motivated new team members. Take a look at our vacancies: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=488e768e20d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/the-unnecesary-oop-vs-functional-programming-battle-488e768e20d1">The Unnecessary OOP vs Functional Programming Battle.</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empathy With Legacy Code]]></title>
            <link>https://medium.com/eqs-tech-blog/empathy-with-legacy-code-e4c0c7b2c793?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/e4c0c7b2c793</guid>
            <category><![CDATA[legacy-code]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[refactoring]]></category>
            <dc:creator><![CDATA[Asim Husanović]]></dc:creator>
            <pubDate>Thu, 06 Oct 2022 20:49:29 GMT</pubDate>
            <atom:updated>2022-10-06T20:49:29.895Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfhdJWI0dA_xHw4ix1yk4w.jpeg" /><figcaption>Source: <a href="https://assets.asana.biz/transform/8755b248-aa09-429f-88ab-1664f31c4ce5/article-leadership-empathy-map-template-2x">https://assets.asana.biz/transform/8755b248-aa09-429f-88ab-1664f31c4ce5/article-leadership-empathy-map-template-2x</a></figcaption></figure><h3>TL;DR</h3><p>Empathy with legacy code is important because:</p><ul><li>It can help developers better understand the code and make modifications as needed.</li><li>It is vital for developers to understand how users interact with their software and how they feel about its usage.</li><li>It can help developers put themselves in the users’ shoes and determine their needs and desires.</li><li>Empathy is particularly important when developers need to work with legacy products because this can be a difficult and frustrating experience.</li></ul><p>To have empathy with legacy code, developers should:</p><ul><li>Understand the purpose of the code.</li><li>Understand the structure of the code.</li><li>Write unit tests for the code.</li></ul><h3>Motivation for This Article</h3><p>The primary motivation of this text is to serve as an introductory guide for developers who need to work with legacy (existing) code. It is also intended to serve as a reminder for experienced developers who may have forgotten certain bases.</p><p>Hopefully, this text will help developers to have more success in their work with legacy (existing) code.</p><h3>Introduction</h3><p><strong>Empathy</strong> is the ability to comprehend and share someone else’s feelings. It is a fundamental human quality that allows us to be compassionate and connect with others. When we empathize with someone, we can look at the world from their point of view and understand their feelings. Empathy is a critical part of our social cognition and plays a role in our capacity to connect and communicate with others. Empathy is a complex emotion that may be difficult to define, but it is usually seen as a positive emotion that helps us feel connected to others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*haDvFD10lNVAjLrOprruUg.jpeg" /><figcaption>Source: <a href="https://pxhere.com/de/photo/1093445">https://pxhere.com/de/photo/1093445</a></figcaption></figure><p>A <strong>legacy</strong> is something that is passed on generation after generation. This may be a physical object, such as a piece of jewelry, or something more intangible, such as a family tradition. In the IT world, the word “legacy” can also refer to any outdated hardware or software that is still in use.</p><p><strong>Legacy code</strong> is the code that the original developers do not maintain anymore. It is often written in an out-of-date programming language or on an unsupported platform. Moreover, the existing code is hard to understand, modify or even extend and newly written code does not have automated tests or documentation.</p><p><strong>Empathy with legacy</strong> is the ability to understand and share the sentiments of those who came before us. This is about being able to see the world through their eyes and understand their experiences.</p><p><strong>Empathy with legacy code</strong> is the ability to understand and work with code written by another individual. It is essential to empathize with the inherited code, as it can be challenging to read and understand the code you have not produced. Empathy with the existing code can help you to understand and modify it if necessary.</p><p>Empathy is essential for developers because it allows them to understand how users interact with their software and how they feel about using it. It also helps developers put themselves in the place of users and understand their needs and wants. Empathy is particularly important when developers need to work with existing products, as this can be a challenging and frustrating experience. However, by having compassion for the legacy products, developers can hope to create new products that are compatible with them.</p><p>Here are a few tricks we need to do to be better at building new projects based on legacy code or refactoring legacy code.</p><h3>Purpose, Structure, Testing, and Verification</h3><p>It is crucial to understand the <strong>purpose</strong> of legacy code to fully understand the programmers who wrote the code at the time, with the available technologies.</p><p>Another thing is to understand the <strong>structure</strong> of the code.</p><p>And the third is optional but very important. If possible, write <strong>unit tests</strong> for legacy code.</p><p>Refactoring code may be a very satisfactory experience for developers. Once they have a functioning system, they can finally take the time to redesign it and write it the way they think it should be. This is because, during the development of applications, there are still time constraints, new features, etc., that can prevent developers from following their own rules and coding principles.</p><p>When developers work with code written by someone else, it is essential that they first understand the purpose of the code. Once the purpose is understood, the programmer has greater capacity and opportunity to understand the structure of the code better. This may be difficult if the code is written in an outdated programming language or utilizes outdated principles. In these cases, writing unit tests can help validate assumptions on the functioning of the code.</p><h3>Easy To Say (but So Difficult To Do)</h3><p>Practice and theory are different. Although code refactoring is often written and talked about (in textbooks, books, and conferences), it is much more difficult to refactor code in practice.</p><p>We often come across how to understand the purpose of the code, its structure, or how to write unit tests in speeches. How to put it into practice is much more challenging.</p><p>Below we give examples that will help you understand the theory and the actual practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*upJgm1VmUqZ5D1UpbgAWQw.jpeg" /><figcaption>source: <a href="https://steemit.com/quotes/@kingcoc/a-phrase-that-s-easy-to-say-but-a-hard-thing-to-do-when-you-re-broken">https://steemit.com/quotes/@kingcoc/a-phrase-that-s-easy-to-say-but-a-hard-thing-to-do-when-you-re-broken</a></figcaption></figure><h3>Understanding Purpose</h3><p>When documentation or code does not have comments to explain the purpose of particular methods, classes, parameters, or return values, another tactic should be taken.</p><p>First, find the people who wrote the code. If they do not exist, try to find people who participated in the software design, based on which the purpose of the functionality can be determined. If there are no such people, try to find people who use the software. In that case, they can be beneficial. Even more, sometimes they can say much more than the programmers themselves (who probably forgot why they wrote code long ago) because they know how the program works, its shortcomings, what errors it has, and the like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*cXZR1hvzqTgU2V9iX5YlkA.jpeg" /><figcaption>source: <a href="https://commons.wikimedia.org/wiki/File:Business_presentation_byVectorOpenStock.jpg">https://commons.wikimedia.org/wiki/File:Business_presentation_byVectorOpenStock.jpg</a></figcaption></figure><p>After the meeting, you should be able to answer the following questions:</p><ol><li>Which problem does the software resolve exactly?</li><li>What are the expected inputs, and what are the outputs of a given feature? It is essential to be aware of the limits and restrictions!</li><li>Which are the dependencies of certain features? Is there any precise sequence of actions?</li></ol><h3>Understanding Structure</h3><p>To understand the general structure of the legacy code, it is necessary to be able to answer the following questions:</p><ol><li>Identify the entry point of the code. This is typically the main function.</li><li>Identify the dependencies of the code. These are the libraries that the code uses.</li></ol><p>To understand a particular code, it is necessary to be able to do the following:</p><ol><li>Identify the purpose of the observed code.</li><li>Understand the code flow.</li><li>Analyze the code behavior.</li><li>Understand the code dependencies.</li></ol><p><strong>Advice:</strong></p><p>When you have drawn the schematics, diagrams, and workflows, arrange another meeting with the abovementioned people. Do not make your presentation too technical if there are no technical people at the conference; this will help you to identify any mistakes you may have made in your understanding of the purpose and functionality.</p><h3>Unit Tests (Optional)</h3><p>If a project has a code freeze, making changes or writing unit tests may not be possible. However, if this is not the case, writing a few unit tests can help ensure that your understanding of the code is correct. You don’t need to write unit tests for every aspect of the code, but a few critical tests can help ensure accuracy.</p><h3>Why?</h3><p>Before embarking on the adventure of refactoring legacy code, it is essential to ask yourself WHY it should be done. Is there an actual purpose?</p><p>After answering this question, or perhaps better yet, following the iterative questioning technique used to investigate cause and effect relationships — the five WHYs, it is essential to ask yourself the question HOW?</p><p>If you can answer 5 WHYs and one HOW it shouldn’t be a problem to answer the question WHO?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*jJ26HbukZ9uFmgA3" /><figcaption>Source: flickr.com</figcaption></figure><h3>Conclusion</h3><p>Understanding and sharing the feelings of those who wrote the code allows developers to understand the code better and make the necessary changes. Empathy can help developers position themselves as users and understand their needs and desires.</p><p>Does your heart beat for developing exciting SaaS products? We are always looking for motivated new team members. Take a look at our vacancies: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4c0c7b2c793" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/empathy-with-legacy-code-e4c0c7b2c793">Empathy With Legacy Code</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Custom form validators in Angular]]></title>
            <link>https://medium.com/eqs-tech-blog/custom-form-validators-in-angular-903e537a8df3?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/903e537a8df3</guid>
            <category><![CDATA[form-validation]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Elena Raspopova]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 15:04:06 GMT</pubDate>
            <atom:updated>2022-09-12T15:10:46.397Z</atom:updated>
            <content:encoded><![CDATA[<h3>Custom Form Validators in Angular</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*pWVpYYT-VfqqbUyKVe8qXA.jpeg" /></figure><p>Almost every application requires forms. Thankfully, Angular, unlike other frameworks, provides built-in validators which are very helpful and could cover most cases.</p><p>In this article, we first take a look at some built-in Angular validators and then learn how to implement our own custom validator.</p><h3>Angular Built-In Validators</h3><p>Here are some of the useful built-in validators provided by Angular:</p><ul><li><strong>required: </strong>requires having a non-empty value</li><li><strong>pattern: </strong>requires a value matching a provided regex</li><li><strong>minlength and maxlength: </strong>requires a form control to have a value of a minimum/maximum length.</li></ul><p>We can use these validators on reactive forms as well as on corresponding directives.</p><p><em>In order to use validators on template-driven forms don’t forget to import Angular’s </em><em>FormsModule to your application module first.</em></p><p>For instance, in order to validate the required field with minimal length 4 on template-driven forms, you need just add required<strong> </strong>and<strong> </strong>minlength=&quot;4&quot;<strong> </strong>attributes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/558daf1f61e6319bac0c173d4ed1d0fb/href">https://medium.com/media/558daf1f61e6319bac0c173d4ed1d0fb/href</a></iframe><p>To use validators in a reactive form, firstly, we need to import ReactiveFormsModule into the module.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b885e5d35bcd734f77a289ee4b0d9a9/href">https://medium.com/media/2b885e5d35bcd734f77a289ee4b0d9a9/href</a></iframe><p>And then we can apply validators in our form using FormControl and FormGroup:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d6ee4f84d133803dd72904b911f2826/href">https://medium.com/media/1d6ee4f84d133803dd72904b911f2826/href</a></iframe><h3>Implementing a Custom Validator</h3><p>However, in some cases, we need to create custom validators.</p><p>Validators are just functions that take as an input a FormControl and return null when it is valid or an error if it is not.</p><p>For the article’s sake, let’s imagine a situation when we need to validate a date. The date should be later than today. This case could be handy, for instance, for tickets or hotel bookings.</p><p>All we need to do is create a function that takes a FormControl and check if its value matches our condition or not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40651bdc57caacfe493625ef7603af12/href">https://medium.com/media/40651bdc57caacfe493625ef7603af12/href</a></iframe><p>The date input field is now validated. If it’s earlier than today, our validator will return an error object with the key dateNotValid.</p><p>To use our validator in a model-driven form we pass our function into FormControl:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/966b3d26e91095aff78696f556d0de52/href">https://medium.com/media/966b3d26e91095aff78696f556d0de52/href</a></iframe><p>If we want to combine multiple validators on a single control, just insert the required validators as an array, like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ac5d306073a560220ac00c39798f632/href">https://medium.com/media/0ac5d306073a560220ac00c39798f632/href</a></iframe><p>Let’s add a helpful message to a user if our validator fails:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f4a617a5c0a57af97cfe1e37b2e55f6/href">https://medium.com/media/8f4a617a5c0a57af97cfe1e37b2e55f6/href</a></iframe><h3>Multi-Field Custom Validators</h3><p>Another case is when we need to create a custom validator that is dependent on a value of a different field of the form. The following scenario requires us to compare at least two fields.</p><p>When we validate multiple fields, we need to be sure that our validation logic runs for each of those fields. Therefore we attach the validator to the FormGroup instead of FormControl.</p><p>Using the FormGroup, we can easily access any value of the form and compare multiple values.</p><p>Let’s create a validator function that compares two dates. For instance, the end date must be greater than the start date.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2fe08cb61be02fa2988a9d77e660e2c/href">https://medium.com/media/a2fe08cb61be02fa2988a9d77e660e2c/href</a></iframe><p>We use the <strong>get</strong> method in order to get the value of both fields.</p><p>If our condition is fulfilled then return the dateRangeError, otherwise — null.</p><p>That’s it! Pretty much like we did with the previous validator function.</p><p>Now we need to attach validateDates validator to FormGroup as a second argument as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ef8bc7557ac9b74637644e578b36662/href">https://medium.com/media/2ef8bc7557ac9b74637644e578b36662/href</a></iframe><h3>Conclusion</h3><p>In this article, we went through some built-in validators and were able to create a custom Angular validator and a multi-field custom validator. In the end, a custom validator is just a function that returns either an error object or <strong>null</strong>.</p><p>You can find more information about built-in validators and how to create custom validators in <a href="https://angular.io/guide/form-validation">the official documentation</a>.</p><p>Your heart beats for developing exciting SaaS products? We are always looking for motivated new team members. Take a look at our vacancies: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=903e537a8df3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/custom-form-validators-in-angular-903e537a8df3">Custom form validators in Angular</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why using a blockchain could be a bad idea for a SaaS compliance product]]></title>
            <link>https://medium.com/eqs-tech-blog/why-using-a-blockchain-could-be-a-bad-idea-for-a-saas-compliance-product-5ce1513104c?source=rss----1c67e6caba09---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ce1513104c</guid>
            <category><![CDATA[whistleblowing]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[compliance-solutions]]></category>
            <category><![CDATA[compliance-management]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Marco Ermini]]></dc:creator>
            <pubDate>Tue, 26 Jul 2022 10:21:37 GMT</pubDate>
            <atom:updated>2022-07-26T12:04:05.770Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<h4>Don’t fall for the blockchain hype</h4><figure><img alt="A chain of blocks, or blockchain (Shutterstock image)" src="https://cdn-images-1.medium.com/max/502/1*Oq9fikBmRMxDesqvpdIvfw.png" /><figcaption>A chain of blocks, or blockchain (Shutterstock image)</figcaption></figure><h4>Table of content</h4><ul><li><a href="#4279">Short Intro — my blockchain credentials.</a></li><li><a href="#44d2">What are the issues and risks to consider when using blockchain?</a><br>– <a href="#f96c">Marketing hype and inconsistent definitions.</a><br>– <a href="#6e40">Scalability.</a><br>– <a href="#f676">Response Time.</a><br>– <a href="#dc2d">Blockchain does not provide any security by default.</a><br>– <a href="#2912">It is hard to assess risk and exposure when evaluating blockchain offerings.</a></li><li><a href="#34c4">Why we may think about using a blockchain?</a><br>– <a href="#b8fb">Mitigating Trust and Transparency Issues.</a><br>– <a href="#0a8e">Decentralization of decisions and storage.</a><br>– <a href="#ca7a">Managing and Ensuring the Integrity of Digital Assets.</a><br>– <a href="#49e4">Increasing Fault Tolerance and Resilience.</a></li><li><a href="#dd0d">When should we really use a blockchain?</a></li><li><a href="#6924">How does blockchain requirements measure against the use case of a Compliance application?</a></li><li><a href="#1516">Questions you should ask a supplier offering a Compliance solution based on blockchain.</a></li><li><a href="#2e4f">Questions you should ask yourself before adopting a Compliance solution based on blockchain.</a></li><li><a href="#c4b8">Conclusions.</a></li></ul><h3>Short Intro — my blockchain credentials.</h3><p>First — I believe I cannot be accused of not being a supporter of the blockchain. Maybe, even more, than I would really like to admit.</p><p>I was very much into blockchain up to a couple of years ago (I gave variations of this <a href="https://github.com/markoer73/blockchain">presentation</a> — you can also watch it <a href="https://www.slideshare.net/markoermacchi/blockchain-everyone-wants-to-sell-me-that-but-is-that-really-right-for-my-application">from Slideshare</a> — at several conferences including the <a href="https://www.isaca.org/">ISACA</a> <a href="https://www.isaca.org/training-and-events/conferences">Cybersecurity Nexus (CSX) Europe 2018</a>; I got <a href="http://bit.ly/BCE_v1">twice certified</a> on <a href="https://bit.ly/BCE_v2">IBM Hyperledger</a>; I graduated from a pretty technical <a href="https://courses.edx.org/certificates/ae03659e1eb34154a56a0dd7049d68f5">Berkeley course</a> on Bitcoin, cryptocurrency, and in general, about all the basics of blockchain and underlining protocols; even recently, I <a href="https://github.com/markoer73/client-centric-consistency-cse531">coded consensus protocols with Python</a> as part of my master-level studies at the <a href="https://engineering.asu.edu/about/">Ira A. Fulton Schools of Engineering at Arizona State University</a>; and so on).</p><p>Of course, I noticed the massive hype mounting around blockchain, which has led to millions in investments. Fierce critics and detractors were not lacking:</p><p><em>“Blockchain Is The Most Over-Hyped Technology Ever, No Better than a Spreadsheet/Database”</em><a href="#aa9c"><em> ¹</em></a></p><p><em>“‘Shitcoin’ is a pejorative term used to describe an altcoin that has become worthless.” </em><a href="#3df8"><em>²</em></a></p><p><em>“Ten years in, nobody has come up with a use for blockchain.” </em><a href="#3f49"><em>³</em></a></p><p>“<em>Blockchain is not only crappy technology but a bad vision for the future.” </em><a href="#acc5"><em>⁴</em></a></p><p>“<em>There is no single person in existence who had a problem they wanted to solve, discovered that an available blockchain solution was the best way to solve it, and therefore became a blockchain enthusiast.” </em><a href="#8e26"><em>⁵</em></a></p><p>The issue is, that many do not understand that blockchain is more of a <a href="https://www.freecodecamp.org/news/the-basic-design-patterns-all-developers-need-to-know/">design pattern</a> than a technology. This design pattern in itself relies on pieces of technologies, such as:</p><ul><li><a href="https://www.wikiwand.com/en/Peer-to-peer">P2P networks</a></li><li>a <a href="https://dzone.com/articles/a-brief-analysis-of-consensus-protocol-from-logica">consensus protocol</a></li><li><a href="https://medium.com/hashmart-blog/the-basic-principles-of-cryptography-you-should-know-c8deeaad29c5">basic cryptography</a> such as <a href="https://www.wikiwand.com/en/Hash_function">hashing</a></li><li><a href="https://www.ibm.com/cloud/learn/file-storage">basic storage</a> capabilities</li></ul><p>Obviously, one or more of those can be singularly adopted in non-blockchain applications; the only case where blockchain applications are required is when <em>all of them</em> must be used <em>together</em> in a <em>certain way</em>.</p><h3>What are the issues and risks to consider when using blockchain?</h3><p>When implementing a blockchain architecture, we need to consider the following risks:</p><h4><strong>Marketing hype and inconsistent definitions.</strong></h4><p>The definition of blockchain and the applications thereof are highly fluid. Specific implementations vary in functionality, and many proposed solutions are yet to emerge from the conceptual stage. It is often difficult to pierce through the evangelistic marketing hype, which distracts attention from the development of a targeted set of potential use cases. As a matter of fact, up to 2022, there are really very few production-worth applications shipped that utilize blockchain outside cryptocurrency, FinTech, and Cybersecurity.</p><h4><strong>Scalability</strong>.</h4><p>As transactions, (big) data, devices, and identities explode, so does the requirement to manage and store all artifacts relating to them. Depending on the blockchain system itself, downstream applications, and the distribution of nodes, the scale can be a possible benefit; however, scale in the blockchain community is an active area of research and development, and is mostly considered a risk more than an advantage.</p><h4><strong>Response Time.</strong></h4><p>To increase scale and responsiveness, blockchain developers can leverage data and asset object hashes, and store those in the blockchain, rather than the entire object itself. However, transactions per second (TPS), a critical metric when determining performance, remains poor with most blockchain systems today, despite the efforts of certain technology providers focused on building a scalable and responsive blockchain-based database, with TPS as a critical metric.</p><h4>Blockchain does not provide any security by default.</h4><p>Contrary to a popular belief, <strong>blockchain is not immune to cyberattacks or fraud — </strong>quite the contrary.</p><p>Initial blockchain deployments (such as bitcoin) have proven to be quite resilient. However, <strong>it is naïve to rely solely on the apparent robustness of cryptographic algorithms for security</strong>.</p><p>Blockchain security can best be defined as the least common denominator of cryptography, associated key management, software implementation, and the operating system(s) upon which the blockchain platform operates.</p><p>As more and more applications of the blockchain have been shipped, the surface of attack has extended, and the burden of security has moved from the network to the endpoints that are writing to the blockchain. Like in any other cryptographic system, vulnerabilities often occur in ancillary system components (such as operating systems), networking protocols, and some security-related areas (such as key management, protection, and distribution). For instance, a <strong>very high-profile attack against Ethereum in 2017</strong> (which allowed <a href="https://thehackernews.com/2017/07/ethereum-cryptocurrency-hacking.html">attackers to steal $32 million from a variety of crypto-wallets</a>) demonstrates how attackers search for weaknesses across blockchain system dependencies (in this case it was a heavily-relied-upon library that related to the crypto-wallet).</p><p>Many blockchain applications run “<strong>smart contracts</strong>”, that is, code that is executed whenever certain conditions on the ledger, such as a transaction, are triggered. While this feature is extremely useful and one of the main drivers for blockchain adoption (for instance, it is the mechanism that allows crypto-exchanges to reward themselves for the transactions provided to users), we need to remind that this is still computer code, and as any other code, <strong>it will contain vulnerabilities which can be exploited</strong>.</p><p>Bitcoin has kept the possible logic of this code voluntary simple in order to limit exploiting possibilities; however, this has also restricted practical usages of its ledger outside of bitcoin itself, and therefore more advanced possibilities have been introduced with newer blockchains based on the Ethereum ledger. Attacks on the Distributed Autonomous Organization (DAO), involve the exploitation of weaknesses in the logic of smart contracts based on the Ethereum blockchain, even when they are (ironically) executed in a cryptographically sound way. The programming capabilities of Ethereum allow <strong>introducing flaws in the software architecture</strong>, which compounds the <strong>lack of experience, specialized audit and debugging tools, and the complexity in the logic while programming smart contracts. </strong>A “stupid” code error has been the cause of a major hack that <a href="https://arstechnica.com/information-technology/2021/12/hackers-drain-31-million-from-cryptocurrency-service-monox-finance/">in 2021 ruined the startup MonoX Finance</a> as they lost $31 million from “smart attackers”.</p><p>Finally, when implementing the business logic on the blockchain, excessive complexity can also introduce <strong>weak links in the business logic</strong> that attackers can point into, such as the one that <a href="https://medium.com/@ashish4sharma/what-happened-to-terra-ust-luna-exactly-and-what-do-we-learn-from-this-f094f0ded9f">in 2022 wiped the savings of hundreds of Terra-UST-LUNA investors</a>, bringing the value of the cryptocurrency down by 98.3% in just a couple of days.</p><h4>It is hard to assess risk and exposure when evaluating blockchain offerings.</h4><p>First, with blockchain, it is difficult to construct a detailed threat model on which to perform a risk assessment. Simply adopting a vendor of a blockchain application, without understanding the implication of the technology, is obviously not a good idea: <strong>you only shift responsibility — you never outsource accountability</strong>. Compliance Program Leaders must ensure that they <strong>treat governance and accountability separate from blockchain technology</strong>.</p><p>Second, blockchain is a complex technological system and can lack the clarity of oversight and auditability that more traditional systems offer. It is relatively simple to explain traditional database-based applications to IT or Information Security leadership; however, with blockchain, intricate and subtle flaws in software architectures require considerable skills and expertise to understand. As a result, <strong>compliance and enforcement costs may increase, not decrease</strong>, as some regulatory environments require oversight and accountability that are difficult to achieve with blockchain.</p><p>Blockchain is relatively new, and expertise is lacking even in traditional risk management fields — let alone in the blockchain. The complexity of blockchain makes it difficult to accurately assess risk, and exposure remains a challenge. In addition, this is exacerbated because there are currently no common standards or regulations.</p><h3>Why we may think about using a blockchain?</h3><p>Given all of those drawbacks, you may be wondering why we should bother about using blockchain at all.</p><p>There are certainly benefits and legitimate use cases that can be brought by using blockchain. Some known core advantages of a blockchain architecture include the following:</p><h4><strong>Mitigating Trust and Transparency Issues.</strong></h4><p>Blockchain is based on a distributed and decentralized architecture. Depending on the particular blockchain platform, all transactions are made available to interested parties via the blockchain. The notion of “interested parties” can vary depending on requirements (for example, enterprise-oriented blockchains may only be limited to the enterprise itself). The blockchain, in theory, is not controlled by a central authority, thus providing transparency, community control, and data integrity.</p><h4>Decentralization of decisions and storage.</h4><p>Use cases allowing <strong>decentralization wherever there is still a centralized trust arbiter</strong>. For example, a blockchain-enabled Land Registry replacement would allow any interested individual to discover ownership of land, while also ensuring that transfer of ownership does not occur without the authorized consent of interested parties (for example, a financial institution holding the property as security for a loan). Other potential uses include notification of fraud between consortium members; verification and repudiation of identity proofing; and the distribution, verification, and revocation of public keys in an extension to public-key infrastructure (PKI).</p><h4><strong>Managing and Ensuring the Integrity of Digital Assets.</strong></h4><p>Since blockchain can mitigate trust and transparency concerns, ensuring integrity is an inherited outcome. One of the key aspects that ensures the integrity of data is that all transactions are digitally signed, and a consensus system is leveraged to mitigate against fraud and ensure the overall functioning of the blockchain system. The consensus approach will differ depending on the nature and application of the blockchain system. Once the data or transaction meets the consensus requirements, it is placed in the immutable public ledger. Tampering, or attempts at the fraud of this ledger, are made evident through the cryptographic nature of the entities/blocks within the blockchain itself. Most importantly, the cryptographic binding of all the elements, or blocks, in a blockchain and the associated data are stored in the ledger for as long as the blockchain system still exists.</p><h4>Increasing Fault Tolerance and Resilience.</h4><p>The decentralized and distributed nature of blockchain provides a level of fault tolerance and resilience. In an ideal blockchain system, if nodes are diverse and distributed — both from a system and location perspective — mitigation against brute-force attacks (such as “denial of service” or “distributed denial of service” attacks) can be achieved. As the number of nodes in the system increases, so does the ability to mitigate against faults and resilience. However, there are several considerations to make: is the required volume, diversity, and distribution of these nodes accounted for when considering this benefit? Can the same result be obtained with more traditional technologies, like data center redundancy and network attacks mitigation, and in a more economical fashion? Is the solution explored really such a mission-critical service that it cannot afford even a minimal downtime?</p><p>Generally, the benefits of decreased downtime tend to flat-out after an SLA of 90–95% availability. After this level of availability, the costs for resilience increase exponentially and should be really deserved for enterprise mission-critical or life-preserving services.</p><h3>When should we really use a blockchain?</h3><p>After all of this digression about the pros and cons of the blockchain, we can summarize that blockchain should only be considered for specific use cases, such as the ones where:</p><ol><li>Hundreds of different participants have to write at the same time.</li><li>There is a need to decentralize the governance of the changes to the ledger, where the consensus on the changes is complicated.</li><li>The software adopts an open-source model.</li><li>Data integrity resistance is more valuable than efficiency and cost containment.</li><li>The use case leverages decentralized storage via P2P networks.</li><li>Business logic is kept simple.</li><li>Privacy of transactions is not necessary (everyone can know that a transaction has happened), or at least, it is not the fundamental requirement of the application.</li><li>Transactions must be immutable, which means, immutability takes precedence over other considerations, such as the need to remove sensitive information, or legal requirements to remove certain content.</li></ol><h3>How does blockchain requirements measure against the use case of a Compliance application?</h3><p>My takes on those are:</p><ol><li><em>Hundreds of different participants have to write at the same time.</em> This is very unlikely to be a hard requirement in Compliance software — most certainly, this is not happening in a whistleblower solution, especially because every customer will need to have its ledger. The key question is, how is the ledger managed? If every participant must share the same ledger, a major issue arises — there is a requirement for a <em>permission ledger </em>blockchain, which is <strong>more complicated</strong> and generally regarded as <strong>less secure</strong>. Conversely, if every customer is installing its ledger, we need to <strong>measure if there is any benefit justifying the additional cost</strong> against a simple, cheap database.</li><li><em>There is a need to decentralize the governance of the changes to the ledger, where the consensus on the changes is complicated.</em> Absolutely not the case in Compliance: for instance, on a whistleblowing system, the states of the cases are straightforward — a case is either saved, assigned, opened, examined, or closed — and it does not require voting between unknown participants to decide on such state changes. <strong>Quite the contrary</strong>, there are specific roles assigned to perform state changes, and we do not want interferences to happen.</li><li><em>The software adopts an open-source model.</em> Proprietary blockchain solutions are costly and unneeded, while in reality, everyone is using some variation of open-source ledgers such as the Linux Foundation&#39;s <a href="https://www.hyperledger.org/">Hyperledger</a>. <strong>If the Compliance solution will not be fully open-source, it makes no sense to use a blockchain</strong>. For instance, in the case of whistleblowing software, I believe that being open-source is not a key driver. Conversely, companies may prefer to use an external SaaS service rather than internal implementation because <strong>reporters are generally skeptic of using a solution that resides in the same IT infrastructure of the company they report about</strong>. To me, I see a clear case for a whistleblowing solution for not using open-source software.</li><li><em>Data integrity resistance is more valuable than efficiency and cost containment</em>. This basically sums up to the fact that the user has very deep pockets for an implementation that will require lots of IT resources, and doesn’t mind <strong>using a blockchain for something that can be perfectly done by a database for a fraction of the infrastructure cost</strong>.</li><li><em>The use case leverages decentralized storage via P2P networks</em>. Maybe, P2P networks can be applied to certain Compliance applications, such as an ESG or <a href="https://seedtrace.org/">Third-Party verification system</a>, where third-party participants and suppliers may need to provide records of compliance to a requestor seeking evidence. Besides that, I am not convinced: why would you want to use a P2P network? If a SaaS Compliance solution is offered, the application will want to logically keep everything on the same database or ledger to leverage the economy of scale; <strong>if every company implements the solution in its IT infrastructure, why would they want to generate transactions among each other’s</strong>? Besides the mentioned record validation (which can also be done in several other ways, <a href="https://www.eqs.com/compliance-solutions/integrity-line/#features"><strong>leveraging strong and proven encryption</strong></a><strong> rather than using a full-blown, complex, insecure, and expensive blockchain</strong>), I do not see how a distributed ledger would be beneficial.</li><li><em>Business logic is kept simple.</em> This can probably be applicable to certain Compliance applications, such as a simple, non-integrated whistleblowing application — but it gets progressively more complex as solutions integrate into other applications, such as the <a href="https://www.eqs.com/en-us/compliance-solutions/compliance-cockpit/">EQS Compliance Cockpit</a>. While certain parts of blockchain technology can be exploited to achieve business benefits, blockchain as an overall architecture — offering just an append-only, immutable ledger as a database — is not a valid paradigm when going beyond a simple use case, and no further integration with other applications is required. <strong>When a blockchain application needs to be integrated into ordinary enterprise systems, complexity raises exponentially</strong>.</li><li><em>Privacy of transactions is not a fundamental requirement of the application.</em> <strong>This is clearly a no-go for any kind of Compliance application.</strong> For instance, on a whistleblowing system, only authorized users should see that a case has been processed. <strong>Trying to hide a blockchain transaction is negating the very reason why you use a blockchain in the first place</strong> and adds permissions’ complexity — more complexity means more things that can go wrong.</li><li><em>Immutability of transactions has the overall precedence</em>. Immutability of transactions means that information cannot be amended, including when they are sensitive, or illegal, or we must comply with data privacy subjects requests such as the rights to erasure as per GDPR. What about <a href="https://www.schneier.com/blog/archives/2021/03/illegal-content-and-the-blockchain.html"><strong>the risk of anonymous reporters storing illegal material on your ledger</strong></a>? The only solution is to heavily verify, censor, and limit what can be stored on the ledger; <strong>if personal data cannot be stored, the functionality of a whistleblowing solution will be severely crippled</strong>. Conversely, we cannot be sure of what a reporter will write in a case, and <strong>we need to keep it integral to allow for forensic verification</strong>. Therefore, using a ledger suddenly does not look like a good idea.</li></ol><h3>Questions you should ask a supplier offering a Compliance solution based on blockchain.</h3><ul><li><em>Are you actually expecting your Compliance software to generate thousands of concurrent transactions per second? Why do you believe a traditional database will not be efficient enough?</em></li></ul><p>At EQS Group, through <a href="https://www.eqs.com/compliance-solutions/compliance-cockpit/">thousands of happy customers</a>, we have never seen such cases, not even for the bigger implementations. Should that eventually happen, we can guarantee we can easily scale up our databases in the Cloud using simple, 40-years-proven technologies like transactional databases — <strong>without requiring Ph.D.-level IT architects and engineers studying how to improve performance on a blockchain ledger</strong> (because yes, this is the level of complexity in a blockchain solution!).</p><ul><li><em>Why would I need to implement in-house a complex blockchain solution, when I can order an off-the-shelf, relatively inexpensive SaaS that does the job perfectly?</em></li></ul><p>We wish we were a fly on the wall when you ask that, so we could hear their reply to that!</p><ul><li><em>Do you think that “blockchain” means “more secure”?</em></li></ul><p>Let’s please discuss the <a href="https://www.hedgewithcrypto.com/cryptocurrency-exchange-hacks/">list of the dozens of cryptocurrencies or crypto exchanges that have been hacked already</a> and think again. Blockchain applications can have both technical and logical implementation shortcomings, and when they are exploited, the whole ledger and all the actors on it are compromised for good.</p><ul><li><em>How do you test your blockchain application against vulnerabilities?</em></li><li><em>How can I test vulnerabilities myself (run a “penetration test”) through an independent third party?</em></li></ul><p>Blockchains are hard to test and audit for security vulnerabilities, because of the very vertical knowledge required which is not available to most security testing firms; most likely, a permissioned blockchain is in use, which means it is as well less secure. Conversely, traditional solutions like the <a href="https://www.eqs.com/en-us/compliance-solutions/compliance-cockpit/">EQS Compliance Cockpit</a> and <a href="https://www.eqs.com/en-us/compliance-solutions/integrity-line/">EQS Integrity Line</a> rely on known, proven technology, and are continuously tested multiple times per year — internally, by our customers, and by independent auditors, and fulfill the most demanding security compliance and standards such as ISO/IEC 27001 and ISAE 3000 Type II.</p><h3>Questions you should ask yourself before adopting a Compliance solution based on blockchain.</h3><ul><li>Am I sure I understand how a blockchain solution works, how the reports are stored, who has access to them, and how permissions are controlled?</li><li>Do I feel confident in adopting a technology that has been highly hyped but has seen very few real-world applications outside of finance?</li><li>Can I trust it to be performant? What would I do, should it not work properly? Am I confident my supplier will be able to scale it and improve its performance as I require?</li><li>Am I confident my supplier will be able to adapt the solution and customize it to my requirements?</li><li>At contract renewal, should I decide to switch suppliers, will I be able to easily export the information from the blockchain ledger and import it into the new solution? In other words —am I not being locked in by this vendor, as it uses a very peculiar technology I cannot easily change?</li><li>In the case that I have a GDPR SAR (Subject Access Request), am I confident that an immutable ledger will be able to comply and delete the stored personal information as required by law?</li><li>What about an anonymous reporter storing adult material, or even child pornography? What if I cannot remove it?</li><li>…and if I can remove content from the ledger, what about the blockchain’s assurance of immutability? It’s either always working, or it is not.</li></ul><h3>Conclusions.</h3><p>When looking at the business case of using distributed ledger technology, one needs to consider the merits of the technology as well as the new problematics that it creates in the specific use case.</p><p><strong>Whereas the use of the blockchain paradigm can potentially reduce cost in use cases that require interactions with different interested parties, the peculiarities of blockchain can create entirely new sets of problems in either risk management and assessments, IT resources, and cybersecurity</strong> — so much as that even the alleged initial cost reduction could be easily vanished; <strong>this is especially true in our specific use case of Compliance applications, which does not seem to especially require an immutable ledger or P2P networks.</strong></p><p>As for myself, I have never managed to work for a company that used a blockchain. This is because no company I worked for… built a cryptocurrency! In fact, this is overall the only field where a blockchain architecture has indeed proven itself: <em>unregulated crypto — </em>besides that, <strong>not much else</strong>.</p><p>Questions? Doubts? Shouts? Hate mail? (no, seriously…). Just comment here on Medium and let me know what you think.</p><h4>Footnotes</h4><p>¹ <a href="https://www.banking.senate.gov/imo/media/doc/Roubini%20Testimony%2010-11-18.pdf">https://www.banking.senate.gov/imo/media/doc/Roubini%20Testimony%2010-11-18.pdf</a></p><p>² <a href="https://www.investopedia.com/terms/s/shitcoin.asp">https://www.investopedia.com/terms/s/shitcoin.asp</a></p><p>³ <a href="https://hackernoon.com/ten-years-in-nobody-has-come-up-with-a-use-case-for-blockchain-ee98c180100">https://hackernoon.com/ten-years-in-nobody-has-come-up-with-a-use-case-for-blockchain-ee98c180100</a></p><p>⁴ <a href="https://www.cnbc.com/2018/04/09/blockchain-is-not-only-crappy-technology-but-a-bad-vision-for-the-future.html">https://www.cnbc.com/2018/04/09/blockchain-is-not-only-crappy-technology-but-a-bad-vision-for-the-future.html</a></p><p>⁵ <a href="https://medium.com/@kaistinchcombe/decentralized-and-trustless-crypto-paradise-is-actually-a-medieval-hellhole-c1ca122efdec">https://medium.com/@kaistinchcombe/decentralized-and-trustless-crypto-paradise-is-actually-a-medieval-hellhole-c1ca122efdec</a></p><p>Does your heart beat for developing exciting SaaS products? We are constantly looking for motivated new team members. Take a look at our vacancies: <a href="https://eqs-group.personio.de/recruiting/positions">https://eqs-group.personio.de/recruiting/positions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ce1513104c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/eqs-tech-blog/why-using-a-blockchain-could-be-a-bad-idea-for-a-saas-compliance-product-5ce1513104c">Why using a blockchain could be a bad idea for a SaaS compliance product</a> was originally published in <a href="https://medium.com/eqs-tech-blog">EQS Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>