Software

INTEGU-java-best-practices-49-argument-validity-50-defensive-copies

Methods

Assert method arguments validity
Whenever an object is given in as a method argument, it should be asserted in terms of validity as the first thing.

This can be done with something as Objects.requireNonNull(arg), which will throw an exception if the argument is null.

Additionally, if you want to determine which arguments, should be allowed to be nullable, the @Nullable annotation can be used.

composite-design-pattern-overview-INTEGU

Composite Pattern

The composite design pattern is intended for structuring data classes with a relationship to each other. It categorizes the data as either a composite- or and leaf class, which determines whether other classes can be stored within the class. For this reason, it should come as no shock that it is a structural design pattern.

Decorator-Pattern-Whiteboard - INTEGU

Decorator Pattern

The reasoning for using the Decorator Pattern is to obtain the advantages of class inheritance within a dynamic context. (aka. at runtime.) This allow objects to add and remove additional features while the program is running instead of specifically declaring it when the program compiles.

Scroll to Top
INTEGU - Cookie-consent

INTEGU uses cookies to personalize your experience and provide traceability for affiliate links. By using the website, you agree to these terms and conditions. To learn more see the privacy policy page.