5.2.3 Configuration Options

The following options are available to all MVC groups as long as you use the `config` key.

#### Disabling Lifecycle Events

Every MVC group triggers a few events during the span of its lifetime. These events will be sent to the event bus even if no component is interested in handling them. There may be times when you don't want these events to be placed in the event bus in order to speed up group creation/destruction. Use the following configuration to gain this effect:

    mvcGroups {
        // MVC Group for "sample"
        'sample' {
            model      = 'sample.SampleModel'
            view       = 'sample.SampleView'
            controller = 'sample.SampleController'
            config {
                events {
                    lifecycle = false
                }
            }
        }
    }

The following events will be disabled with this setting:

- `InitializeMVCGroup`
- `CreateMVCGroup`
- `DestroyMVCGroup`

#### Disabling Instantiation Events

The Griffon runtime will trigger an event for every artifact it manages. As with the previous events this one will be sent to the event bus even if no component handles it. Skipping publication of this event may result in a slight increase of speed during group instantiation. Use the following configuration to gain this effect:

    mvcGroups {
        // MVC Group for "sample"
        'sample' {
            model      = 'sample.SampleModel'
            view       = 'sample.SampleView'
            controller = 'sample.SampleController'
            config {
                events {
                    instantiation = false
                }
            }
        }
    }

The following events will be disabled with this setting:

- `NewInstance`

#### Disabling Controllers as Application Event Listeners

Controllers are registered as application event handlers by default when a group in instantiated. This makes it very convenient to have them react to events placed in the application's event bus. However you may want to avoid this automatic registration altogether, as it can lead to performance improvements. You can disable this feature with the following configuration:

    mvcGroups {
        // MVC Group for "sample"
        'sample' {
            model      = 'sample.SampleModel'
            view       = 'sample.SampleView'
            controller = 'sample.SampleController'
            config {
                events {
                    listener = false
                }
            }
        }
    }

You can still manually register a controller as an application event handler at any time, with the caveat that it's now your responsibility to unregister it when the time is appropriate, most typically during the group's destroy sequence.