Skip to content

Commit

Permalink
GH-144 - Consistently switch to runtime retention for annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Nov 6, 2024
1 parent 5cdd97f commit a3e81a5
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @see SecondaryPort
* @since 1.5
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface Adapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @see Adapter
* @since 1.5
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface Application {}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @see SecondaryPort
* @since 1.5
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface Port {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @since 1.5
*/
@Adapter
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface PrimaryAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @since 1.5
*/
@Port
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface PrimaryPort {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @see SecondaryPort
*/
@Adapter
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface SecondaryAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @since 1.5
*/
@Port
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface SecondaryPort {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
* @see <a href="https://domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf">Domain-Driven Design
* Reference (Evans) - Layered Architecture</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface ApplicationLayer {
}
public @interface ApplicationLayer {}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
* @see <a href="https://domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf">Domain-Driven Design
* Reference (Evans) - Layered Architecture</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface DomainLayer {
}
public @interface DomainLayer {}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
* @see <a href="https://domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf">Domain-Driven Design
* Reference (Evans) - Layered Architecture</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface InfrastructureLayer {
}
public @interface InfrastructureLayer {}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
* @see <a href="https://domainlanguage.com/wp-content/uploads/2016/05/DDD_Reference_2015-03.pdf">Domain-Driven Design
* Reference (Evans) - Layered Architecture</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface InterfaceLayer {
}
public @interface InterfaceLayer {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface ApplicationServiceRing {
}
public @interface ApplicationServiceRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface DomainModelRing {
}
public @interface DomainModelRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface DomainServiceRing {
}
public @interface DomainServiceRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface InfrastructureRing {
}
public @interface InfrastructureRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@
import java.lang.annotation.Target;

/**
* Identifies the {@link ApplicationRing} in an onion architecture. The application ring implements and
* orchestrates business use case. To do so, it only depends on the inner rings, i.e. the {@link DomainRing}.
* Identifies the {@link ApplicationRing} in an onion architecture. The application ring implements and orchestrates
* business use case. To do so, it only depends on the inner rings, i.e. the {@link DomainRing}.
*
* @author Christian Stettler
* @author Henning Schwentner
* @author Stephan Pirnbaum
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface ApplicationRing {
}
public @interface ApplicationRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,21 @@
import java.lang.annotation.Target;

/**
* Identifies the {@link DomainRing} in an onion architecture. The domain ring is the inner-most ring in the
* onion architecture and is only coupled to itself. It models the truth of the business domain by consisting of
* behaviour (logic) and the required state (data).
*
* Compared to the 4-ring onion architecture in which the domain is split into domain model and domain services, the
* 3-ring version combines those 2 rings so that it implements behavior (logic), state (data), and interfaces needed for
* e.g. storing and retrieving data, i.e. repository interfaces.
* Identifies the {@link DomainRing} in an onion architecture. The domain ring is the inner-most ring in the onion
* architecture and is only coupled to itself. It models the truth of the business domain by consisting of behaviour
* (logic) and the required state (data). Compared to the 4-ring onion architecture in which the domain is split into
* domain model and domain services, the 3-ring version combines those 2 rings so that it implements behavior (logic),
* state (data), and interfaces needed for e.g. storing and retrieving data, i.e. repository interfaces.
*
* @author Christian Stettler
* @author Henning Schwentner
* @author Stephan Pirnbaum
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface DomainRing {
}
public @interface DomainRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
* @author Martin Schimak
* @author Oliver Drotbohm
* @see <a href="https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/">The Onion Architecture : part 1
* (Palermo)</a>
* (Palermo)</a>
*/
@Retention(RetentionPolicy.CLASS)
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PACKAGE, ElementType.TYPE })
@Documented
public @interface InfrastructureRing {
}
public @interface InfrastructureRing {}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlin.reflect.KClass
* @author Oliver Drotbohm
* @see [John Sullivan - Advancing Enterprise DDD - Reinstating the Aggregate](https://scabl.blogspot.com/2015/04/aeddd-9.html)
*/
@Retention(AnnotationRetention.RUNTIME)
@Retention
@Target(
AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.FIELD,
Expand Down

0 comments on commit a3e81a5

Please sign in to comment.