AEA and Web Frameworks¶
The AEA framework borrows several concepts from popular web frameworks like Django and Ruby on Rails.
Both aforementioned web frameworks use the MVC (model-view-controller) architecture.
- Models: contain business logic and data representations
- View: contain the HTML templates
- Controller: deals with the request-response handling
Comparison with the AEA Framework¶
The AEA framework is based on asynchronous messaging and other agent-oriented development assumptions. Hence, there is not a direct one-to-one relationship between MVC based architectures and the AEA framework. Nevertheless, there are some parallels which can help a developer familiar with MVC make quick progress in the AEA framework, in particular the development of
Handler: receives messages for the protocol it is registered against and is supposed to handle these messages. Handlers are the reactive parts of a skill and can be thought of as similar to the
Controllerin MVC. They can also send new messages.
Behaviour: a behaviour encapsulates proactive components of the agent. Since web apps do not have any goals or intentions, they do not proactively pursue an objective. Therefore, there is no equivalent concept in MVC. Behaviours also can, but do not have to, send messages.
Task: they are meant to deal with long-running executions and can be thought of as the equivalent of background tasks in traditional web apps.
Model: they implement business logic and data representation, and as such, they are similar to the
View concept is probably best compared to the
Message of a given
Protocol in the AEA framework. Whilst views represent information to the client, messages represent information sent to other agents, other agent components and services.
We recommend you continue with the next step in the 'Getting Started' series: