Skip to content

Instantly share code, notes, and snippets.

@acdcjunior
Created June 29, 2018 21:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acdcjunior/9e2288a323070a05f5cfe6ac70a18524 to your computer and use it in GitHub Desktop.
Save acdcjunior/9e2288a323070a05f5cfe6ac70a18524 to your computer and use it in GitHub Desktop.
DDD Annotations for Java
import java.lang.annotation.*;
public class DDD {
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface ApplicationService { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface DomainService { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface AggregateRootEntity { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface NonAggregateRootEntity { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface ValueObject { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface Repository { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface Factory { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface Assembler { }
@Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface ViewModel { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment