wiring
project-build-environment grammar version 41
model | 105 | application |
---|---|---|
interface | 20 | interface |
auto-webclient | xindi.1 | generator_settings |
generator_annotations | ||
phrases | ||
query | ||
translations | ||
parameters | ||
connector | 36.5 | processor |
variables | ||
datastore | 113 | consumed_interfaces_mapping |
provided_interface_implementation | ||
migration_mapping | ||
regular_expression_engine | ||
relational-database-bridge | 109 | database |
database_transformation | ||
sql-mirror | 109.1 | sql_mapping |
webclient | xindi.1.1 | views |
widget | ||
client bindings | ||
gui_model | ||
phrases | ||
translations | ||
settings | ||
parameters | ||
project-build-environment | 41 | wiring |
deployment |
The minimal wiring
Every Alan project needs a wiring
.
The minimal wiring for a single Alan application with client, server, and authentication is
interfaces
models
'model'
external-systems
systems
'server': 'datastore'
project / (
'interfaces' / (
'providing' / ( )
'consuming' / ( )
)
'model' = provide 'model'
)
'sessions': 'session-manager'
project / (
'model' = bind 'server'::'authenticate'
)
'client': 'auto-webclient'
project / (
'model' = consume 'server'/'model'
)
provided-connections
'auth' = 'sessions'::'http'
'client' = 'client'::'http'
Wiring
The wiring describes which components make up the Alan project, and how they interact with each other.
Interfaces
If your application consumes data from, or provide data to another application, you need an Alan interface
.
In the interfaces
section of the wiring, you list the names of the interface
s.
For each item in the list, you need a file interfaces/<name>/interface.alan
in your project, which specifies the interface.
'interfaces': [ interfaces ] dictionary { }
Models
An Alan project typically has one Alan application
model, but projects can have multiple application
models.
For each item in the models
section, you need a corresponding file models/<name>/application.alan
in your project.
'models': [ models ] dictionary { }
External Systems
If your application consumes data from external sources, you need to specify the types of these sources. The type of an external source must be one of:
interface
when the data conforms to an Alaninterface
,model
when the data conforms to an Alanapplication
model, or- when a custom protocol is used: the name of the protocol.
'external systems': [ external-systems ] dictionary {
'is dynamic mapping': [ : ] stategroup (
'yes' { [ dynamic ] }
'no' { }
)
'type': stategroup (
'library' {
'binding': stategroup (
'interface' {
'interface': [ interface ] reference
}
'model' {
'model': [ model ] reference
}
)
}
'protocol' {
'type': text
'binding': stategroup (
'interface' {
'interface': [ bind interface ] reference
}
'model' {
'model': [ bind model ] reference
}
'none' { }
)
}
)
}
Internal Systems
The internal systems
are the active components of your Alan project.
Each system is an instance of a System Type, which defines the structure of the connection mapping.
The mapping of a system is divided into two mappings.
- the
project
mapping, which follows the project structure of the System Type - the
consume
mapping, which is a list of additional connection of the System Type
Whether a mapping is required, depends on the System Type. The compiler can tell you which one(s) you need.
'systems': [ systems ] dictionary {
'has more systems': stategroup = node-switch successor (
| node = 'yes' { 'next' = successor }
| none = 'no'
)
'system type': [ : ] reference
/* the libraries mapping */
'map libraries': stategroup (
'yes' { [ project ]
'mapping': component 'library mapping'
}
'no' { }
)
/* the consumed connections mapping */
'map connections': stategroup (
'yes' { [ consume ]
'connections': [ (, ) ] dictionary {
'target': [ = ] component 'provider selector'
}
}
'no' { }
)
}
Provided Connections
The provided-connections
section describes which parts of your systems can be accessed from the outside world.
'provided connections': [ provided-connections ] dictionary {
'system': [ = ] reference
'type': stategroup (
'library' {
'library': component 'library selector'
}
'connection' {
'connection': [ :: ] reference
}
)
}
Components
'library mapping' {
'step': stategroup (
'directory mapping' {
'type': [ / (, ) ] stategroup (
'static mapping' {
'children': dictionary {
'mapping': component 'library mapping'
}
}
'dynamic mapping' {
'entries': dictionary { [ [ ]
'mapping': [ ] ] component 'library mapping'
}
}
)
}
'library mapping' {
'type': [ = ] stategroup (
'provide' { [ provide ]
'library': reference
}
'consume' { [ consume ]
'target': component 'provider selection'
}
'bind' { [ bind ]
'target': component 'provider selection'
}
)
}
)
}
'library selector' {
'has step': stategroup (
'yes' {
'step': [ / ] reference
'tail': component 'library selector'
}
'no' { }
)
}
'provider selector' {
'target': stategroup (
'external' { [ external ]
'system': reference
}
'internal connection' {
'system': reference
'connection': [ :: ] reference
}
'internal library' {
'system': reference
'library': component 'library selector'
}
)
}
'provider selection' {
'select': stategroup (
'single' {
'target': component 'provider selector'
}
'multiple' {
'system': [ dynamic external ] reference
}
)
}