Broadleaf Microservices
  • v1.0.0-latest-prod

Microservices Extensibility Concepts

To illustrate the most common extension use-cases, we’ve created a project called Microservices Concepts available here: https://github.com/BroadleafCommerce/MicroservicesConcepts

This project focuses on creating runnable examples demonstrating how these typical customizations can be accomplished. Each example is structured as a runnable "concept".

Note
view the README in the Microservices Concepts project for details around getting this project running locally

Concept Directory

Concept Description

Simple Product Extension

Simple extension of JpaProduct adding only a basic field type. Also leverages auto projection, rather than opting for an explicit extended projection.

Product Extension with JSON Field

Simple extension of JpaProduct adding more complex field types, including collections and maps. The complex types use JPA converters to persist the complex structure as JSON. This example still leverages auto projection and does not declare an explicit extending projection type.

Explicit Product Projection

Continues with the complex field example persisted as JSON. However, in this case, an explicit projection type is declared.

Product Extension with New Table Relationship

Alters the complex field example to leverage a traditional JPA OneToMany associated collection. The relates to a new table in the database, rather than serializing to JSON.

Product with Nested JSON Collection

Extends nested structures that appear arbitrarily deep in the object graph of JpaProduct. The structures appear in various embedded collections and are persisted as JSON.

Product with New Nested Table Relationship

Extends nested structures that appear arbitrarily deep in the object graph of JpaProduct. The structures appear in OneToMany table based collections.

Overriding a Repository

Adds a new repository implementation fragment overriding out-of-the-box behavior of JpaTrackableRepository

New Repository

Introduces new repository methods that contribute new persistence related behavior. This take the form of either dynamic query method fragments, or concrete implementation fragments.

Customizing Business Logic

Uses a simple customization of the DefaultProductService.

Customized Business Logic with Auto Projection

Business logic customization that leverages a customized repository and extended domain with auto projection

Customized Business Logic with Explicit Projection

Business logic customization that leverages a customized repository and extended domain with explicit projection

Endpoint Customization

Simple customization of out-of-the-box ProductEndpoint

Endpoint Customization using AutoProjection

Customization of an endpoint method in ProductEndpoint leveraging a customized service, repository, auto-projection, and domain

Endpoint Customization using Explicit Projection

Customization of an endpoint method in ProductEndpoint using an extended explicit projection and domain

Brand New Entity

Introduction of new domain without explicit projection or any other explicit plumbing like repository, service, or endpoint

Brand New Entity with Complex Fields

Introduction of new domain including complex field structures

Tuning Auto Projection with New Entity

Introduction of new domain with auto projection output fine tuned through customization

New Entity with Explicit Projection

Introduction of new domain including explicit projection declaration