## 5.2.2 Composition in GORM

As well as association, Grails supports the notion of composition. In this case instead of mapping classes onto separate tables a class can be "embedded" within the current table. For example:

    class Person {
    	Address homeAddress
    	Address workAddress
    	static embedded = ['homeAddress', 'workAddress']
    }
    class Address {
    	String number
    	String code
    }

The resulting mapping would looking like this:

> If you define the `Address` class in a separate Groovy file in the `grails-app/domain` directory you will also get an `address` table. If you don't want this to happen use Groovy's ability to define multiple classes per file and include the `Address` class below the `Person` class in the `grails-app/domain/Person.groovy` file