Skip to content

Instantly share code, notes, and snippets.


Jeremy D. Miller jeremydmiller

View GitHub Profile
View gist:2721630d6bd7679c1297f39ce93f188b
── Wolverine Handlers ──────────────────────────────────────────────────────────────────────────────────────────────────
Handler Discovery Rules
├── Assemblies
│ └── OrderSagaSample
├── Handler Type Rules
│ ├── Include:
│ │ ├── Name ends with 'Handler'
│ │ ├── Name ends with 'Consumer'
│ │ ├── Inherits from Wolverine.Saga
View Wolverine Describe Functionality
── Wolverine Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Service Name: DiagnosticsApp
├── Assemblies
│ ├── DiagnosticsApp (application)
│ └── DiagnosticsModule
├── Extensions
│ └── No applied extensions.
├── Serializers
│ └── ┌──────────────────┬──────────────────────┐
jeremydmiller /
Last active February 1, 2023 04:39
A Contrarian Take on Architecture

A Contrarian Take on Architecture

I’ve spent an inordinate amount of time the past half decade across multiple companies working with very large, long running enterprise systems. Especially in long running, constantly changing systems, you want the code to be easy to understand, relatively painless to extend or modify, and when advantageous, be simple to modernize with updated technology. Unfortunately, the systems I’ve worked on have consistently failed to satisfy these goals.

Ironically enough though, my judgment is that the code in these systems has been hard to understand, extend or change, and modernize because they had all adopted much of the very industry conventional wisdom about how to build large, maintainable systems.

In particular, I want to demonstrate and explain why I think that prescriptive, layered architectural styles like Clean or Onion Architecture can actually cause harm in larger systems. I also want us to train our sights on how teams attempt to hide the actual persistence technol

View Don't need no Law of Demeter
public Task<InvokeResult> InvokeAsync(MessageContext context, CancellationToken cancellation)
var handlerAssemblies = context
.Select(x => x.FullName)
.Join(", ");
View Generated Code for Message Handling
public class DebitAccountHandler1928499868 : Wolverine.Runtime.Handlers.MessageHandler
private readonly Wolverine.FluentValidation.IFailureAction<AppWithMiddleware.DebitAccount> _failureAction;
private readonly Wolverine.Marten.Publishing.OutboxedSessionFactory _outboxedSessionFactory;
private readonly FluentValidation.IValidator<AppWithMiddleware.DebitAccount> _validator;
public DebitAccountHandler1928499868(Wolverine.FluentValidation.IFailureAction<AppWithMiddleware.DebitAccount> failureAction, Wolverine.Marten.Publishing.OutboxedSessionFactory outboxedSessionFactory, FluentValidation.IValidator<AppWithMiddleware.DebitAccount> validator)
_failureAction = failureAction;
_outboxedSessionFactory = outboxedSessionFactory;
View gist:175f7676f2e21191342d3fabfa1388c0
public class ShowHandler_CreateItemCommand : Jasper.Bus.Model.MessageHandler
private readonly IDocumentStore _documentStore;
public ShowHandler_CreateItemCommand(IDocumentStore documentStore)
_documentStore = documentStore;
jeremydmiller / Events.cs
Created August 4, 2021 14:38
Marten generated code for event storage and projections
View Events.cs
using CommandLineRunner;
using Marten;
using Marten.AsyncDaemon.Testing;
using Marten.AsyncDaemon.Testing.TestingSupport;
using Marten.Events;
using Marten.Events.Aggregation;
using Marten.Internal.Storage;
using Marten.Storage;
using System;
using System.Linq;
jeremydmiller / DocumentStorage.cs
Created August 4, 2021 14:35
Generated code for Marten Document Storage
View DocumentStorage.cs
using Marten.AsyncDaemon.Testing;
using Marten.AsyncDaemon.Testing.TestingSupport;
using Marten.Internal;
using Marten.Internal.CompiledQueries;
using Marten.Internal.Storage;
using Marten.Linq;
using Marten.Linq.QueryHandlers;
using Marten.Schema;
using Marten.Schema.Arguments;
using Marten.Testing.Documents;
jeremydmiller / StorytellerAspNetCoreLogger
Created March 11, 2019 18:40
A strategy to plug ASP.Net Core logging into Storyteller test results
View StorytellerAspNetCoreLogger
using System;
using System.Collections.Generic;
using Baseline;
using Microsoft.Extensions.Logging;
using StoryTeller.Results;
using StoryTeller.Util;
namespace Jasper.TestSupport.Storyteller.Logging
/// <summary>
View gist:7eae90eda21cc47ed24fa30623f9feb2
ServiceType Namespace Lifecycle Description Name
IContainer Lamar Scoped Current IContainer IContainer
IEngine Lamar.Testing.IoC.Diagnostics Transient new Hemi() The Hemi