<feed xmlns="http://www.w3.org/2005/Atom"> <id>https://trysil.lastrucci.net/</id><title>Trysil</title><subtitle>Tutorials, deep dives, and release notes for Trysil — an ORM framework for Delphi.</subtitle> <updated>2026-09-08T17:54:25+02:00</updated> <author> <name>David Lastrucci</name> <uri>https://trysil.lastrucci.net/</uri> </author><link rel="self" type="application/atom+xml" href="https://trysil.lastrucci.net/feed.xml"/><link rel="alternate" type="text/html" hreflang="en" href="https://trysil.lastrucci.net/"/> <generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator> <rights> © 2026 David Lastrucci </rights> <icon>/assets/img/favicons/favicon.ico</icon> <logo>/assets/img/favicons/favicon-96x96.png</logo> <entry><title>The Identity Map: what it gives you, what it hides</title><link href="https://trysil.lastrucci.net/posts/the-identity-map-what-it-gives-you-what-it-hides/" rel="alternate" type="text/html" title="The Identity Map: what it gives you, what it hides" /><published>2026-08-30T07:38:00+02:00</published> <updated>2026-08-30T07:38:00+02:00</updated> <id>https://trysil.lastrucci.net/posts/the-identity-map-what-it-gives-you-what-it-hides/</id> <content type="text/html" src="https://trysil.lastrucci.net/posts/the-identity-map-what-it-gives-you-what-it-hides/" /> <author> <name>David Lastrucci</name> </author> <category term="Design Notes" /> <summary>Here’s a pattern that shows up in almost every ORM-backed codebase, written by people who don’t realize it: LOrder := LContext.Get&amp;lt;TOrder&amp;gt;(42); // ... do something ... LOtherOrder := LContext.Get&amp;lt;TOrder&amp;gt;(42); Is LOrder = LOtherOrder? With most ORMs, no — you get two distinct objects holding the same data. With Trysil and the identity map on, yes — you get the same object, because...</summary> </entry> <entry><title>Lazy loading: TTLazy<T> and TTLazyList<T></title><link href="https://trysil.lastrucci.net/posts/lazy-loading-ttlazy-and-ttlazylist/" rel="alternate" type="text/html" title="Lazy loading: TTLazy&amp;lt;T&amp;gt; and TTLazyList&amp;lt;T&amp;gt;" /><published>2026-08-16T08:04:00+02:00</published> <updated>2026-08-16T08:04:00+02:00</updated> <id>https://trysil.lastrucci.net/posts/lazy-loading-ttlazy-and-ttlazylist/</id> <content type="text/html" src="https://trysil.lastrucci.net/posts/lazy-loading-ttlazy-and-ttlazylist/" /> <author> <name>David Lastrucci</name> </author> <category term="Tutorials" /> <summary>A TOrder has a CustomerID. Sometimes, when the code holds an order, it also needs the Customer. Sometimes it doesn’t. A naïve ORM fetches the customer eagerly on every Get&amp;lt;TOrder&amp;gt;. That’s simple but wasteful — you pay for a second query (or a bigger join) even when nobody asked. An aggressive ORM proxies the property: the customer object exists lazily, and the first access triggers the f...</summary> </entry> <entry><title>Optimistic locking with TTVersion</title><link href="https://trysil.lastrucci.net/posts/optimistic-locking-with-ttversion/" rel="alternate" type="text/html" title="Optimistic locking with TTVersion" /><published>2026-08-02T08:19:00+02:00</published> <updated>2026-08-02T08:19:00+02:00</updated> <id>https://trysil.lastrucci.net/posts/optimistic-locking-with-ttversion/</id> <content type="text/html" src="https://trysil.lastrucci.net/posts/optimistic-locking-with-ttversion/" /> <author> <name>David Lastrucci</name> </author> <category term="Design Notes" /> <summary>Two users open the same invoice. Alice edits the amount and clicks Save. Bob, a minute later, edits the customer and clicks Save. Alice’s amount is gone. Bob overwrote it with the value he loaded a minute ago. This is not a bug in Bob’s code. It’s the default behavior of every ORM ever written, unless you tell it not to do that. The fix — optimistic locking — is older than most frameworks usin...</summary> </entry> <entry><title>Events in Trysil: the full lifecycle</title><link href="https://trysil.lastrucci.net/posts/events-in-trysil-the-full-lifecycle/" rel="alternate" type="text/html" title="Events in Trysil: the full lifecycle" /><published>2026-07-19T07:52:00+02:00</published> <updated>2026-07-19T07:52:00+02:00</updated> <id>https://trysil.lastrucci.net/posts/events-in-trysil-the-full-lifecycle/</id> <content type="text/html" src="https://trysil.lastrucci.net/posts/events-in-trysil-the-full-lifecycle/" /> <author> <name>David Lastrucci</name> </author> <category term="Deep Dives" /> <summary>The previous post ended with a promise: after hooks exist, we’ll come back to them. This is that post. Trysil has two complementary mechanisms for reacting to persistence operations. One is the method-hook approach from the validation post — [TBeforeInsert], [TBeforeUpdate] and friends, lightweight in-class procedures. The other is the event class mechanism, which you reach for when the reacti...</summary> </entry> <entry><title>Validation attributes and BeforeInsert/BeforeUpdate hooks</title><link href="https://trysil.lastrucci.net/posts/validation-attributes-and-beforeinsert-beforeupdate-hooks/" rel="alternate" type="text/html" title="Validation attributes and BeforeInsert/BeforeUpdate hooks" /><published>2026-07-05T08:41:00+02:00</published> <updated>2026-07-05T08:41:00+02:00</updated> <id>https://trysil.lastrucci.net/posts/validation-attributes-and-beforeinsert-beforeupdate-hooks/</id> <content type="text/html" src="https://trysil.lastrucci.net/posts/validation-attributes-and-beforeinsert-beforeupdate-hooks/" /> <author> <name>David Lastrucci</name> </author> <category term="Tutorials" /> <summary>Most ORMs treat validation as someone else’s problem. You write your entities; you write your service layer; somewhere in that service layer there’s a Validate(entity) method that nobody maintains because nobody knows where to put the rules. Trysil makes a different bet: validation belongs on the entity, right next to the column definition. Two kinds of rules cover almost everything — declarat...</summary> </entry> </feed>
