-
Notifications
You must be signed in to change notification settings - Fork 28
Architecture
This overview represents the stand of Espresso on 12.11.2010

This section is a description of the parts used in Espresso, shown in the image above. Help to understand the architecture image.
File
File is the representation of single resource in a Framework. This could be a JavaScript file, a image or a CSS file. Each file is a JavaScript object representation of such a resource. File contains all needed information of the resource like: name, path inside the framework folder or the content, the raw data. Files are organized in a Framework.
Framework
A Framework is the JavaScript object representation of a collection of File objects. A typically Framework would be "The-M-Project" core data or the application that is implemented with it. A Framework is responsible for loading all files, that belongs to this framework. Each Framework contains information of how to build its files. This information is shipped over from the App object which the Framework belongs to.
App
App is Espresso´s core component. App holds all information about the "The-M-Project" application that is build via Espresso. Containing properties of the application and to control the build itself. App takes care of the build process by hooking in the needed resources (Frameworks and Files) and calling build on each resource(s).
For doing all this cool stuff, App needs some data/information to work with. Those thinks are implemented in extra components. App can contain multiple references to Framework (e.g. The-M-Project core files or the application itself). By loading new Frameworks, App is adding a defined task chain to each Framework. The task chain is prepared by the TaskManager.
TaskManager
The TaskManager is responsible for building a chain of tasks specified in a config file. The TaskManager queues the tasks up, and takes care of the task execution chain. Which means hooking up the Tasks, so they can execute themselves and pass the result to next Task.
Task
A Task is the implementation of a concrete task to be executed on the files of a framework. The Task component is the prototype of each task. When implementing a concrete Task they have to use this component as prototype. The important run() function is specified here.
Examples:
- JSLINT check
- Minify
- Merge files
Server
Server ist the build-in testing server, to run and test the application. The Server has a link to the App, so the server is aware of the application he serves. The Server is holding the application in its memory, so there is no need for the sever to read the files from the files system. The Server can serves as a proxy to test remote service calls. For that reason, the server holds several Proxy objects.
Proxy
Every Proxy object belongs to one Server. A Proxy object contains all information about a proxy entry.
Properties:
-
baseUrl: the complete url with with port, e.g. 'http://example.com:8000' -
proxyAlias: the alias for a remote service, used in the application code.