Posts

Using Bogus to create Hierarchical Data Structures

I was recently asked to create an API for retrieving multitenant data. The actual implementation requires a LOT more work than I have time to complete, so I thought I would create an API with some faked data. Now, at first, I was tempted to grab some data from one tenant and serialize it into a fake service that essentially hijacks the process, returning pseudo-random data. THEN I remembered working with a class library called Bogus . This is a cool library that "generates" random data of all sorts using a fluent interface. You configure the rules using lambdas and then call methods to generate the classes. This is very straight forward for simple POCOs and works great. However, I was trying to create an object graph, essentially, with hierarchical data. Objects at the second layer need to have a valid reference to objects at the first layer. Third to second, fourth to third. That way, you can query down the chain or get objects at the next-level-lower that have references to...

Time to learn Identity Server 4

Overview A couple weeks ago, I had signed off a little early from work as I started a little earlier than normal that day. I get a Teams message shortly after having started my stationary bike session from my manager. He asked if I was going to be around at 4:30. My first impression was, "Why on earth would we need to talk at 4:30 on a Wednesday?" (any work day for that matter). I'm a big believer in a strong work-life balance, so try to keep working hours to 8 per day. This is especially important for remote work: draw those boundaries and stick with them; get away from the keyboard. Life isn't all about work, etc., etc. So I cut my ride a bit short and meet with Ryan at 4:30. He asked if I want to be team lead for the Gatekeepers team. The Gatekeepers team is responsible for, at this time, the Authentication and Authorization Service that was introduced to our ecosystem about a year ago. The architect responsible for introducing it was also acting as team lead for ...

Adventures in Getting a Site Hosted

A couple years, I decided that was the year I was going to finally get a website setup. Fast forward to a couple days ago and that's how long it took me to begin executing on that plan. I tend to be afflicted with Paralysis By Analysis when it comes to something that I don't know how to start. Rather than just try, I think of all the ways it could fail. I know this about me and I also know that it's debilitating. Sometimes the debilitation wins. Sometimes I roll up my sleeves and get my hands dirty and break shit. The latter is almost always more rewarding than the former, yet the internal struggle remains.  But enough with the meta-crap, this post is meant to explain my approach to getting my domain name hosted with something. I've had this Blogger account for several years. It's free. It's easy. It's a little too easy to ignore, so I'm thinking I may resurrect it a little bit and start writing about my goings on as a mechanism for growth and learnin...

Behavioral Design Patterns: Chain of Responsibility

Intention The Chain of Responsibility pattern is defined as follows in the Gang of Four book: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. Structure Explain how it works using UML diagram. Example Explain the section of the GitHub repository.

Design Patterns: An Introduction

I'm refreshing my memory about software design patterns by watching some videos and taking some notes. I thought I would document them here for future posterity. These are the design patterns as defined by the Gang Of Four (GoF) in their seminal book "Design Patterns: Elements of Reusable Object-Oriented Software" and can be found on Amazon (non-affiliated link) . Some of the things I'll be posting will be related to the various categories of design patterns (as defined by the GoF): Creational, Structural and Behavioral. They are broken down like so: Creational Abstract Factory Builder Factory Method Prototype Singleton Structural Adapter Bridge Composite Decorator Facade Flyweight Proxy Behavioral Chain of Responsibility Command Interpreter Iterator Mediator Memento Observer State Strategy Template Method Visitor I will try to break each of these patterns into sections: Intent, Structure, Example. For those following along, I'll have the code for these examples ...

Everything is Politics

Politics tends to be a dirty word in the common vernacular. However, I think politics is just part of everyday living. Maybe not in the mind of every human, but at least in the mind of every worker. My first job - not even out of high school - was detasseling for the regional farmers through the local coop. Now, I grew up in Iowa, so there's a fair amount of things I need to explain, but let's just cut to the chase and say that all you've ever heard about Iowa is probably true. Corn. It's everywhere. Pioneer was a major business in them parts, and they had enough capital to make it worth your while to work in the heat of the Iowan summer walking miles through paper-cutting corn leaves to make a buck. They paid $5/hour at a time that minimum wage was around $3.15 or $3.25 (memory lapse), so it was a Siren Song of sorts for those of us aspiring to the American Way. A couple summers of that work, though, and one might reflect on their current situation and aspire to some...

Give it a REST

I was asked recently what makes REST scalable. I wasn’t quite sure how to answer because all I knew about it (other than CRUD-type HTTP verbs) was that it was stateless. Before the question was asked, I had mentally mapped that CRUD concept to REST. Because I wasn’t totally sure, I figured I should dig in and learn more about REST. While there can be methods on the exposed API that take HTTP verbs like PUT, GET, DELETE, etc., there’s more to the story than that. Plus, what gives, brain? REST == CRUD?? WTF? So what is REST? REST stands for REpresentational State Transfer. It’s an architectural style for a standard communication scheme between computer systems. Most of the time, the protocol standard is HTTP, a stateless communication standard used ubiquitously across the Internet. Due to the stateless nature of the communication, as long as the message between the two systems doesn't change, the code on either side of the communication can be changed without is...