Bug 454376 add -lCrun -lCstd for Solaris OS_LIBS, r=bsmedberg
[wine-gecko.git] / layout / doc / overview.html
blob8794ae5c32b4fe69b130b81ed56ccee24d09f21d
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
5 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
6 <title>Layout Documentation Overview</title>
7 </head>
8 <body>
10 <h1>Layout Documentation Overview</h1>
11 <blockquote> Authors: <br>
12 <ul>
13 <li>Marc Attinasi (attinasi@netscape.com)</li>
14 </ul>
15 History: <br>
16 <ul>
17 <li>12/17/2001 - created<br>
18 </li>
19 </ul>
20 </blockquote>
21 <h2>Background</h2>
22 The Layout module of Gecko has not been documented very well. This has lead
23 to some predictable problems: difficult maintenance, hard to get new people
24 involved in the module, problems assessing the risk of changes, hard to know
25 where bugs are likely to be in the source. &nbsp;One extreme result of the
26 lack of comprehensive has been an urge to rewrite some of the more impenetrable
27 parts of the layout component, the block and Line Layout areas. &nbsp;Rather
28 than throwing it all away and rewriting it, we have decided to put significant
29 effort into thoroughly documenting what we already have. this effort will
30 help us to understand what parts of the system we want to keep as-is, incrementally
31 revise, or wholesale rewrite. Additionally, we will make the code base more
32 accessible to new (and not-so-new) engineers.<br>
33 <br>
35 <h2>Strategy:</h2>
36 Documenting all of Block and Line layout is a large task, so it will be
37 divided up among knowledgeable and interested engineers. Progress will be
38 tracked in bugzilla <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=115310">
39 bug 115310</a>
40 . &nbsp;This document lays out the basic documentation scope and formatting
41 so that all of the individual contributions can be combined into a relatively
42 cohesive unit of linked documents. <br>
43 <br>
45 <h2>Scope:</h2>
46 The documentation will generally cover two levels of detail. There is room
47 for deviation from this as needed, but generally a High Level Design document
48 and a Detailed Design document will provide the necessary level of detail
49 for those trying to understand the system as a whole, and those trying to
50 get into the code.<br>
51 <br>
53 <h3>High Level Designs</h3>
54 High level designs provided an overview of the system being documented.
55 The general concept of the component is described, and the classes involved
56 are described briefly (no details of the class implementations). &nbsp;In
57 some cases the high level design vocabulary consists of other components
58 and not classes. &nbsp;The important thing is to describe the interactions
59 between the classes and/or components such that the reader gets an understanding
60 of which pieces talk to which other pieces, what kinds of data are shared
61 by various components or classes, how the data is modified and by whom, beginning
62 states and end states of a process, and external constraints or inputs into
63 the system begin described. <br>
64 <br>
65 A fundamental piece of the high-level design is the<b> data model</b>. This
66 is generally a graphical representation of the classes or components involved
67 in the system, showing the relationships between them in terms of has-a,
68 is-a, uses, owns, etc. the specific representation is not as important as
69 the content of the representation. For example, using UML or Booch notation
70 is fine, as is an ad-hoc diagram that shows the same types of information.<br>
71 <br>
72 Another important piece of the high-level design is a set of <b>use-cases</b>
73 that describe specific interaction that result from specific events in
74 the system. For example, we might want to show specifically what happens
75 when an attribute is changed on an element via the DOM. Use cases differ
76 from data models in that they show specific instances of objects or components,
77 actual data values where interesting or important, and often give a glimpse
78 into the algorithms employed. All of the components or objects in the use
79 cases must be documented in the data model.<br>
80 <b><br>
81 State Transition Diagrams</b> may be important to some systems, and they
82 should be documented in the high-level design as well. These should be described
83 in terms of the abstract states that the system may be in, not in terms of
84 how the state-machine is actually implemented.<br>
85 <br>
86 The high-level documents provide an overview of the components and classes
87 that make up a system. It can be used as a road map to the related detailed
88 design documents for the components and classes involved in the system. thus,
89 the classes, components, and algorithms referenced in the high-level design
90 document should be linked to the detailed design documents that correspond.
91 This link generally occurs at the first reference to the class or component,
92 but it can be provided in other contexts as well, for convenience to the reader.
93 &nbsp;Missing or invalid links are considered errors in the high-level design.
94 <br>
95 &nbsp;&nbsp; <br>
97 <h3>Detailed Designs</h3>
98 Detailed design documents provide specific information needed to implement
99 (or understand the implementation of) the components and classes described
100 in the high-level design. Users of the classes or components should also be
101 able to understand from the detailed design just how the classes, components
102 and API's are to be used. Special performance characteristics of methods or
103 interactions should be documented where pertinent.<br>
104 <br>
106 <h4>Public API</h4>
107 The public API of the component or class being documented is essential to
108 the detailed design. Each publicly accessible interface, method and data member
109 must be documented. Ideally this information is contained in the implementation
110 files for a class, interface or component. If this is the case, the actual
111 IDL or class header file can be used as the documentation for the public API.
112 This should be done as a link or embedded document to avoid the perpetual
113 need to keep the document up to date with the source file. &nbsp;Specific
114 items that are important to the description of the publicly available aspects
115 of the component, class, or interface include:<br>
117 <ul>
118 <li>entry-point semantics: what does the method do, or what does the data
119 member mean? Is the universe of expected clients limited or open (e.g.. who
120 can call it)?<br>
121 </li>
122 <li>preconditions: what are the legal states for the instance to be in
123 before the entry point is called? what are the legal values for the arguments?
124 what are the required states for the objects or components used in the entry-point?</li>
125 <li>postconditions: what is guaranteed when the entry-point is returned
126 from? what return values are legal? what is the status of the output arguments
127 for various return states?</li>
128 <li>special performance characteristics: if there are special concerns
129 about performance of the method, explain them. for example, is the method
130 O(n^2)? Is there considerable memory required? Is the method recursive?</li>
132 </ul>
133 Beyond the public interfaces, the private and protected methods need to
134 be documented as well. For protected methods and members, the expectations
135 of the subclasses must be made clear (e.g.. should the subclass call the
136 base class method? if so, when?) &nbsp;As with the public methods, the semantics,
137 preconditions, postconditions, and special performance considerations should
138 be described. Again, this may be by direct inclusion of the source code files
139 where appropriate.<br>
140 <br>
142 <h4>Algorithms</h4>
143 There is often a need to document specific algorithms used in methods and
144 functions. &nbsp;Generally, it is not a good idea to include this sort of
145 information in the source files, so they must be described fully in the detailed
146 design document. &nbsp;The extent of this information varies wildly from one
147 design to another. &nbsp;Be sure to include an Algorithms section to the
148 document when there are interesting or critical algorithms that the classes
149 or components employ. &nbsp;Spell out the algorithms in as much detail as
150 possible using pseudo-code or diagrams. Ideally, it should be possible to
151 implement the algorithm from the information in the design.<br>
152 <br>
153 <br>
154 Algorithms that involve several different components or object instances
155 require special attention. These algorithms tend to be more complex and more
156 difficult to completely specify. &nbsp;Start out by referring to the related
157 use cases in the high level design, and then drill down into the responsibilities
158 and requirements of the individual instances involved. &nbsp;Here, diagrams
159 and pseudo-code are indispensable in communicating how the algorithm is carried
160 out across the system.<br>
162 <h4></h4>
163 <h4> Tech Notes</h4>
164 The end of the detailed design document should contain a list of links to
165 Tech Notes. These will vary in depth and scope, but generally they provide
166 information geared toward helping developers work on the system. &nbsp;Tech
167 Notes might contain information about &nbsp;how code has been modified, how
168 a new feature was added, how to debug a certain class of problem, how to
169 use built-in debugging r logging facilities, or how to maintain or extend
170 unit tests. &nbsp;The Tech Notes should be stored in a publicly accessible
171 location, as a comment or attachment in a bugzilla bug, for example. &nbsp;The
172 text that holds the link should be descriptive of what the Tech Note addresses.<br>
173 <br>
175 </body>
176 </html>