Aplicando Design by Contract em web services RESTful

Alan de Oliveira Silva · 2017

REST is an architectural style defined in 2000 by Roy Thomas Fielding, based on the HTTP protocol, being nowadays in constant adoption, including by the great companies of technology of the world, like Google and Facebook. Design by Contract is a programming technique conceived in 1992 by Bertrand Meyer to increase the security and robustness of software through the use of contracts. As the REST style does not have a contract specification or validation, in the present research will be made the application of Design by Contract in Web Services RESTful. In order to validate this proposal, we present proofs of concept between the official validation specification Bean Validation of Java EE and Design by Contract implemented by an adaptation of the AspectJML language, addressing comparisons of functionalities, performance and production of error messages. The results showed that this version of the AspectJML language has more features for the implementation of contracts than the validations that are possible to be created with Bean Validation, and also have slightly higher request return performance to implement the same contract and being able to to produce error responses compatible with RESTful best practices.

Read the paper · More papers on PaperTik