SlideShare a Scribd company logo
Jdon Framework
(english)
github.com/banq/jdonframework
@jdonframework
Evans DDD
DDD Benefits
Clean Architecture
What is Jdon?
 Jdon help you build a Clean and Fluent
architecture system.
 Jdon is a domain framework that let your business
to be independent with Database or UI.
 Jdon is a domain container to run your business in
non-blocking way.
Java Architecture
MVC
RESTful
struts1.x
Struts2
JSF
Tapestry
Wicket
Database
Hibernate
SQL
IBatis
NoSQL
micoservices
JdonFramework
Domain model
Jdon Framework (JF)
 a light-weight framework for developing Domain-
Driven Design applications.
 Jdon introduces reactive event-driven into domain.
 Help you develop a asynchronous concurrency
and higher throughput application
Jdon vs Spring
 Jdon is very difference with Spring
framework.
 Jdon is a default event-driven and
asynchronous framework.
 Jdon/Event- asynchronous vs.
Spring/Request-Response
Jdon’s Revolution
 Single Writer component model :DDD’s
AggregateRoot guards mutable state. And
Jdon guarantees single operation on in-
memory state by using Disruptor.
 Increases domain mode the level of
abstraction. Communication betwwen
Business Domain and others(UI/DB) is
Event/Message.
Jdon’s Revolution
 Two persistence choices between State and
Event: SOA CQRS or EventSourcing.
 Make your applications high throughput and
lower latency.
 Scalable.
In-memory Programming Paradigm
 Jdon changes traditional programming
paradigm (Spring + Hibernate/JPA etc.)
 Make ORM be dead ,domain model is not
bind to any ORM framework.
 Make Data collection or Anemia model be
dead.
Lock vs Singel writer
 There are plenty of idioms to synchronize
multi-threaded access to a resource
 lock is sloooow, especially with a high
number of writer threads.
 In-memory Singel writer is Actors model
(Akka/Erlang etc.)
Blocking
 public class AggregateRoot{
 private ChannelState state;

 //tradional lock
 public void synchronized changeChannel(changeCommand cmd){
 state = cmd.getState();
 }
 }
Jdon NonBlocking
 public class AggregateRoot{
 private ChannelState state;

//single write
 @OnCommand("UserSaveCommand")
 public void changeChannel(changeCommand cmd){
 state = cmd.getState();
 }
 }
Jdon basic component Annotations
@Model : Aggregate Root Entity Model
@Service : Micro service or DDD service
@Component: Normal components.
AOP component Annotations
@Interceptor: AOP’s Interceptor
@Introduce: Advisor
1. Create a domain model
 A domain model is the aggregate root enity in DDD.
 DDD can help us find some domain models in business
requirement
 Example:
 public class MyModel {
 private String Id;
 private String name;
 ....
 }
Using @Model
 make sure the domain object in-memory cache:
 @Model
public class MyModel {
private String userId;
private String name;
....
}
 @Model is a jdon’s annotation for domain model.
Loading Model from Repository
@Introduce(“modelCache”) must be annotated in repository class
@Around must be annotated on the loading method.
GitHub Source code
2. Create a domain event
 Domain event is emitted from a domain
model, generally is a aggregate root entity,
 Jdon can help you develope domain event
easily.
 Jdon provides asynchronous
communication component model.
 Producer-Consumer or Publisher-
Subscriber pattern.
Four kinds of Producer-Consumer
 1. @Component -----> @model
 2. @model ------->@Component
 3. @Compponent ------> @Component
 4. @model------> @model
Producer-Consumer
Procuder:
@Introduce("message") is for Producer class;
@send is for Producer class’s method
Consumer:
@Consumer is for Consumer class
@OnEvent is for Consumer class’s method.
Command and Domain Events
Command and Domain Events
Single Writer Principle
Domain Model
Aggregate root
@Model
Disruptor
Queue
Command Single thread
Producer
@Component
@Service
Communications principle
 Powered by disruptor from LMAX
 Can handle 6 million orders per second on a
single thread
 recommended by Martin Fowler.
What is Domain Events
 Events that happened in the domain.
 captures the essence of business domains while staying
decoupled from platform complexity or hard performance
issues.
 No Block concurrent, No Lock ,so fast. fit for multi-core.
 Storage Ignorance ,Flexibility, Messaging Capabilities,
Scalable.
One Command =>Many Events
Domain Model
@Model
Other Components
@Componet
Logging
@Consumer
GUI
MVC
Client
Persistence
@Consumer
async
Message
async
Message
async
Message
Component architecture
Command
One Command=>one Domain Event
Domain Model
Aggregate root
@Model
Command
Producer
@Component
Consumer
@Consumer
@Component
Domain Events
Domain Model
Aggregate root
@Model
Command
Domain Events is basic for CQRS
User interface
Service
Domain
Event/Message BUSInfrastructure
Query/
Reporting
Commands
Commands
Events
How Domain Events work?
Domain Model
Aggregate root
@Model
Consumer
@Consumer
@Component
Disruptor
Or
Java
concurrent
Future
Domain Events
Event principle
Queue
Mychannel
Powered by Ringbuffer
@Send("mychannel") will push the DomainMessage into the
Queue, And the consumer will fetch it from the Queue.
@Model =>@Component Example
Producer
 @Model or @Service/@Component can be
a Producer.
 When a Component/Service sends
messages to a Domain Model(aggregate
root), that is a command,
 When a domain model sends message to a
Component, that is a event
Consumer
 @Model cann’t be a Consumer
 Only @Component can be a Consumer.
 Two kinds of consumers:
 @Consumer is for a class.
 @OnEvent is for method of any @Component
 If there are several consumers, action’s order is by
the alphabetical of class name:AEventHandler =>
BEventHandler => CEvent…
Consumer return a result
 If you want to return a result in consumer,
you can set the result object into the
DomainMessage of the event in
DomainEventHandler :
 void onEvent(EventDisruptor event, boolean endOfBatch) throws Exception
{
 //return the result “eventMessage=hello”
 event.getDomainMessage().setEventResult("eventMessage=" +
myModel.getId());
 }
How to get the result?
 If a consumer return a result, that is a
asynchronous.
 event.getDomainMessage(). getEventResult()
 First times, maybe you can’t fetch it.
 Second times You can get it.
 You can call block method to fetch it a blocking
way, this is :
 event.getDomainMessage(). getBlockEventResult()
The benefits of @Consumer
 Atomic;
separates a transaction into single event
process, that is event stream.
 Asynchronous
saving datas to DB or Lucene is high
load, we can implement them with two
EventHandlers by different latency.
Domain Events(DE) apply in JEE
Root Entity
VO
Entity
Service
Root Entity
boundary
boundary
Tech.
Architecture
Domain Events
Domain Events
Domain Events Pattern
 Loose Coupling
business logic is separate from technology architecture. decouple
"What" From "How"
 Event-driven Architecture
asynchronous event-driven architectures
 Asynchronous Lazy-load
like lazy evaluation of functional language .
 True Scalability
Scale out on multi-core or multiple nodes using asynchronous message
passing ( JMS).
Example 1: Concurrency pattern
 No domain events codes : CPU killer:
public int getMessageCount(){
int messageCount = xxxx; // complex computing, high CPU usage, CPU killer
return messageCount;
}
 Domain events can pre-load or pre-run the complex computing:
public int getMessageCount(DomainEvents domainEvents) {
if (messageCount == -1) {
if (messageCountAsyncResult == null) {
messageCountAsyncResult =
domainEvents.computeCount(account.getUserIdLong());
} else {
messageCount = (Integer)
messageCountAsyncResult.getEventResult();
}
}
return messageCount;
}
Example 2
Asynchronous Lazy load
1. invoking ‘getMessageCount’ will
send a message to
‘computeCount’ of Repository
by domainEvents.
2. again invoking
‘getMessageCount’ will return
last step result.(such as by
AJAX )
 Download Sample Source
Lazy initialization/Lazy evaluation
 On demand load or init a object from DB.
 functions are not evaluated until their results
are needed
 no Hibernate LazyInitializationExceptions
 no Open Session in View anti-pattern
Scale to distributed system
Domain
Model
JMS
MQ
ZeroQ
RabbitMQ
Persistence
Send Email
Other Services
Message
Domain
Model
Message
Distributed Cache
Distributed Cache
Events Challenge
 Most programmers are good at a synchronous
mode that be executed sequentially in a thread.
 Events is a non-blocking concurrent programming
mode, that maybe is harder to most people.
 if domain business need be executed
sequentially , so we can do it by domain events
too.
Blocking problem
 In a blocking system, wait thread is idle but
continue to consume system resources.
 This will very costs resource, for high transaction
volume:
the number of idle threads =(arrival_rate * processing_time)
the result can be a very big number if the
arrival_rate is high.
 Blocking system is running under a very ineffective
mode. No high throughout, no high CPU load.
Non-Blocking concurrent
 Make a call which returns a result. don't need to
use the result until at a much later stage of your
process.
 don't need to wait immediately after making the
call, instead you can proceed to do other things
until you reach the point where you need to use
the result.
 the call itself will return a "future" handle
immediately. The caller can go off doing other
things and later poll the "future" handle to see if
the response if ready.
JdonFramework
Non-Blocking concurrent
 Domain Model sends events to another
thread(a consumer) by RingBuffer in
Disruptor, so threads can communicates
through events.
 After consumer done, it will put the result in
another RingBuffer that publisher can read
or blocking read it, decided by business is
or not executed sequentially.
Higher abstract of concurrent
 Non-Blocking’s concurrent programming is complex.
 How to develop a concurrent app. easily?
 Like Actor Model
is like domain events, messages are sent asynchronously and non-
blocking in a “fire-and-forget” manner. But LMAX team of the Disruptor
thinks Actor model has bottleneck.
 DCI Architecture
DCI is easy to be understood. It’s abstract level is high than
domain events.
DCI
 DCI: Data, Context, Interactions is a
programming paradigm invented by Trygve
Reenskaug.
 keep our core model classes very thin.
 logic/behaviour should be kept in roles.
 Domain Events is a Interactions, Events
Producer is the Role.
Model Injection
 JdonFramework can inject Domain Events
into domain model at runtime, this is maybe
like Mixin.
 Domain Events is Interactions of Roles, so
Roles are then assigned(Injected) to data
objects at runtime, only when required
within given Context.
DCI : Data
 Domain Model is the DATA of DCI, no logic
no behaviour.
Source: com.jdon.sample.test.domain.simplecase.MyModel
DCI : Role and Interactions
This is a Role of DCI , it includes the
interactions of DCI. It is event producer
Source:com.jdon.sample.test.domain.simplecase.MyModelDomainEvent
DCI : Context
 In Context,The Role will be injected
into the data.
 //after fetching the myModel object, it has been injected
events
 MyModel myModel = repository.getModel(new Long(100));
// call myModel’s events
 myModel .myModelDomainEvent.asyncFindName(this);
com.jdon.domain.dci.RoleAssigner
 com.jdon.domain.dci.RoleAssigner is a Role
assigner that can inject(Mixin) any interface
into a data model.
 When using RoleAssigner, it is not
necessary that fetch a object of data model
by a repository annotated with
@Introduce("modelCache") and its get
method with @Around
Different DCI styles
 If we already hold on a model object, we
can implements various functions by its
domain events,such as modify/update a
model.
 Otherwise:
 We create a context, and there we inject
events or functions into a new model object
by RoleAssigner,such as create or delete a
model.
client@Model
@Model client
Context
RoleAssigner
@Component@Component
Mixin
Create
ModifyEvent
@Component
@Component
inject
concurrent programming is easy
 Jdonframework makes an exploratory to
promote non-blocking concurrent
programming paradigm .
 DCI and Domain Events are different abstract
levels based concurrent programming .
 DCI and UML colors analysis method
can successfully docking, it is the highest level of
abstraction of business-oriented.
 Help most programmers quietly going to the way
of non-blocking concurrent programming when
they thinking in DDD.
DI and AOP
 Dependency Injection(DI or IOC)
@Service or @Component can inject with each other by class
construction(not supports setter injection).
@Service or @Component can be inected into @Model or by domain
events.
 Aspect-oriented programming(AOP)
with annotation @Introduce:
@Service or @Component can introduce each others as its
interceptor. @Model can introduce any POJO or @Component as its
interceptor.
@Model mechanism
Client
xx.getA(“a”)
A
@Model
Interceptor for A
with @Introduce
B that need
implements interface
and has @Introduce
Inject proxy of B
Interceptor for B
with @Introduce
Cache In-memeory
C
Inject proxy of c
Component
In Context
Container
interceptor
Inject a interceptor in @Model
Living space
 @Model lives in cache that default is Guava
Cache.
 @Component/@Service lives in a context
such as servletcontext.
 All @Component can be injected into
@Model.
@Component mechanism
Client
xx.getA(“a”)
A
@Service
Interceptor
(poincut=service)
B that need
implements interface
@Component
Inject proxy of B
Interceptor for B
with @Introduce
Context container (ServletContext)
@Service/@Component
 @Service("testService")
 public class TestServicePOJOImp implements TestService{
 private final UserRepository userRepository;
 public TestServicePOJOImp(UserRepository userRepository) {
 this.userRepository = userRepository;
 }
 }
 @Component()
 public class UserRepository {
 ….
 }
 Difference between @Service and @Component is that the @Service class
must have a interface then can be called by outside client beyond jdon.
@Service
 @Service expose to the client, has several kind instances: singleton ,
prototype or pool that have them annotations, default is
prototype(spring default is singleton ) 。
AOP: @Introduce mechanism
In-Memory Model
 When a domain model object with @Model is fetch
from repository, we need use
@Introduce(“modelCache”) to mak the object live
in memory.
 There are two cache interceptors existed before
and after domain layer.
 Domain events need annotation
@Introduce(“modelCache”) in the place that
domain model objects are created or
reconstructed from persistence or other systems.
JdonFramework Cache
Presentation
Domain Persistence
CacheInterceptor
In aspect.xml
DomainCacheInteceptor
@Introduce(“modelCache”)
in memeory model
@Introduce(“modelCache”) must be annotated in
the reposotory that @Model objects are created or
reconstructed This step is very important for domain events
working
What happeded in memeory?
 First times invoke “getModel” method of
RepositoryImp, jdon will do two things:
One: put the return value(model) in cache.
So next times can get it from cache.
Two: inject domain events into this model.
 Next times, invoke the method again, we will
get the model only one instance from cache.
Start jdonFramework in WEB
 If all is annotation, no jdonframework.xml,
no need this step
 Configuration in Web.xml:
 <context-param>
 <param-name> modelmapping-config </param-name>
 <param-value> jdonframework.xml </param-value>
 </context-param>
 <listener>
 <listener-
class>com.jdon.container.startup.ServletContainerListener</listener-class>
 </listener>
How to use in application
 AppUtil appUtil = new AppUtil();
 // xxx is value of @Service(“xxx”) annotation on class.
 XXXService xxxService = appUtil.getService(“xxx”);
 xxxService.method();
 If there is jdonframework.xml:
 AppUtil appUtil = new AppUtil("com.jdon.jdonframework.xml");
Other features
in JdonAccessory
 Rapid development, template toolkit. JDBC
template
 Eliminate “Controller/Action” ,No controller
code of MVC (only supports Struts 1.x)
 Batch Query, auto pagination 。
MVC Controller configuration
in jdonframework.xml(struts1.x)
Jdonframework MVC(struts1.x)
View
View
Controller
Jdonframework.xml
ActionForm Model
Service
Batch Query in jdon-jdbcTemp.jar
 Cache supports.
 Auto pagination.
 In presentation layer:
extends com.jdon.strutsutil.ModelListAction
 in persistence layer:
call getDatas of
com.jdon.controller.model.PageIterator
REST in JdonMVC
Jdon on Github
 https://github.com/banq/jdonframework
 http://en.jdon.com Document
 https://twitter.com/jdonframework
Twitter: @jdonframework

More Related Content

What's hot

Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
Eberhard Wolff
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
Amazon Web Services
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
Araf Karsh Hamid
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Brian Brazil
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
Anil Allewar
 
Java 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJava 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelization
José Paumard
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
Jason Vance
 
React Interview Questions and Answers | React Tutorial | React Redux Online T...
React Interview Questions and Answers | React Tutorial | React Redux Online T...React Interview Questions and Answers | React Tutorial | React Redux Online T...
React Interview Questions and Answers | React Tutorial | React Redux Online T...
Edureka!
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
Fabrício Rissetto
 
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones WebMicro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
Belatrix Software
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
Araf Karsh Hamid
 
Microservices
MicroservicesMicroservices
Microservices
Stephan Lindauer
 
Vue Vuex 101
Vue Vuex 101Vue Vuex 101
Vue Vuex 101
LocNguyen362
 
DDD (Domain-Driven Design)
DDD (Domain-Driven Design)DDD (Domain-Driven Design)
DDD (Domain-Driven Design)
Senior Dev
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
Sam Nasr, MCSA, MVP
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Yevgeniy Brikman
 
Microservices with NGINX pdf
Microservices with NGINX pdfMicroservices with NGINX pdf
Microservices with NGINX pdf
Katherine Bagood
 
Domain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledDomain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) Distilled
Nicola Costantino
 

What's hot (20)

Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Event Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQEvent Sourcing & CQRS, Kafka, Rabbit MQ
Event Sourcing & CQRS, Kafka, Rabbit MQ
 
React workshop
React workshopReact workshop
React workshop
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Java 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJava 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelization
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
 
React Interview Questions and Answers | React Tutorial | React Redux Online T...
React Interview Questions and Answers | React Tutorial | React Redux Online T...React Interview Questions and Answers | React Tutorial | React Redux Online T...
React Interview Questions and Answers | React Tutorial | React Redux Online T...
 
Domain Driven Design: Zero to Hero
Domain Driven Design: Zero to HeroDomain Driven Design: Zero to Hero
Domain Driven Design: Zero to Hero
 
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones WebMicro Frontends: Rompiendo el monolito en las aplicaciones Web
Micro Frontends: Rompiendo el monolito en las aplicaciones Web
 
Microservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and SagaMicroservices Architecture Part 2 Event Sourcing and Saga
Microservices Architecture Part 2 Event Sourcing and Saga
 
Microservices
MicroservicesMicroservices
Microservices
 
Vue Vuex 101
Vue Vuex 101Vue Vuex 101
Vue Vuex 101
 
DDD (Domain-Driven Design)
DDD (Domain-Driven Design)DDD (Domain-Driven Design)
DDD (Domain-Driven Design)
 
Clean architecture with asp.net core
Clean architecture with asp.net coreClean architecture with asp.net core
Clean architecture with asp.net core
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
Microservices with NGINX pdf
Microservices with NGINX pdfMicroservices with NGINX pdf
Microservices with NGINX pdf
 
Domain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) DistilledDomain Driven Design (Ultra) Distilled
Domain Driven Design (Ultra) Distilled
 

Viewers also liked

CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
Markus Eisele
 
Workshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring BootWorkshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring Boot
Fabricio Epaminondas
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Chris Richardson
 
Highload++ 2015
Highload++ 2015Highload++ 2015
Highload++ 2015
Shamim bhuiyan
 
Knowledge drivenmicroservices
Knowledge drivenmicroservicesKnowledge drivenmicroservices
Knowledge drivenmicroservices
Maciej Swiderski
 
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandracodecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
DataStax Academy
 
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
Lightbend
 
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Chris Richardson
 
Append only data stores
Append only data storesAppend only data stores
Append only data stores
Jan Kronquist
 
Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015
ontopic
 
Orientación a tendencias de Arquitectura DDD
Orientación a tendencias de Arquitectura DDDOrientación a tendencias de Arquitectura DDD
Orientación a tendencias de Arquitectura DDDCesar Gomez
 
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
Jimmy Lu
 
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Lee Trout
 
Tracing the galactic_spiral_structure_with_embedded_clusters
Tracing the galactic_spiral_structure_with_embedded_clustersTracing the galactic_spiral_structure_with_embedded_clusters
Tracing the galactic_spiral_structure_with_embedded_clusters
Sérgio Sacani
 
DDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learnedDDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learned
Qframe
 
StormCrawler in the wild
StormCrawler in the wildStormCrawler in the wild
StormCrawler in the wild
Julien Nioche
 
CQRS innovations
CQRS innovationsCQRS innovations
CQRS innovations
Andrey Lomakin
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
Alan Christensen
 
A quick introduction to Storm Crawler
A quick introduction to Storm CrawlerA quick introduction to Storm Crawler
A quick introduction to Storm Crawler
Julien Nioche
 

Viewers also liked (20)

CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
 
Workshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring BootWorkshop Guide: RESTful Java Web Application with Spring Boot
Workshop Guide: RESTful Java Web Application with Spring Boot
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
 
Highload++ 2015
Highload++ 2015Highload++ 2015
Highload++ 2015
 
Knowledge drivenmicroservices
Knowledge drivenmicroservicesKnowledge drivenmicroservices
Knowledge drivenmicroservices
 
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandracodecentric AG: CQRS and Event Sourcing Applications with Cassandra
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
 
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - w...
 
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
Handling Eventual Consistency in JVM Microservices with Event Sourcing (javao...
 
Append only data stores
Append only data storesAppend only data stores
Append only data stores
 
Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015Storm crawler apachecon_na_2015
Storm crawler apachecon_na_2015
 
Orientación a tendencias de Arquitectura DDD
Orientación a tendencias de Arquitectura DDDOrientación a tendencias de Arquitectura DDD
Orientación a tendencias de Arquitectura DDD
 
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
A Prototype of Brain Network Simulator for Spatiotemporal Dynamics of Alzheim...
 
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)
 
Tracing the galactic_spiral_structure_with_embedded_clusters
Tracing the galactic_spiral_structure_with_embedded_clustersTracing the galactic_spiral_structure_with_embedded_clusters
Tracing the galactic_spiral_structure_with_embedded_clusters
 
DDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learnedDDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learned
 
StormCrawler in the wild
StormCrawler in the wildStormCrawler in the wild
StormCrawler in the wild
 
CQRS innovations
CQRS innovationsCQRS innovations
CQRS innovations
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
A quick introduction to Storm Crawler
A quick introduction to Storm CrawlerA quick introduction to Storm Crawler
A quick introduction to Storm Crawler
 

Similar to DDD Framework for Java: JdonFramework

Architecture your android_application
Architecture your android_applicationArchitecture your android_application
Architecture your android_application
Mark Brady
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
mattjive
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Mahmoud Samir Fayed
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservices
Dennis Doomen
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
Enoch Joshua
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
scdn
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
Sanjay Gunjal
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
Brian Cavalier
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
LINAGORA
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
Sebastian Springer
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
oazabir
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
Paul Gallagher
 
Why meteor
Why meteorWhy meteor
Why meteor
Jonathan Perl
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Vikash Singh
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
Matthias Noback
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
Tahmina Khatoon
 

Similar to DDD Framework for Java: JdonFramework (20)

Architecture your android_application
Architecture your android_applicationArchitecture your android_application
Architecture your android_application
 
Open Source XMPP for Cloud Services
Open Source XMPP for Cloud ServicesOpen Source XMPP for Cloud Services
Open Source XMPP for Cloud Services
 
.net Framework
.net Framework.net Framework
.net Framework
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
 
Decomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservicesDecomposing the Monolith using modern-day .NET and a touch of microservices
Decomposing the Monolith using modern-day .NET and a touch of microservices
 
GCF
GCFGCF
GCF
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Java programming concept
Java programming conceptJava programming concept
Java programming concept
 
Angularjs
AngularjsAngularjs
Angularjs
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Divide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.jsDivide and Conquer – Microservices with Node.js
Divide and Conquer – Microservices with Node.js
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
Why meteor
Why meteorWhy meteor
Why meteor
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

DDD Framework for Java: JdonFramework

  • 5. What is Jdon?  Jdon help you build a Clean and Fluent architecture system.  Jdon is a domain framework that let your business to be independent with Database or UI.  Jdon is a domain container to run your business in non-blocking way.
  • 7. Jdon Framework (JF)  a light-weight framework for developing Domain- Driven Design applications.  Jdon introduces reactive event-driven into domain.  Help you develop a asynchronous concurrency and higher throughput application
  • 8. Jdon vs Spring  Jdon is very difference with Spring framework.  Jdon is a default event-driven and asynchronous framework.  Jdon/Event- asynchronous vs. Spring/Request-Response
  • 9. Jdon’s Revolution  Single Writer component model :DDD’s AggregateRoot guards mutable state. And Jdon guarantees single operation on in- memory state by using Disruptor.  Increases domain mode the level of abstraction. Communication betwwen Business Domain and others(UI/DB) is Event/Message.
  • 10. Jdon’s Revolution  Two persistence choices between State and Event: SOA CQRS or EventSourcing.  Make your applications high throughput and lower latency.  Scalable.
  • 11. In-memory Programming Paradigm  Jdon changes traditional programming paradigm (Spring + Hibernate/JPA etc.)  Make ORM be dead ,domain model is not bind to any ORM framework.  Make Data collection or Anemia model be dead.
  • 12. Lock vs Singel writer  There are plenty of idioms to synchronize multi-threaded access to a resource  lock is sloooow, especially with a high number of writer threads.  In-memory Singel writer is Actors model (Akka/Erlang etc.)
  • 13. Blocking  public class AggregateRoot{  private ChannelState state;   //tradional lock  public void synchronized changeChannel(changeCommand cmd){  state = cmd.getState();  }  }
  • 14. Jdon NonBlocking  public class AggregateRoot{  private ChannelState state;  //single write  @OnCommand("UserSaveCommand")  public void changeChannel(changeCommand cmd){  state = cmd.getState();  }  }
  • 15. Jdon basic component Annotations @Model : Aggregate Root Entity Model @Service : Micro service or DDD service @Component: Normal components.
  • 16. AOP component Annotations @Interceptor: AOP’s Interceptor @Introduce: Advisor
  • 17. 1. Create a domain model  A domain model is the aggregate root enity in DDD.  DDD can help us find some domain models in business requirement  Example:  public class MyModel {  private String Id;  private String name;  ....  }
  • 18. Using @Model  make sure the domain object in-memory cache:  @Model public class MyModel { private String userId; private String name; .... }  @Model is a jdon’s annotation for domain model.
  • 19. Loading Model from Repository @Introduce(“modelCache”) must be annotated in repository class @Around must be annotated on the loading method. GitHub Source code
  • 20. 2. Create a domain event  Domain event is emitted from a domain model, generally is a aggregate root entity,  Jdon can help you develope domain event easily.  Jdon provides asynchronous communication component model.  Producer-Consumer or Publisher- Subscriber pattern.
  • 21. Four kinds of Producer-Consumer  1. @Component -----> @model  2. @model ------->@Component  3. @Compponent ------> @Component  4. @model------> @model
  • 22. Producer-Consumer Procuder: @Introduce("message") is for Producer class; @send is for Producer class’s method Consumer: @Consumer is for Consumer class @OnEvent is for Consumer class’s method.
  • 25. Single Writer Principle Domain Model Aggregate root @Model Disruptor Queue Command Single thread Producer @Component @Service
  • 26. Communications principle  Powered by disruptor from LMAX  Can handle 6 million orders per second on a single thread  recommended by Martin Fowler.
  • 27. What is Domain Events  Events that happened in the domain.  captures the essence of business domains while staying decoupled from platform complexity or hard performance issues.  No Block concurrent, No Lock ,so fast. fit for multi-core.  Storage Ignorance ,Flexibility, Messaging Capabilities, Scalable.
  • 28. One Command =>Many Events Domain Model @Model Other Components @Componet Logging @Consumer GUI MVC Client Persistence @Consumer async Message async Message async Message Component architecture Command
  • 29. One Command=>one Domain Event Domain Model Aggregate root @Model Command Producer @Component Consumer @Consumer @Component Domain Events Domain Model Aggregate root @Model Command
  • 30. Domain Events is basic for CQRS User interface Service Domain Event/Message BUSInfrastructure Query/ Reporting Commands Commands Events
  • 31. How Domain Events work? Domain Model Aggregate root @Model Consumer @Consumer @Component Disruptor Or Java concurrent Future Domain Events
  • 32. Event principle Queue Mychannel Powered by Ringbuffer @Send("mychannel") will push the DomainMessage into the Queue, And the consumer will fetch it from the Queue.
  • 34. Producer  @Model or @Service/@Component can be a Producer.  When a Component/Service sends messages to a Domain Model(aggregate root), that is a command,  When a domain model sends message to a Component, that is a event
  • 35. Consumer  @Model cann’t be a Consumer  Only @Component can be a Consumer.  Two kinds of consumers:  @Consumer is for a class.  @OnEvent is for method of any @Component  If there are several consumers, action’s order is by the alphabetical of class name:AEventHandler => BEventHandler => CEvent…
  • 36. Consumer return a result  If you want to return a result in consumer, you can set the result object into the DomainMessage of the event in DomainEventHandler :  void onEvent(EventDisruptor event, boolean endOfBatch) throws Exception {  //return the result “eventMessage=hello”  event.getDomainMessage().setEventResult("eventMessage=" + myModel.getId());  }
  • 37. How to get the result?  If a consumer return a result, that is a asynchronous.  event.getDomainMessage(). getEventResult()  First times, maybe you can’t fetch it.  Second times You can get it.  You can call block method to fetch it a blocking way, this is :  event.getDomainMessage(). getBlockEventResult()
  • 38. The benefits of @Consumer  Atomic; separates a transaction into single event process, that is event stream.  Asynchronous saving datas to DB or Lucene is high load, we can implement them with two EventHandlers by different latency.
  • 39. Domain Events(DE) apply in JEE Root Entity VO Entity Service Root Entity boundary boundary Tech. Architecture Domain Events Domain Events
  • 40. Domain Events Pattern  Loose Coupling business logic is separate from technology architecture. decouple "What" From "How"  Event-driven Architecture asynchronous event-driven architectures  Asynchronous Lazy-load like lazy evaluation of functional language .  True Scalability Scale out on multi-core or multiple nodes using asynchronous message passing ( JMS).
  • 41. Example 1: Concurrency pattern  No domain events codes : CPU killer: public int getMessageCount(){ int messageCount = xxxx; // complex computing, high CPU usage, CPU killer return messageCount; }  Domain events can pre-load or pre-run the complex computing: public int getMessageCount(DomainEvents domainEvents) { if (messageCount == -1) { if (messageCountAsyncResult == null) { messageCountAsyncResult = domainEvents.computeCount(account.getUserIdLong()); } else { messageCount = (Integer) messageCountAsyncResult.getEventResult(); } } return messageCount; }
  • 42. Example 2 Asynchronous Lazy load 1. invoking ‘getMessageCount’ will send a message to ‘computeCount’ of Repository by domainEvents. 2. again invoking ‘getMessageCount’ will return last step result.(such as by AJAX )  Download Sample Source
  • 43. Lazy initialization/Lazy evaluation  On demand load or init a object from DB.  functions are not evaluated until their results are needed  no Hibernate LazyInitializationExceptions  no Open Session in View anti-pattern
  • 44. Scale to distributed system Domain Model JMS MQ ZeroQ RabbitMQ Persistence Send Email Other Services Message Domain Model Message Distributed Cache Distributed Cache
  • 45. Events Challenge  Most programmers are good at a synchronous mode that be executed sequentially in a thread.  Events is a non-blocking concurrent programming mode, that maybe is harder to most people.  if domain business need be executed sequentially , so we can do it by domain events too.
  • 46. Blocking problem  In a blocking system, wait thread is idle but continue to consume system resources.  This will very costs resource, for high transaction volume: the number of idle threads =(arrival_rate * processing_time) the result can be a very big number if the arrival_rate is high.  Blocking system is running under a very ineffective mode. No high throughout, no high CPU load.
  • 47. Non-Blocking concurrent  Make a call which returns a result. don't need to use the result until at a much later stage of your process.  don't need to wait immediately after making the call, instead you can proceed to do other things until you reach the point where you need to use the result.  the call itself will return a "future" handle immediately. The caller can go off doing other things and later poll the "future" handle to see if the response if ready.
  • 48. JdonFramework Non-Blocking concurrent  Domain Model sends events to another thread(a consumer) by RingBuffer in Disruptor, so threads can communicates through events.  After consumer done, it will put the result in another RingBuffer that publisher can read or blocking read it, decided by business is or not executed sequentially.
  • 49. Higher abstract of concurrent  Non-Blocking’s concurrent programming is complex.  How to develop a concurrent app. easily?  Like Actor Model is like domain events, messages are sent asynchronously and non- blocking in a “fire-and-forget” manner. But LMAX team of the Disruptor thinks Actor model has bottleneck.  DCI Architecture DCI is easy to be understood. It’s abstract level is high than domain events.
  • 50. DCI  DCI: Data, Context, Interactions is a programming paradigm invented by Trygve Reenskaug.  keep our core model classes very thin.  logic/behaviour should be kept in roles.  Domain Events is a Interactions, Events Producer is the Role.
  • 51. Model Injection  JdonFramework can inject Domain Events into domain model at runtime, this is maybe like Mixin.  Domain Events is Interactions of Roles, so Roles are then assigned(Injected) to data objects at runtime, only when required within given Context.
  • 52. DCI : Data  Domain Model is the DATA of DCI, no logic no behaviour. Source: com.jdon.sample.test.domain.simplecase.MyModel
  • 53. DCI : Role and Interactions This is a Role of DCI , it includes the interactions of DCI. It is event producer Source:com.jdon.sample.test.domain.simplecase.MyModelDomainEvent
  • 54. DCI : Context  In Context,The Role will be injected into the data.  //after fetching the myModel object, it has been injected events  MyModel myModel = repository.getModel(new Long(100)); // call myModel’s events  myModel .myModelDomainEvent.asyncFindName(this);
  • 55. com.jdon.domain.dci.RoleAssigner  com.jdon.domain.dci.RoleAssigner is a Role assigner that can inject(Mixin) any interface into a data model.  When using RoleAssigner, it is not necessary that fetch a object of data model by a repository annotated with @Introduce("modelCache") and its get method with @Around
  • 56. Different DCI styles  If we already hold on a model object, we can implements various functions by its domain events,such as modify/update a model.  Otherwise:  We create a context, and there we inject events or functions into a new model object by RoleAssigner,such as create or delete a model.
  • 58. concurrent programming is easy  Jdonframework makes an exploratory to promote non-blocking concurrent programming paradigm .  DCI and Domain Events are different abstract levels based concurrent programming .  DCI and UML colors analysis method can successfully docking, it is the highest level of abstraction of business-oriented.  Help most programmers quietly going to the way of non-blocking concurrent programming when they thinking in DDD.
  • 59. DI and AOP  Dependency Injection(DI or IOC) @Service or @Component can inject with each other by class construction(not supports setter injection). @Service or @Component can be inected into @Model or by domain events.  Aspect-oriented programming(AOP) with annotation @Introduce: @Service or @Component can introduce each others as its interceptor. @Model can introduce any POJO or @Component as its interceptor.
  • 60. @Model mechanism Client xx.getA(“a”) A @Model Interceptor for A with @Introduce B that need implements interface and has @Introduce Inject proxy of B Interceptor for B with @Introduce Cache In-memeory C Inject proxy of c Component In Context Container interceptor
  • 61. Inject a interceptor in @Model
  • 62. Living space  @Model lives in cache that default is Guava Cache.  @Component/@Service lives in a context such as servletcontext.  All @Component can be injected into @Model.
  • 63. @Component mechanism Client xx.getA(“a”) A @Service Interceptor (poincut=service) B that need implements interface @Component Inject proxy of B Interceptor for B with @Introduce Context container (ServletContext)
  • 64. @Service/@Component  @Service("testService")  public class TestServicePOJOImp implements TestService{  private final UserRepository userRepository;  public TestServicePOJOImp(UserRepository userRepository) {  this.userRepository = userRepository;  }  }  @Component()  public class UserRepository {  ….  }  Difference between @Service and @Component is that the @Service class must have a interface then can be called by outside client beyond jdon.
  • 65. @Service  @Service expose to the client, has several kind instances: singleton , prototype or pool that have them annotations, default is prototype(spring default is singleton ) 。
  • 67. In-Memory Model  When a domain model object with @Model is fetch from repository, we need use @Introduce(“modelCache”) to mak the object live in memory.  There are two cache interceptors existed before and after domain layer.  Domain events need annotation @Introduce(“modelCache”) in the place that domain model objects are created or reconstructed from persistence or other systems.
  • 68. JdonFramework Cache Presentation Domain Persistence CacheInterceptor In aspect.xml DomainCacheInteceptor @Introduce(“modelCache”)
  • 69. in memeory model @Introduce(“modelCache”) must be annotated in the reposotory that @Model objects are created or reconstructed This step is very important for domain events working
  • 70. What happeded in memeory?  First times invoke “getModel” method of RepositoryImp, jdon will do two things: One: put the return value(model) in cache. So next times can get it from cache. Two: inject domain events into this model.  Next times, invoke the method again, we will get the model only one instance from cache.
  • 71. Start jdonFramework in WEB  If all is annotation, no jdonframework.xml, no need this step  Configuration in Web.xml:  <context-param>  <param-name> modelmapping-config </param-name>  <param-value> jdonframework.xml </param-value>  </context-param>  <listener>  <listener- class>com.jdon.container.startup.ServletContainerListener</listener-class>  </listener>
  • 72. How to use in application  AppUtil appUtil = new AppUtil();  // xxx is value of @Service(“xxx”) annotation on class.  XXXService xxxService = appUtil.getService(“xxx”);  xxxService.method();  If there is jdonframework.xml:  AppUtil appUtil = new AppUtil("com.jdon.jdonframework.xml");
  • 73. Other features in JdonAccessory  Rapid development, template toolkit. JDBC template  Eliminate “Controller/Action” ,No controller code of MVC (only supports Struts 1.x)  Batch Query, auto pagination 。
  • 74. MVC Controller configuration in jdonframework.xml(struts1.x)
  • 76. Batch Query in jdon-jdbcTemp.jar  Cache supports.  Auto pagination.  In presentation layer: extends com.jdon.strutsutil.ModelListAction  in persistence layer: call getDatas of com.jdon.controller.model.PageIterator
  • 78. Jdon on Github  https://github.com/banq/jdonframework  http://en.jdon.com Document  https://twitter.com/jdonframework Twitter: @jdonframework