Skip to content

Tag: design-patterns

Correct Use Of Factory Pattern?

I have been doing research on the factory design pattern and was wondering if the below example, while not “textbook” is technically a correct use of it. Is there another design pattern that may fit the situation better? Answer IMO: Looks like the given code example actually implemented the Factory Method pattern with using the Method Object solution Because

Is Spring Integration a good framework to implement the Transactional Outbox pattern? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 months ago. Improve this question I’m implementing Transactional Outbox pattern using Java. The Message Relay Service will poll the Outbox table for entries, and after an

What is the name of the design pattern where I dynamically pick the correct implementation based on data?

Originally I picked the correct User implementation, based on domain and realm data from the Java EE server. However that was company code, so I had to rewrite the example with numbers. I hope the underlying pattern is still understandable though. For those unfamiliar with CDI, @Inject Instance allows you to iterate through all implementations of an interface. Answer I

Avoiding circular depenency between Arena and Portal

I’m trying to resolve this ciruclar dependency while preferebly keeping both objects immutable. Basically, I need portal to be able to activate itself, and start the arena. Opposite, I need Arena to reset & close itself, and the portal. I found a solution by having two HashMap’s <Arena, Portal> and <Portal, Arena>, however I want to figure out if it’s