K
Ken
Hi. Does anyone know if java asserts can be applied to interface
operations? I ask this in the context of verifying contracts. The
idea is that you'd want to use asserts to define pre and post
conditions for each operation in the interface. Then these asserts
would be automatically applied to any class that implemented the
interface. This would avoid having to physically include the same
assert code in every class that implemented the interface. This is
the same idea behind allowing an interface to have its exceptions
identified--namely, to guanrantee that each implementation will throw
the exceptions associated with the interface.
Thanks for any input,
Ken
operations? I ask this in the context of verifying contracts. The
idea is that you'd want to use asserts to define pre and post
conditions for each operation in the interface. Then these asserts
would be automatically applied to any class that implemented the
interface. This would avoid having to physically include the same
assert code in every class that implemented the interface. This is
the same idea behind allowing an interface to have its exceptions
identified--namely, to guanrantee that each implementation will throw
the exceptions associated with the interface.
Thanks for any input,
Ken