User:Emre/tb/architecture/diagrams: Difference between revisions

 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
= About this work =
= About this work =
{{draft}}


The following is the UML diagrams of (some) major components of Thunderbird. I started this work to document and share my understanding of Thunderbird architecture while working on a threading bug. This is a work in progress and  
The following is the UML diagrams of (some) major components of Thunderbird. I started this work to document and share my understanding of Thunderbird architecture while working on a threading bug. This is a work in progress and  
Line 6: Line 7:
I use only the basic elements of UML, and try to keep it simple as much as possible. I deliberately use some elements non-normative way, don't expect a perfect UML diagram. You can find the description of the common elements in the [[User:Emre/tb/architecture/diagrams/legend | legend]].
I use only the basic elements of UML, and try to keep it simple as much as possible. I deliberately use some elements non-normative way, don't expect a perfect UML diagram. You can find the description of the common elements in the [[User:Emre/tb/architecture/diagrams/legend | legend]].


= Components =
Also see [http://doxygen.db48x.net/mozilla/html/classes.html Thunderbird Class Diagrams]


* <b>Incoming Server</b>
=== Major Thunderbird Entities ===
** Interface  
 
** Implementation
Currently, Thunderbird supports four different incoming (IMAP, POP3, NNTP, RSS) and one outgoing messaging protocols (SMTP). Each incoming protocol provides its own implementation (i.e. [http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/imap/static#nsImapProtocol imap protocol]).
 
Each message source (url+logininfo+protocol) is represented by an <code>Account</code> entity, and all accounts are managed by [http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/accountmanager <code>AccountManager</code>]. Each account has an associated [http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/messageincomingserver <code>IncomingServer</code>] that is implemented by the corresponding account [http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/imap/static#nsIImapIncomingServer <code>protocol</code>].
 
<code>Identity</code> contains all the personal outgoing mail information
for a given person. Although all account types can have multiple associated identities by design, RSS do not need this entity, as does any other account that does not interact with compose code.
 
<code>AddressBook</code> is the central repository of the user's contacts. Physical store of this entity is '''abook.mab''' file in the profile directory, and it is in [[Mork]] format.
''See [[MailNews:Address Book|Address Book Planning]] page for recent improvements.''
 
Thunderbird uses a folder-based hierarchical representation to organize messages. [http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/messagefolder <code>Folder</code>] is the logical entity that contains message contents belong to the same hierarchical level. Message content consists of message headers and message body including attachments. These two entities are stored in different physical stores to improve the system performance. Every <code>Account</code> has a root folder, which may have several subfolders (each potentially with their own subfolders, ad infinitum) which are actual folders on the hosting operating system. 
 
[http://wiki.mozilla.org/User:Emre/tb/architecture/diagrams/messagedatabase <code>Database</code>] entity represents the physical store of message. Each "Folder" (in the Thunderbird sense) which can contain messages is represented by two files (in the OS sense): the messages themselves (headers and bodies, in human-readable  [http://en.wikipedia.org/wiki/Mbox mbox] format) are in one file ("folder" name without extension), while a second file ('''msf''' file in '''[[Mork]]''' format) indexes them for fast access to a given message.
 
[[Image:Tb-system-overview.png | TB Class diagram ]]
 
= Core Components =
* <b> Address Book </b>
TBD
* <b>Message Incoming Server</b>
** [[User:Emre/tb/architecture/diagrams/messageincomingserver#Interface | interface]]
** [[User:Emre/tb/architecture/diagrams/messageincomingserver#Implementation | Implementation]]
* <b>Account Manager</b>
* <b>Account Manager</b>
** [[User:Emre/tb/architecture/diagrams/accountmanager | interface and implementation]]
** [[User:Emre/tb/architecture/diagrams/accountmanager#Interface | interface]]
** [[User:Emre/tb/architecture/diagrams/accountmanager#Implementation | implementation]]
* <b> Message Folder</b>
* <b> Message Folder</b>
** [[User:Emre/tb/architecture/diagrams/messagefolder | interface]]
** [[User:Emre/tb/architecture/diagrams/messagefolder | interface]]
* <b> Address Book </b>
** [[User:Emre/tb/architecture/diagrams/messagefolder#Message_DB_Folder | Implementation: Message Database Folder]]
* <b>Message Database</b>
** [[User:Emre/tb/architecture/diagrams/messagedatabase#Interface | interface]]
** [[User:Emre/tb/architecture/diagrams/messagedatabase#Implementation | implementation]]
*** [[User:Emre/tb/architecture/diagrams/messagedatabase#Per_Protocol | NewsDatabase, MailDatabase, ImapMailDatabase]]
* <b> Searching </b>
** [[User:Emre/tb/architecture/diagrams/messagesearch#Class_Diagram | Static View]]
** [[User:Emre/tb/architecture/diagrams/messagesearch#Offline_Search | Sequence diagram for offline search]]
** [[User:Emre/tb/architecture/diagrams/messagesearch#Online_Search | Sequence diagram for online search]]


= Protocol Implementation =
= Protocol Implementation =
* <b> IMAP </b>
* <b> IMAP </b>
** Sequence diagrams
** Sequence diagrams  
** nsImapIncomingServer class
***[[User:Emre/tb/architecture/diagrams/imap/sequence#System%20Startup | System Startup]]
** nsIImapIncomingServer class
***[[User:Emre/tb/architecture/diagrams/imap/sequence#System%20Shutdown | System Shutdown]]
** nsImapProtocol class
***[[User:Emre/tb/architecture/diagrams/imap/sequence#Get%20Mail%20Button%20clicked | 'Get Mail' button clicked]]
** nsIImapProtocol interface
***[[User:Emre/tb/architecture/diagrams/imap/sequence#OnBiffTimer | OnBiffTimer event]]
***[[User:Emre/tb/architecture/diagrams/imap/sequence#Connection%20Error | Connection Error case]]
***[[User:Emre/tb/architecture/diagrams/imap/sequence#Message%20Delete | Message Delete]]
***[[User:Emre/tb/architecture/diagrams/imap/sequence#New%20Message | New Message]]
** Class diagrams
*** [[User:Emre/tb/architecture/diagrams/imap/static#nsIImapIncomingServer | nsIImapIncomingServer interface]]
*** [[User:Emre/tb/architecture/diagrams/imap/static#nsImapIncomingServer | nsImapIncomingServer class]]
*** [[User:Emre/tb/architecture/diagrams/imap/static#nsIImapProtocol | nsIImapProtocol interface]]
*** [[User:Emre/tb/architecture/diagrams/imap/static#nsImapProtocol | nsImapProtocol class]]
 
* <b> POP3 </b>
* <b> POP3 </b>
** nsPop3IncomingServer
** nsPop3IncomingServer
** nsIPop3Protocol
** nsIPop3Protocol
** nsIPop3IncomingServer
** nsIPop3IncomingServer
**
 
* <b> NEWS </b>
* <b> NNTP </b>
** [[User:Emre/tb/architecture/diagrams/nntp/state | NNTP Implementation Notes]]
 
* <b> RSS </b>
* <b> RSS </b>
270

edits