22 Matching Annotations
- Sep 2024
-
stackoverflow.com stackoverflow.com
-
Rails' observers were partly inspired by aspect-oriented programming -- they're about cross-cutting concerns. If you're putting business logic in observers that is tightly coupled to the models they're observing, you're doing it wrong IMO.
-
- Jun 2023
-
www.indeed.com www.indeed.com
-
Five core layers: 1. Presentation Layer 2. Application Layer 3. Domain Layer 4. Persistence Layer 5. Database Layer
-
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.
-
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.
-
- Jan 2022
-
-
<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}
-
-
-
Having a consistent and predictable pattern is key to the elegance.
-
-
github.com github.com
-
I value this pattern because it allows concise concurrency.
-
-
github.com github.com
-
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.
-
- Mar 2021
-
medium.com medium.com
- Feb 2021
-
en.wikipedia.org en.wikipedia.org
-
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.
-
- Oct 2020
-
medium.com medium.com
-
However, after solving this problem a few times, a pattern appeared.
-
-
github.com github.com
-
This is a very unusual pattern and most people don't know you can.
-
The problem is that not all tooling supports adding new dependencies from a transform. The first step is figuring out how this can be done idiomatically in the current ecosystem.
-
-
legacy.reactjs.org legacy.reactjs.org
-
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
-
-
github.com github.com
-
create patterns & metaphor
-
-
-
it also allows for more divergence in how people write there code and where they put their logic, making different svelte codebases potentially even more different due to fewer constraints. This last point is actually something I really value, I read a lot of Svelte code by a lot of different people and broadly speaking things look the same and are in the same places.
Tags
- programming: multiple ways to do the same thing
- strong conventions resulting in code from different code bases/developers looking very similar
- software development: code organization: where does this code belong?
- consistency
- idiomatic pattern (in library/framework)
- convention
- uniformity
- idiomatic code style (programming languages)
Annotators
URL
-
-
github.com github.com
-
This library exports a single React Hook, useMethods, which has all the power of useReducer but none of the ceremony that comes with actions and dispatchers.
-
- Apr 2020
-
github.com github.com
-
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.
-
-
xunitpatterns.com xunitpatterns.com
- Mar 2020
-
ruby-doc.org ruby-doc.org
-
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.
-
-
stackoverflow.com stackoverflow.com
-
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).
-
- Sep 2019
-
legacy.reactjs.org legacy.reactjs.org
-
They are a pattern that emerges from React’s compositional nature.
-