| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <body> |
| <h1>Tutorial 3 - Mixins</h1> |
| <p> |
| In this tutorial we refactor the Mixin from the previous steps into two, one which serves |
| the behaviour interface and one which serves the state interface. This makes it possible to |
| reuse the interfaces independently and also makes it easier to exchange one interface implementation |
| with another. This also allows us to specify the new Mixins as default implementations of |
| the interfaces by adding @Mixins annotations on them. |
| </p> |
| <p> |
| Steps for this tutorial: |
| </p> |
| <ol> |
| <li>Refactor the Mixin into one which implement the behaviour interface and one which implements the state |
| interface. Use the @This injection annotation to allow the behaviour to access the state. |
| </li> |
| <li>Add a @Mixins annotations on the behaviour and state interfaces which declare the Mixins as default |
| implementations. |
| </li> |
| <li>Remove the @Mixins annotation from the TransientComposite interface.</li> |
| </ol> |
| </body> |