-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Outline
Implement the ideas from the Eiffel language regarding design by contract in Java.
Implementation Notes
- Ideally, these are specified as annotations pointing to
RuleSetobjects - Other than the Eiffel counterpart, these condition statements should be validated on build-time execution, by informing test-cases, rather than crashing the program during runtime processing.
- Will likely require AOP implementation of sorts
Usage Desisderata
@ValidatedBy(aValid(SomeObject.class).must(notBeNull).must(haveNonNullField(SomeObject::name)).iHaveSpoken())
class SomeObject {
private String name;
@PreCondition(adheresTo=aValid(SomeObject.class).must(haveNonNullField(SomeObject::name)).iHaveSpoken())
@PostCondition(adheresTo=aValid(SomeObject.class).must(haveNonNullField(SomeObject::name)).iHaveSpoken())
public Result doSomething(InputClass input) {
}
} Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request