Java Zone - The heart of the Java developer community

Java Zone - The heart of the Java developer community


A Closer Look at the Java Generic Factory Pattern

Posted: 31 Oct 2019 06:26 AM PDT

Read on to learn more about the Java generic factory pattern!

During my last project, I was required to build complex objects based on values derived from an XML File. We decided to use the Builder Pattern to help build complex objects.

For complex objects, which are aggregates of Domain-Driven Design, the building process, in the end, is a long method that builds all parts of the complex object. I was looking for a pattern that would allow me to create different components using only one method.

GraphQL Server in Java, Part II: Understanding Resolvers

Posted: 31 Oct 2019 06:26 AM PDT

Learn more about resolvers in GraphQL and Java.

In part one, we developed a simple GraphQL server. That solution had one serious flaw: All fields were loaded eagerly on the back-end, even if they weren't requested by the front-end. We sort of accept this situation with RESTful services by not giving clients any choice.

RESTful API always returns everything, which implies always loading everything. If, on the other hand, you split RESTful API into multiple smaller resources, you risk N+1 problem and multiple network round trips. GraphQL was specifically designed to address these issues:

Spring Transaction Management: An Unconventional Guide

Posted: 31 Oct 2019 06:26 AM PDT

You can use this guide to as an in-depth, practical understanding of how Spring's transaction management (including the @Transactional annotation) works.

The only prerequisite? You need to have a general idea of ACID, i.e. what database transactions are and when to use them. Also, XATransactions, or ReactiveTransactions, are not covered here, though the general principles, in terms of Spring, still apply.

Comments

Popular posts from this blog

Your 12 hourly digest for Digg Top Stories

Your 12 hourly digest for Slashdot

Your 12 hourly digest for DZone.com Feed