The following code is an example of architecture with annotation based validations, using OO techniques. Enjoy.