All Projects → xmolecules → Jmolecules

xmolecules / Jmolecules

Licence: apache-2.0
Libraries to help developers express architectural abstractions in Java code

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Jmolecules

Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+556.61%)
Mutual labels:  architecture, domain-driven-design
Ddd Dynamic
Domain Driven Design in Python, Ruby and other dynamic languages resources
Stars: ✭ 973 (+179.6%)
Mutual labels:  architecture, domain-driven-design
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+1684.48%)
Mutual labels:  architecture, domain-driven-design
Cleanarchitecture
An example of how to implement various clean coding & architecture techniques. Technologies used: .Net Core, Razor Pages, EF Core, Bootstrap 4
Stars: ✭ 98 (-71.84%)
Mutual labels:  architecture, domain-driven-design
Polysemycleanarchitecture
Showcasing how the Polysemy library can be used to implement a REST application conforming to the guidelines of the Clean Architecture model.
Stars: ✭ 106 (-69.54%)
Mutual labels:  architecture, domain-driven-design
Aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
Stars: ✭ 10,061 (+2791.09%)
Mutual labels:  architecture, domain-driven-design
Patterns
Complete catalog of all classical patterns in the Archimate language
Stars: ✭ 70 (-79.89%)
Mutual labels:  architecture, domain-driven-design
Domain Driven Hexagon
Guide on Domain-Driven Design, software architecture, design patterns, best practices etc.
Stars: ✭ 4,417 (+1169.25%)
Mutual labels:  architecture, domain-driven-design
ddd-example-ecommerce
Domain-driven design example in Java with Spring framework
Stars: ✭ 73 (-79.02%)
Mutual labels:  architecture, domain-driven-design
Domain Driven Design Zh
DDD《领域驱动设计》中文翻译
Stars: ✭ 307 (-11.78%)
Mutual labels:  domain-driven-design
Domain Story Modeler
A tool to visualize Domain Stories in your browser
Stars: ✭ 335 (-3.74%)
Mutual labels:  domain-driven-design
Kunidirectional
The goal of this sample app is to show how we can implement unidirectional data flow architecture based on Flux and Redux on Android... using Kotlin 😉
Stars: ✭ 303 (-12.93%)
Mutual labels:  architecture
Micro Company
Rest-full, Hipermedia-based distributed application. Spring boot & cloud. Angular. CQRS. Eventsourcing. Axonframework. Microservices. Docker. CloudFoundry
Stars: ✭ 307 (-11.78%)
Mutual labels:  architecture
Swift Composable Architecture
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Stars: ✭ 5,199 (+1393.97%)
Mutual labels:  architecture
Annon.api
Configurable API gateway that acts as a reverse proxy with a plugin system.
Stars: ✭ 306 (-12.07%)
Mutual labels:  architecture
Serverless Photo Recognition
A collection of 3 lambda functions that are invoked by Amazon S3 or Amazon API Gateway to analyze uploaded images with Amazon Rekognition and save picture labels to ElasticSearch (written in Kotlin)
Stars: ✭ 345 (-0.86%)
Mutual labels:  architecture
Clean Architecture Zh
《架构整洁之道》中文翻译
Stars: ✭ 299 (-14.08%)
Mutual labels:  architecture
Hexagonal Architecture Acerola
An Hexagonal Architecture service template with DDD, CQRS, TDD and SOLID using .NET Core 2.0. All small features are testable and could be mocked. Adapters could be mocked or exchanged.
Stars: ✭ 293 (-15.8%)
Mutual labels:  domain-driven-design
Laravel Modules
Module Management In Laravel
Stars: ✭ 3,910 (+1023.56%)
Mutual labels:  architecture
Arch
极客时间专栏《许式伟的架构课》相关的源代码:冯诺伊曼结构
Stars: ✭ 335 (-3.74%)
Mutual labels:  architecture

= jMolecules – Architectural abstractions for Java

A set of libraries to help developers work with architectural concepts in Java. Goals:

  • Express that a piece of code (package, class, method...) implements an architectural concept.
  • Make it easy for the human reader to determine what kind of architectural concepts a given piece of code is.
  • Allow tool integration (to do interesting stuff like generating persistence or static architecture analysis to check for validations of the architectural rules.)

== Expressing DDD concepts Example:

[source,java]

import org.jmolecules.ddd.annotation.*;

@Entity public class BankAccount { /* ... */ }

@ValueObject public class Currency { /* ... */ }

@Repository public class Accounts { /* ... */ }

When we take Ubiquitous Language serious, we want names (for classes, methods, etc.) that only contain words from the domain language. That means the titles of the building blocks should not be part of the names. So in a banking domain we don't want BankAccountEntity, CurrencyVO or even AccountRepository as types. Instead, we want BankAccount, Currency and Accounts – like in the example above.

Still, we want to express that a given class (or other architectural element) is a special building block; i.e. uses a design pattern. jMolecules provide a set of standard annotations for the building blocks known from DDD.

=== Using a type based model

As an alternative to the above mentioned annotations, jMolecules also provides a set of interfaces, largely based on the ideas presented in John Sullivan's series https://scabl.blogspot.com/p/advancing-enterprise-ddd.html["Advancing Enterprise DDD"]. They allow expressing relationships between the building blocks right within the type system, so that the compiler can help to verify model correctness and the information can also be processed by Java reflection more easily.

  • Identifier -- A type to represent types that are supposed to act as identifiers.
  • Identifiable<ID> -- Anything that's exposing an identifier.
  • Entity<T extends AggregateRoot<T, ?>, ID> extends Identifiable<ID> -- An entity, declaring to which AggregateRoot it belongs and which identifier it exposes.
  • AggregateRoot<T extends AggregateRoot<T, ID>, ID extends Identifier> extends Entity<T, ID> -- an aggregate root being an Entity belonging to itself exposing a dedicated Identifier
  • Association<T extends AggregateRoot<T, ID>, ID extends Identifier> extends Identifiable<ID> -- an explicit association to a target AggregateRoot.

This arrangement gives guidance to modeling and allows to easily verify the following rules, potentially via reflection:

  • Enforced, dedicated identifier types per aggregate to avoid identifiers for different aggregates mixed up.
  • AggregateRoot must only refer to Entity instances that were declared to belong to it.
  • AggregateRoots and Entitys must only refer to other AggregateRoots via Association instances.

For automated verification and runtime technology integration see https://github.com/xmolecules/jmolecules-integrations#jmoleculestechnology-integrations[jMolecules Integrations].

=== Libraries

  • link:jmolecules-ddd[jmolecules-ddd] -- annotations and interfaces to express DDD building blocks (value objects, entities, aggregate roots etc.) in code.
  • link:jmolecules-events[jmolecules-events] -- annotations and interfaces to express the concept of events in code.

== Expressing architecture jMolecules provides annotations to mark a package as a layer (or ring):

[source,java]

import org.jmolecules.architecture.layered.*;

@DomainLayer package org.acmebank.domain;

@ApplicationLayer package org.acmebank.application;

That way, all classes in the respective package are considered to be part of the annotated layer.

Alternatively, classes can be annotated directly:

[source,java]

import org.jmolecules.architecture.layered.*;

@DomainLayer @Entity public class BankAccount { /* ... */ }

@ApplicationLayer @Service public class TransferMoney { /* ... */ }

Currently, annotations for Layered and Onion Architecture exist.

=== Libraries

  • link:jmolecules-architecture[jmolecules-architecture] -- annotations to express architectural styles in code. ** link:jmolecules-architecture/jmolecules-cqrs-architecture[jmolecules-cqrs-architecture] -- CQRS architecture *** @Command *** @CommandDispatcher *** @CommandHandler *** @QueryModel ** link:jmolecules-architecture/jmolecules-layered-architecture[jmolecules-layered-architecture] -- Layered architecture *** @DomainLayer *** @ApplicationLayer *** @InfrastructureLayer *** @InterfaceLayer ** link:jmolecules-architecture/jmolecules-onion-architecture[jmolecules-onion-architecture] -- Onion architecture *** Classic **** @DomainModelRing **** @DomainServiceRing **** @ApplicationServiceRing **** @InfrastructureRing *** Simplified (does not separate domain model and services) **** @DomainRing **** @ApplicationRing **** @InfrastructureRing

== Installation To use jMolecules in your project just install it from the Maven central repository.

=== Maven

[source,xml]

org.jmolecules jmolecules-ddd 1.2.0 ----

=== Gradle

[source,groovy]

compile("org.jmolecules:jmolecules-ddd:1.2.0")

== Release instructions

  • mvn release:prepare -DscmReleaseCommitComment="$ticketId - Release version $version." -DscmDevelopmentCommitComment="$ticketId - Prepare next development iteration."
  • mvn release:perform -Dgpg.keyname=$keyname
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].