Skip to main content
added 4 characters in body
Source Link
smp7d
  • 4.2k
  • 1
  • 27
  • 40

Based on the comment "one of my goals is to remove the parameter validation from the function itself so that you can only have the actual function code that accomplishes the intended task without the additional code for validation", you may want to look at using AOP for method validationusing AOP for method validation. Hopefully the technologies you are using can support that paradigm.

In this case, your validator would be an aspect and would not pollute the business logic of your function. This should add the benefit of making your validation logic readily reusable and will help support unit testing.

Based on the comment "one of my goals is to remove the parameter validation from the function itself so that you can only have the actual function code that accomplishes the intended task without the additional code for validation", you may want to look at using AOP for method validation. Hopefully the technologies you are using can support that paradigm.

In this case, your validator would be an aspect and would not pollute the business logic of your function. This should add the benefit of making your validation logic readily reusable and will help support unit testing.

Based on the comment "one of my goals is to remove the parameter validation from the function itself so that you can only have the actual function code that accomplishes the intended task without the additional code for validation", you may want to look at using AOP for method validation. Hopefully the technologies you are using can support that paradigm.

In this case, your validator would be an aspect and would not pollute the business logic of your function. This should add the benefit of making your validation logic readily reusable and will help support unit testing.

Source Link
smp7d
  • 4.2k
  • 1
  • 27
  • 40

Based on the comment "one of my goals is to remove the parameter validation from the function itself so that you can only have the actual function code that accomplishes the intended task without the additional code for validation", you may want to look at using AOP for method validation. Hopefully the technologies you are using can support that paradigm.

In this case, your validator would be an aspect and would not pollute the business logic of your function. This should add the benefit of making your validation logic readily reusable and will help support unit testing.