Latest News

Jdon Framework : a CQRS/DDD/ES Framework

JdonFramework is a java reactive framework that you can use to build your Domain Driven Design + CQRS + EventSource applications with asynchronous concurrency and higher throughput.

Jdon introduces reactive and event-driven into domain, a aggregate root entity's state can be modified by Node.js style event-driven way,and it can concurrently publish reactive events to its subscribers.

JdonFramework's event engine is from Disruptor that be recommended by LMAX Architecture wriiten by Martin Fowler. (nonblocking and asynchronous)

Feature of Jdonframework: combining DCI with DDD aggregate and Domain Events.


Domain-driven design (DDD)

Domain-driven design (DDD) is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts. details.


Eric Evans on How Technology Influences DDD(2012) 

DDD's servral concepts are the Heart and Soul of OOP:

Entities and Identity, Value Objects
Aggregate Root
Bounded context



Reactive Programming is a hot topic , especially with such things as the Reactive Manifesto. Reactive architecture allows developers to build systems that are event-driven(EDA), scalable, resilient and responsive: delivering highly responsive user experiences with a real-time feel, backed by a scalable and resilient application stack, ready to be deployed on multicore and cloud computing architectures.

a reactive application is non-blocking that is under heavy load can thus have lower latency and higher throughput than a traditional application based on blocking synchronization and communication primitives.


Command-query Responsibility Segregation   At its heart is a simple notion that you can use a different model to update information than the model you use to read information. details.


Domain Events

Captures the memory of something interesting which affects the domain. details, see How to create fully encapsulated Domain Models


clean architecture



More articles..


With JdonFramework you can easily develope a Event Sourcing and CQRS system. in CQRS, by disruptor Jdon can send domain events to #rabbitmqand #zeromq - #distributed.

Object Oriented Programming: A Critical Approach say: OO is really about message passing:

“The message-sending metaphor provides modularity by decoupling the intent of a message (embodied in its name) from the method used by the recipient to carry out the intent. Structural information is similarly protected because all access to the internal state of an object is through this same message interface.”

by using jdon, a aggregate root can act as a mailbox that is a asynchronous and non-blocking event-sending and event-recipient metaphor..see below picture, more details in : Robot sample


Event is a better interactive way for aggregate root with each other, instead of directly exposing behavior and hold references to others. and it can better protect root entity's internal state not expose. and can safely modify root's state in non-blocking way.

aggregate root

Domain Events(Event Sourcing) for Evans DDD :

Real domain logic is in the Domain Model, Outside the domain are these adapters, that listen to messages sent by the domain. For instance, the domain could ‘broadcast’ a message(Domain Events) that a new domain object has been created. An appropriate listener receives this message and calls a method on a persistence service. This service knows how to store the object in the database.



Microservice = bounded context + independent deploy and run.



JdonFramework PPT

 Key Features:


  1. Domain-Driven Dsign Development, supports in-memory cache model.
  2. Actor model, like ErLang/scala MailBox, based on LMAX's Disruptor , never blocks ,nothing blocks, concurrent programming; Event-driven Architecture(EDA); asynchronous programming,concurrency pattern, lazy evaluation.
  3. DI and AOP framework, POJO autowiring that implements Dependency Injection, and all components can be replaced, even include the framework itself. introduce any pojo as a inteceptor.
  4. Command Query Responsibility Segregation(CQRS/CQS) , support the default implementations for CRUD and auto paginator for query of large datas .
  5. Lazy loading or evaluation, a aggregate root loads its childern objects until them need to use, improving performance by in-memory cache. memory-consumption-wise
  6. Be easily integration with Spring framework.


Getting Started

   In Jdon there are two kinds of model: Component and Model. a Component class is annotated with @Component, and a Model class is annotated with @Model.

  When a Model is referenced by Component, it is a aggregate root, if it is referencedby another model, it is not a aggregate root, maybe normal Entity or Value Object.

  Model instances live in in-memory cache, and Component instances live in the container that its lifcycle is equal to application scope.

  Component can be use to implement DDD's service or other application manager, such as repository or Email sender..

  Service (annotated with @Service) is same as Component, their difference is their usage, Service class services for the client, be equals to SOA service.

  Jdon provide four kinds of asynchronous concurrency communication(Producer/Consumer) with these two models.

  1. Component -----> model

  2. model ------->Component

  3. Compponent ------> Component

  4. model------> model

  when a Component/Service sends messages to a Domain Model(aggregate root), in CQRS we call the message is a command, and whe a domain model send message to a Component, we call it reactive a event. see below:

command event

  a command actions the behavior(startMatch) of a aggregate root(domain model), and a event happend in this behavior, the event will be sent to another aggregate root or a Component that maybe save it to repository.

actors model

details here



DDD CQRS EventSourcing example source: football Match

CES:Context Event and State

DDD DCI and DomainEvents example

how to enhance Jdon framework to DCI framework ?

Immutability is Easy

how to easily develop a non-blocking concurrent application ?



Jdon framework was submitted to in Dec 2004. and release a stable and mature version in JUN 2005. until Jdon Framework 6.2 released in 2009, JF is truly stableDDD framework for java.