How to avoid having very large objects with Domain Driven Design

The issues you are seeing aren’t caused by Domain Driven Design, but rather by a lack of separation of concerns. Domain Driven Design isn’t just about placing data and behavior together. The first thing I would recommend is taking a day or so and reading Domain Driven Design Quickly available as a free download from … Read more

What are the differences between Decorator, Wrapper and Adapter patterns?

In theory they are the same, it’s the intent that differentiates one pattern from the other: Decorator: Allows objects to be composed/add capabilities by wrapping them with a class with the same interface Adapter: Allows you to wrap an object without a known interface implementation so it adheres to an interface. The point is to … Read more

Visitor Pattern in Scala

Yes, you should probably start off with pattern matching instead of the visitor pattern. See this interview with Martin Odersky (my emphasis): So the right tool for the job really depends on which direction you want to extend. If you want to extend with new data, you pick the classical object-oriented approach with virtual methods. … Read more

How to pass context in golang request to middleware

If you look at the first example at that Go Concurrency Patterns blog post, you’ll notice that they’re “deriving” their contexts from the Background context. That, combined with the Context and WithContext methods on your Request object, gives you what you need. I just figured this out (and it wasn’t my first run at reading … Read more

What are worker threads, and what is their role in the reactor pattern?

The Reactor pattern is used with worker threads to overcome a common scenario in applications: You need to do a lot of work eventually but you don’t know which work and when and creating threads is an expensive operation. The idea is that you create a lot of threads which don’t do anything at first. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)