Architecture
Introduction
Diagrams and short description of few Aida internals.
Figure: Aida/Web application
![Aida app layers Aida app layers](2012/02-07/Architecture-v8/architecture-layers.png)
Figure: Aida application layers
Request path
Figure: Web request path
Ok, let we start with a web request path in an Aida app from tutorial, to the anAddressBook therefore:
- Swazoo web server opens a connection and receives a request
- it finds a proper AIDASite and calls its answerTo: metho user's session is found (from a cookie) or created
- request is now routed to the right domain object for that URL domain object is asked for it's presenter
- presenter is returned or created, an instance of AddressBookApp in our case,
- presenter is asked to represent itself as a web page
- a composite web page (like a DOM tree) is composed
- streaming as HTML to the web response of web page is the last step.
To step through that sequence you can put a breakpoint in AidaSite>>answerTo: . then open object's URL. Some more intereting objects and methods to wach through that journey (Aida 6.5!):
AIDASite answerTo: aRequest
WebSessionManager findOrCreateSessionFor: aRequest
WebRouter resourceFor: aRequest
URLResolver resourceFor: aRequest
URLResolver objectOnUrl: url
AIDASite answer: anObject to: aRequest on: aSession
AIDASite answer: anObject toGetOrPost: aRequest on: aSession
AddressBook(Object) aidaPresenterFor: aRequest on: aSession
AddressBook(Object) aidaWebAppFor: aSession
WebApplication newFor: anObject on: aSession
AdressBookApp(WebApplication) composeWebPageFor: aRequest
AdressBookApp(WebApplication) composeWebPageStepTwoFor: aRequest
AdressBookApp(WebApplication) composeWebView:aViewSymbol for:aReq
AddressBookApp class viewMethodForView: aViewSymbol
AddressBookApp perform: method
AIDASite addResponseHeadersTo: response forPage: presenter on:..
AddressBookApp streamHtmlTo: aStream for: aRequest on: aSession
WebPage streamHtmlTo: aStream for: aRequest on: aSession
WebWindow streamHtmlTo: aStream for: aRequest on: aSession
WebWidget streamHtmlTo: aStream for: aRequest on: aSession
etc... recursively down to all composition
MVC in Aida
Figure: MVC on a Web
![MVC implementation in Aida MVC implementation in Aida](2012/02-07/Architecture-v9/mvc.png)
Figure: MVC implementation in Aida
Tree-like Control Flow
![Graph and Tree-like control flow combined Graph and Tree-like control flow combined](2012/02-07/Architecture-v11/graph-tree-like-navigation.png)
Figure: Graph and Tree-like control flow combined
![Page composition possibilities Page composition possibilities](2012/02-07/Architecture-v12/page-composition-possibilities.png)
Figure: Page composition possibilities
![Web Contexts Web Contexts](2012/02-07/Architecture-v11/context-popup.png)
Figure: Web contexts and popup windows
![Web Contexts for Tree-like Control Flow Web Contexts for Tree-like Control Flow](2012/02-07/Architecture-v11/context-tree-like-control-flow.png)
Figure: Web Contexts for Tree-like Control Flow