Let's cover the most important aspects of the dimension view.
A dimension view needs the header annotation @Analytics.dataCategory: #DIMENSION to define the view as a dimension.
The annotation @ObjectModel.representativeKey is needed. This annotation must point to the key field which represents the dimension. For example, the dimension for City has the two key fields Country and City. The representative key field is City.
All key fields which are not the representative key field usually have a foreign key association or a text association. All non-key fields in a dimension become attributes in the analytical model.
The annotation @Aggregation.default is not required in a dimension view unless you want to create a query on top of a dimension.
Note
If a text view is available, you should define a text association to the text view and add @ObjectModel.text.assocation referring this association to the representative key field. The ON condition of the association must include all key fields and the text view must have the same key fields.
If a text view doesn't exist but there is a text field already in the dimension view, you can add the annotation @Semantics.text: true to the text field and @ObjectModel.text.element to the representative key field.
If a hierarchy view exists, you should define an association to the hierarchy view and add the annotation @ObjectModel.association.toHierarchy: true to the association. If the hierarchy view is old style (defined via annotation @Hierarchy), you have to add the annotation @ObjectModel.hierarchy.association to the representative key field.
If the attributes are time-dependent, the dimension view needs additional date fields of type DATS or DATN. One of the date fields requires the annotation @Semantics.businessDate.to and it must be a key field. The other date field requires the annotation @Semantics.businessDate.from. The key field which is assigned the annotation @Semantics.businessDate.to must not be included in the ON condition of any foreign key association and it must not have a foreign key association
Here is the data preview of a dimension view for airports:

Here is the code that defines this dimension:
12345678910111213141516171819202122232425262728293031323334@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Airport'
@Analytics.dataCategory: #DIMENSION
@ObjectModel.representativeKey: 'AirportID'
@ObjectModel: {
supportedCapabilities: [ #ANALYTICAL_DIMENSION ],
modelingPattern: #ANALYTICAL_DIMENSION
}
define view entity /DMO/ANA_I_Airport
as select from /dmo/airport
association [0..1] to I_Country as _Country on _Country.Country = $projection.Country
association [0..1] to /DMO/ANA_I_City as _City on _City.country = $projection.Country
and _City.city = $projection.City
{
@ObjectModel.text.element: ['Name']
key airport_id as AirportID,
@Semantics.text: true
name as Name,
@ObjectModel.foreignKey.association: '_Country'
country as Country,
@ObjectModel.foreignKey.association: '_City'
city as City,
/* Associations */
_Country,
_City
}
Notice the associations for the dimension attributes country and city. These associations point to further dimension views to provide even more details for these two attributes. Defining associations in this way is how we develop a snowflake model.