21 Matching Annotations
  1. Jun 2023
    1. Five core layers: 1. Presentation Layer 2. Application Layer 3. Domain Layer 4. Persistence Layer 5. Database Layer

    2. In the layered architecture pattern, each layer fulfills a specific responsibility and role within the application. Some focus on user interface logic, while others handle the execution of business rules. These layers complement each other's unique purposes, but they aren't explicitly reliant on one another to perform their own tasks.
    3. In software architecture, layers act as individual processes within the infrastructure of an application. These layers typically form a pattern, also called the n-tier architecture pattern.
  2. Jan 2022
    1. <script> import { fibonacci } from './math.js'; $: result = fibonacci(n, 0); </script> <input type=number bind:value={n}> <p>The {n}th Fibonacci number is {$result.data}</p> {#if $result.loading} <p>Show a spinner, add class or whatever you need.</p> <p>You are not limited to the syntax of an #await block. You are free to do whatever you want.</p> {/if}
    1. Oh, I just figured out a workaround for my project, in case it helps someone. If you want the source of truth on the prop to come from the child component, then leave it undefined in the parent. Then, you can make the reactive variable have a condition on the presence of that variable. eg: <script> let prop; $: prop && console.log(prop); </script> <Child bind:prop/> Might not work for every use case but maybe that helps someone.
  3. Mar 2021
  4. Feb 2021
    1. I think a better, more immediately understandable name for this concept would be command object, because it lets you pass around commands (or a list of commands) as objects.

      That's the only thing you really need to know abut this pattern. The rest seems like boring implementation details that aren't that important, and that naturally follow from the primary definition above.

  5. Oct 2020
    1. Since “virtual DOM” is more of a pattern than a specific technology, people sometimes say it to mean different things. In React world, the term “virtual DOM” is usually associated with React elements since they are the objects representing the user interface
  6. Apr 2020
    1. The result, all too often, is that we decide (often unconsciously) that the sweeping change just isn't worth it, and leave the undesirable pattern untouched for future versions of ourselves and others to grumble about, while the pattern grows more and more endemic to the code base.
  7. Mar 2020
    1. It is recommended that a library should have one subclass of StandardError or RuntimeError and have specific exception types inherit from it. This allows the user to rescue a generic exception type to catch all exceptions the library may raise even if future versions of the library add new exception subclasses.
    1. The pattern below has become exceptionally useful for me (pun intended). It's clean, can be easily modularized, and the errors are expressive. Within my class I define new errors that inherit from StandardError, and I raise them with messages (for example, the object associated with the error).
  8. Sep 2019