I’m implementing a queue-based strategy design pattern for enqueueing different validations depending on input.
I have multiple validation classes organized within separate Java files, all of which are package-private – the toy example is included below, interfaces/abstract classes omitted for brevity.
// "Strategy" classes for validating Parameters - 1 or more may be enqueued
ValidateParams.java
|- class ValidateLengthSize
|- class ValidateString
|- class ValidateInteger
|- class ValidateFloat
// "Strategy" classes for validating Outputs - 1 or more may be enqueued
ValidateOutput.java
|- class ValidateOutputSize
|- class ValidateOutputLength
|- class ValidateOutputCombination
.
.
.
Based on my research on Stack Overflow, Java files typically have one public class and nest others if necessary.
Since my validation classes are all package-private and don’t require a public interface, I’m unsure if this structure is appropriate. If it is not appropriate is there a better way to structure the classes?
Thanks!