Skip to content
Sven Hübner IT
  • Home
  • Blog

type system

  • Home
  • Blog
  • type system

Fun with generics: mapping a generic instance from a non-generic reference

Posted by By sven.huebner.it March 5, 2023Posted inGeneral Development
DDD can lead to dealing with non-generic references to generic instances of types. Generically mapping these instances or generically calling code with them is not straightforward. I present how it can nonetheless be unobtrusively achieved with a general visitor-like pattern.
Read More

Fun with generics: building a generic call without reflection

Posted by By sven.huebner.it November 12, 2022Posted inGeneral Development
DDD can lead to generic types that are hard to import to. This technique can be used to make a generic call with multiple type arguments when each type argument is supplied individually, e. g. from an import into a domain model.
Read More

Closed Type Hierarchies with records … NOT!

Posted by By sven.huebner.it February 23, 2022Posted inGeneral Development1 Comment
TL;DR: You cannot create closed type hierarchies with record types because of the generated protected copy constructor.
Read More

Domain Primitives II: forcing developers to deal with error cases

Posted by By sven.huebner.it December 11, 2020Posted inGeneral Development
Using a static method with a Result return type for creating domain primitives forces developers to deal with error cases.
Read More

My Take On Domain Primitives

Posted by By sven.huebner.it November 4, 2020Posted inGeneral Development2 Comments
Domain Primitives are a stand-alone low-risk way to incrementally fortify your application, without the risk and complexity of introducing concepts like DDD, algebraic data types or immutability.
Read More
Copyright 2025 — Sven Hübner IT. All rights reserved. Sinatra WordPress Theme
Scroll to Top