[TOC] ---------------------------------------------------------------------------------------------------- # About OOP in Groovy OOP in Groovy is implemented in a similar way as in Java. Groovy operates with classes, inheritance and interfaces the similar way. Following subsections describe only some OOP features that are are different in Groovy compared to Java. ---------------------------------------------------------------------------------------------------- # Implicit module class Modules are implicitly compiled into classes:
project1/modules.groovy
````groovy ```` ---------------------------------------------------------------------------------------------------- # Implicit getters and setters No need for Lombok!
project1/getters_and_setters.groovy
````groovy ```` ---------------------------------------------------------------------------------------------------- # Traits This is just a very small introduction to traits. For much more details see [, [1.4.5. Traits](https://docs.groovy-lang.org/latest/html/documentation/#_traits)].
project1/traits.groovy
````groovy ```` !!! note Traits also implement the **mixin** concept. As per the [documentation](https://docs.groovy-lang.org/latest/html/documentation/#xform-Mixin): > `@groovy.lang.Mixin` > Deprecated. Consider using traits instead.