Line 0
Link Here
|
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [ |
3 |
<!ENTITY api-questions SYSTEM "../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml"> |
4 |
]> |
5 |
|
6 |
<api-answers |
7 |
question-version="1.29" |
8 |
author="jhavlin@netbeans.org" |
9 |
> |
10 |
<!-- This file was based on arch.xml file in module openide.io. --> |
11 |
|
12 |
&api-questions; |
13 |
|
14 |
|
15 |
<!-- |
16 |
<question id="arch-overall" when="init"> |
17 |
Describe the overall architecture. |
18 |
<hint> |
19 |
What will be API for |
20 |
<a href="http://wiki.netbeans.org/API_Design#Separate_API_for_clients_from_support_API"> |
21 |
clients and what support API</a>? |
22 |
What parts will be pluggable? |
23 |
How will plug-ins be registered? Please use <code><api type="export"/></code> |
24 |
to describe your general APIs and specify their |
25 |
<a href="http://wiki.netbeans.org/API_Stability#Private"> |
26 |
stability categories</a>. |
27 |
If possible please provide simple diagrams. |
28 |
</hint> |
29 |
</question> |
30 |
--> |
31 |
<answer id="arch-overall"> |
32 |
<api |
33 |
name="NbInputOutputAPI" |
34 |
group="java" |
35 |
type="export" |
36 |
category="official" |
37 |
url="@org-netbeans-api-io@/org/netbeans/api/io/package-summary.html" |
38 |
> |
39 |
<p> |
40 |
The module contains APIs for creating output panes (e.g. output tabs in Output Window in the IDE) |
41 |
and for writing data into them. It also supports some advanced techniques, e.g. color text, |
42 |
hyperlinks, code folding, scrolling to stored positions. |
43 |
</p> |
44 |
</api> |
45 |
<api |
46 |
name="NbInputOutputSPI" |
47 |
group="java" |
48 |
type="export" |
49 |
category="official" |
50 |
url="@org-netbeans-api-io@/org/netbeans/spi/io/package-summary.html" |
51 |
> |
52 |
<p> |
53 |
SPI for providing custom implementations of output window is also included in this module, in package |
54 |
<code>org.netbeans.spi.io</code> |
55 |
</p> |
56 |
</api> |
57 |
</answer> |
58 |
|
59 |
|
60 |
|
61 |
<!-- |
62 |
<question id="arch-quality" when="init"> |
63 |
How will the <a href="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> |
64 |
of your code be tested and |
65 |
how are future regressions going to be prevented? |
66 |
<hint> |
67 |
What kind of testing do |
68 |
you want to use? How much functionality, in which areas, |
69 |
should be covered by the tests? How you find out that your |
70 |
project was successful? |
71 |
</hint> |
72 |
</question> |
73 |
--> |
74 |
<answer id="arch-quality"> |
75 |
<p> |
76 |
Unit test will be prepared for invocable code in API classes. But most of the |
77 |
code is just definition of API and SPI. |
78 |
</p> |
79 |
</answer> |
80 |
|
81 |
|
82 |
|
83 |
<!-- |
84 |
<question id="arch-time" when="init"> |
85 |
What are the time estimates of the work? |
86 |
<hint> |
87 |
Please express your estimates of how long the design, implementation, |
88 |
stabilization are likely to last. How many people will be needed to |
89 |
implement this and what is the expected milestone by which the work should be |
90 |
ready? |
91 |
</hint> |
92 |
</question> |
93 |
--> |
94 |
<answer id="arch-time"> |
95 |
<p> |
96 |
The design, implementation, preparing unit tests and reviews will |
97 |
probably take several weeks. |
98 |
</p> |
99 |
</answer> |
100 |
|
101 |
|
102 |
|
103 |
<!-- |
104 |
<question id="arch-usecases" when="init"> |
105 |
<hint> |
106 |
Content of this answer will be displayed as part of page at |
107 |
http://www.netbeans.org/download/dev/javadoc/usecases.html |
108 |
You can use tags <usecase name="name> regular html description </usecase> |
109 |
and if you want to use an URL you can prefix if with @TOP@ to begin |
110 |
at the root of your javadoc |
111 |
</hint> |
112 |
|
113 |
Describe the main <a href="http://wiki.netbeans.org/API_Design#The_Importance_of_Being_Use_Case_Oriented"> |
114 |
use cases</a> of the new API. Who will use it under |
115 |
what circumstances? What kind of code would typically need to be written |
116 |
to use the module? |
117 |
</question> |
118 |
--> |
119 |
<answer id="arch-usecases"> |
120 |
|
121 |
<usecase id="print" name="Print a simple output to a new output tab"> |
122 |
<p> |
123 |
The basic use-case is printing a simple text, e.g. text output of an application, |
124 |
into a dedicated pane in the UI, e.g. a tab in Output Window in the IDE. |
125 |
</p> |
126 |
<pre> |
127 |
InputOutput io = InputOutput.get("UseCase1", true); |
128 |
io.getOut().println("This is a simple output"); |
129 |
io.getOut().close(); |
130 |
</pre> |
131 |
</usecase> |
132 |
|
133 |
<usecase id="printOnClickHyperlink" name="Print a line with hyperlink for invocation of arbitrary code"> |
134 |
<p> |
135 |
Hyperlinks can be also used to invoke some code when clicked. |
136 |
</p> |
137 |
<pre> |
138 |
InputOutput io = InputOutput.get("UseCase3", true); |
139 |
io.getOut().print("A line containing a "); |
140 |
io.getOut().print("hyperlink", Hyperlink.from(new Runnable() { |
141 |
public void run() { |
142 |
System.gc(); |
143 |
} |
144 |
})); |
145 |
io.getOut().println(" for invocation of custom code."); |
146 |
io.getOut().close(); |
147 |
</pre> |
148 |
</usecase> |
149 |
|
150 |
<usecase id="printColor" name="Print color text"> |
151 |
<p> |
152 |
Print a color text. Users can select a predefined color for |
153 |
common cases (debug, warning, failure, success), or custom |
154 |
color specified as RGB value. |
155 |
</p> |
156 |
<pre> |
157 |
InputOutput io = InputOutput.get("UseCase4", true); |
158 |
io.getOut().println("Let's print some info", OutputColor.debug()); |
159 |
io.getOut().println("or warning with appropriate color", OutputColor.warning()); |
160 |
io.getOut().println("Maybe also text with custom reddish color", OutputColor.rgb(255, 16, 16)); |
161 |
io.getOut().close(); |
162 |
</pre> |
163 |
</usecase> |
164 |
|
165 |
<usecase id="printAndReset" name="Reset an InputOutput to clear all previosly printed text"> |
166 |
<p> |
167 |
It is possible to reuse already created output pane and clear |
168 |
all the previously printed text if it is not needed any more. |
169 |
</p> |
170 |
<pre> |
171 |
InputOutput io = InputOutput.get("UseCase5", true); |
172 |
io.getOut().println("Let's print some text"); |
173 |
io.getErr().println("and reset the pane immediately."); |
174 |
io.reset(); |
175 |
io.getOut().println("The pane is now empty and we can reuse it simply"); |
176 |
io.getOut().close(); |
177 |
</pre> |
178 |
</usecase> |
179 |
|
180 |
</answer> |
181 |
|
182 |
|
183 |
|
184 |
<!-- |
185 |
<question id="arch-what" when="init"> |
186 |
What is this project good for? |
187 |
<hint> |
188 |
Please provide here a few lines describing the project, |
189 |
what problem it should solve, provide links to documentation, |
190 |
specifications, etc. |
191 |
</hint> |
192 |
</question> |
193 |
--> |
194 |
<answer id="arch-what"> |
195 |
<p> |
196 |
The Input/Output API and SPI is a small module |
197 |
which contains <code>InputOutput</code> and related interfaces used in |
198 |
driving the Output Window. |
199 |
</p> |
200 |
<p> |
201 |
The normal implementation is <code>org.netbeans.core.output2</code>. |
202 |
</p> |
203 |
</answer> |
204 |
|
205 |
|
206 |
|
207 |
<!-- |
208 |
<question id="arch-where" when="impl"> |
209 |
Where one can find sources for your module? |
210 |
<hint> |
211 |
Please provide link to the Hg web client at |
212 |
http://hg.netbeans.org/ |
213 |
or just use tag defaultanswer generate='here' |
214 |
</hint> |
215 |
</question> |
216 |
--> |
217 |
<answer id="arch-where"> |
218 |
<defaultanswer generate='here' /> |
219 |
</answer> |
220 |
|
221 |
|
222 |
|
223 |
<!-- |
224 |
<question id="compat-deprecation" when="init"> |
225 |
How the introduction of your project influences functionality |
226 |
provided by previous version of the product? |
227 |
<hint> |
228 |
If you are planning to deprecate/remove/change any existing APIs, |
229 |
list them here accompanied with the reason explaining why you |
230 |
are doing so. |
231 |
</hint> |
232 |
</question> |
233 |
--> |
234 |
<answer id="compat-deprecation"> |
235 |
<p> |
236 |
Backward compatibility of other modules is not broken. |
237 |
</p> |
238 |
<p> |
239 |
This module should replace original I/O API module |
240 |
<code>org.openide.io</code>, which has the same goals, but which is |
241 |
not UI independent, and which is difficult to extend. |
242 |
</p> |
243 |
</answer> |
244 |
|
245 |
|
246 |
|
247 |
<!-- |
248 |
<question id="compat-i18n" when="impl"> |
249 |
Is your module correctly internationalized? |
250 |
<hint> |
251 |
Correct internationalization means that it obeys instructions |
252 |
at <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> |
253 |
NetBeans I18N pages</a>. |
254 |
</hint> |
255 |
</question> |
256 |
--> |
257 |
<answer id="compat-i18n"> |
258 |
<p> |
259 |
Yes. There is not much to internationalize. |
260 |
</p> |
261 |
</answer> |
262 |
|
263 |
|
264 |
|
265 |
<!-- |
266 |
<question id="compat-standards" when="init"> |
267 |
Does the module implement or define any standards? Is the |
268 |
implementation exact or does it deviate somehow? |
269 |
</question> |
270 |
--> |
271 |
<answer id="compat-standards"> |
272 |
<p> |
273 |
The module defines an API. |
274 |
</p> |
275 |
</answer> |
276 |
|
277 |
|
278 |
|
279 |
<!-- |
280 |
<question id="compat-version" when="impl"> |
281 |
Can your module coexist with earlier and future |
282 |
versions of itself? Can you correctly read all old settings? Will future |
283 |
versions be able to read your current settings? Can you read |
284 |
or politely ignore settings stored by a future version? |
285 |
|
286 |
<hint> |
287 |
Very helpful for reading settings is to store version number |
288 |
there, so future versions can decide whether how to read/convert |
289 |
the settings and older versions can ignore the new ones. |
290 |
</hint> |
291 |
</question> |
292 |
--> |
293 |
<answer id="compat-version"> |
294 |
<p> |
295 |
N/A. No settings are read or written by this module. |
296 |
</p> |
297 |
</answer> |
298 |
|
299 |
|
300 |
|
301 |
<!-- |
302 |
<question id="dep-jre" when="final"> |
303 |
Which version of JRE do you need (1.2, 1.3, 1.4, etc.)? |
304 |
<hint> |
305 |
It is expected that if your module runs on 1.x that it will run |
306 |
on 1.x+1 if no, state that please. Also describe here cases where |
307 |
you run different code on different versions of JRE and why. |
308 |
</hint> |
309 |
</question> |
310 |
--> |
311 |
<answer id="dep-jre"> |
312 |
1.7 |
313 |
</answer> |
314 |
|
315 |
|
316 |
|
317 |
<!-- |
318 |
<question id="dep-jrejdk" when="final"> |
319 |
Do you require the JDK or is the JRE enough? |
320 |
</question> |
321 |
--> |
322 |
<answer id="dep-jrejdk"> |
323 |
JRE |
324 |
</answer> |
325 |
|
326 |
|
327 |
|
328 |
<!-- |
329 |
<question id="dep-nb" when="init"> |
330 |
What other NetBeans projects and modules does this one depend on? |
331 |
<hint> |
332 |
Depending on other NetBeans projects influnces the ability of |
333 |
users of your work to customize their own branded version of |
334 |
NetBeans by enabling and disabling some modules. Too |
335 |
much dependencies restrict this kind of customization. If that |
336 |
is your case, then you may want to split your functionality into |
337 |
pieces of autoload, eager and regular modules which can be |
338 |
enabled independently. Usually the answer to this question |
339 |
is generated from your <code>project.xml</code> file, but |
340 |
if it is not guessed correctly, you can suppress it by |
341 |
specifying <defaultanswer generate="none"/> and |
342 |
write here your own. Please describe such projects as imported APIs using |
343 |
the <code><api name="identification" type="import or export" category="stable" url="where is the description" /></code>. |
344 |
By doing this information gets listed in the summary page of your |
345 |
javadoc. |
346 |
</hint> |
347 |
</question> |
348 |
--> |
349 |
<answer id="dep-nb"> |
350 |
<defaultanswer generate='here' /> |
351 |
</answer> |
352 |
|
353 |
|
354 |
|
355 |
<!-- |
356 |
<question id="dep-non-nb" when="init"> |
357 |
What other projects outside NetBeans does this one depend on? |
358 |
|
359 |
<hint> |
360 |
Depending on 3rd party libraries is always problematic, |
361 |
especially if they are not open source, as that complicates |
362 |
the licensing scheme of NetBeans. Please enumerate your |
363 |
external dependencies here, so it is correctly understood since |
364 |
the begining what are the legal implications of your project. |
365 |
Also please note that |
366 |
some non-NetBeans projects are packaged as NetBeans modules |
367 |
(see <a href="http://libs.netbeans.org/">libraries</a>) and |
368 |
it is preferred to use this approach when more modules may |
369 |
depend and share such third-party libraries. |
370 |
</hint> |
371 |
</question> |
372 |
--> |
373 |
<answer id="dep-non-nb"> |
374 |
None. |
375 |
</answer> |
376 |
|
377 |
|
378 |
|
379 |
<!-- |
380 |
<question id="dep-platform" when="init"> |
381 |
On which platforms does your module run? Does it run in the same |
382 |
way on each? |
383 |
<hint> |
384 |
If you plan any dependency on OS or any usage of native code, |
385 |
please describe why you are doing so and describe how you envision |
386 |
to enforce the portability of your code. |
387 |
Please note that there is a support for <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-os-specific">OS conditionally |
388 |
enabled modules</a> which together with autoload/eager modules |
389 |
can allow you to enable to provide the best OS aware support |
390 |
on certain OSes while providing compatibility bridge on the not |
391 |
supported ones. |
392 |
Also please list the supported |
393 |
OSes/HW platforms and mentioned the lovest version of JDK required |
394 |
for your project to run on. Also state whether JRE is enough or |
395 |
you really need JDK. |
396 |
</hint> |
397 |
</question> |
398 |
--> |
399 |
<answer id="dep-platform"> |
400 |
Any. |
401 |
</answer> |
402 |
|
403 |
|
404 |
|
405 |
<!-- |
406 |
<question id="deploy-dependencies" when="final"> |
407 |
What do other modules need to do to declare a dependency on this one, |
408 |
in addition to or instead of the normal module dependency declaration |
409 |
(e.g. tokens to require)? |
410 |
<hint> |
411 |
Provide a sample of the actual lines you would add to a module manifest |
412 |
to declare a dependency, for example OpenIDE-Module-Requires: some.token. |
413 |
If other modules should not depend on this module, or should just use a |
414 |
simple regular module dependency, you can just answer "nothing". If you |
415 |
intentionally expose a semistable API to clients using implementation |
416 |
dependencies, you should mention that here (but there is no need to give |
417 |
an example of usage). |
418 |
</hint> |
419 |
</question> |
420 |
--> |
421 |
<answer id="deploy-dependencies"> |
422 |
<p> |
423 |
Normal module dependency is enough. |
424 |
</p> |
425 |
<p> |
426 |
Availability of some implementation of the SPI is guaranteed by |
427 |
"OpenIDE-Module-Needs: org.netbeans.spi.io.InputOutputProvider" in |
428 |
the manifest of this module. |
429 |
</p> |
430 |
</answer> |
431 |
|
432 |
|
433 |
|
434 |
<!-- |
435 |
<question id="deploy-jar" when="impl"> |
436 |
Do you deploy just module JAR file(s) or other files as well? |
437 |
<hint> |
438 |
Usually a module consist of one JAR file (perhaps with Class-Path |
439 |
extensions) and also a configuration file that enables it. If you |
440 |
have any other files, use |
441 |
<api group="java.io.File" name="yourname" type="export" category="friend">...</api> |
442 |
to define the location, name and stability of your files (of course |
443 |
changing "yourname" and "friend" to suit your needs). |
444 |
|
445 |
If it uses more than one JAR, describe where they are located, how |
446 |
they refer to each other. |
447 |
If it consist of module JAR(s) and other files, please describe |
448 |
what is their purpose, why other files are necessary. Please |
449 |
make sure that installation/uninstallation leaves the system |
450 |
in state as it was before installation. |
451 |
</hint> |
452 |
</question> |
453 |
--> |
454 |
<answer id="deploy-jar"> |
455 |
<p> |
456 |
Just the module JAR. |
457 |
</p> |
458 |
</answer> |
459 |
|
460 |
|
461 |
|
462 |
<!-- |
463 |
<question id="deploy-nbm" when="impl"> |
464 |
Can you deploy an NBM via the Update Center? |
465 |
<hint> |
466 |
If not why? |
467 |
</hint> |
468 |
</question> |
469 |
--> |
470 |
<answer id="deploy-nbm"> |
471 |
<p> |
472 |
Yes. |
473 |
</p> |
474 |
</answer> |
475 |
|
476 |
|
477 |
|
478 |
<!-- |
479 |
<question id="deploy-packages" when="init"> |
480 |
Are packages of your module made inaccessible by not declaring them |
481 |
public? |
482 |
|
483 |
<hint> |
484 |
By default NetBeans build harness treats all packages are private. |
485 |
If you export some of them - either as public or friend packages, |
486 |
you should have a reason. If the reason is described elsewhere |
487 |
in this document, you can ignore this question. |
488 |
</hint> |
489 |
</question> |
490 |
--> |
491 |
<answer id="deploy-packages"> |
492 |
<p> |
493 |
No; only API classes are public. |
494 |
</p> |
495 |
</answer> |
496 |
|
497 |
|
498 |
|
499 |
<!-- |
500 |
<question id="deploy-shared" when="final"> |
501 |
Do you need to be installed in the shared location only, or in the user directory only, |
502 |
or can your module be installed anywhere? |
503 |
<hint> |
504 |
Installation location shall not matter, if it does explain why. |
505 |
Consider also whether <code>InstalledFileLocator</code> can help. |
506 |
</hint> |
507 |
</question> |
508 |
--> |
509 |
<answer id="deploy-shared"> |
510 |
<p> |
511 |
Anywhere. |
512 |
</p> |
513 |
</answer> |
514 |
|
515 |
|
516 |
|
517 |
<!-- |
518 |
<question id="exec-ant-tasks" when="impl"> |
519 |
Do you define or register any ant tasks that other can use? |
520 |
|
521 |
<hint> |
522 |
If you provide an ant task that users can use, you need to be very |
523 |
careful about its syntax and behaviour, as it most likely forms an |
524 |
API for end users and as there is a lot of end users, their reaction |
525 |
when such API gets broken can be pretty strong. |
526 |
</hint> |
527 |
</question> |
528 |
--> |
529 |
<answer id="exec-ant-tasks"> |
530 |
<p> |
531 |
No. |
532 |
</p> |
533 |
</answer> |
534 |
|
535 |
|
536 |
|
537 |
<!-- |
538 |
<question id="exec-classloader" when="impl"> |
539 |
Does your code create its own class loader(s)? |
540 |
<hint> |
541 |
A bit unusual. Please explain why and what for. |
542 |
</hint> |
543 |
</question> |
544 |
--> |
545 |
<answer id="exec-classloader"> |
546 |
<p> |
547 |
No. |
548 |
</p> |
549 |
</answer> |
550 |
|
551 |
|
552 |
|
553 |
<!-- |
554 |
<question id="exec-component" when="impl"> |
555 |
Is execution of your code influenced by any (string) property |
556 |
of any of your components? |
557 |
|
558 |
<hint> |
559 |
Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code> |
560 |
or <code>PropertyDescriptor.getValue</code>, etc. are used to influence |
561 |
a behavior of some code. This of course forms an interface that should |
562 |
be documented. Also if one depends on some interface that an object |
563 |
implements (<code>component instanceof Runnable</code>) that forms an |
564 |
API as well. |
565 |
</hint> |
566 |
</question> |
567 |
--> |
568 |
<answer id="exec-component"> |
569 |
<p> |
570 |
No. |
571 |
</p> |
572 |
</answer> |
573 |
|
574 |
|
575 |
|
576 |
<!-- |
577 |
<question id="exec-introspection" when="impl"> |
578 |
Does your module use any kind of runtime type information (<code>instanceof</code>, |
579 |
work with <code>java.lang.Class</code>, etc.)? |
580 |
<hint> |
581 |
Check for cases when you have an object of type A and you also |
582 |
expect it to (possibly) be of type B and do some special action. That |
583 |
should be documented. The same applies on operations in meta-level |
584 |
(Class.isInstance(...), Class.isAssignableFrom(...), etc.). |
585 |
</hint> |
586 |
</question> |
587 |
--> |
588 |
<answer id="exec-introspection"> |
589 |
<p> |
590 |
No. |
591 |
</p> |
592 |
</answer> |
593 |
|
594 |
|
595 |
|
596 |
<!-- |
597 |
<question id="exec-privateaccess" when="final"> |
598 |
Are you aware of any other parts of the system calling some of |
599 |
your methods by reflection? |
600 |
<hint> |
601 |
If so, describe the "contract" as an API. Likely private or friend one, but |
602 |
still API and consider rewrite of it. |
603 |
</hint> |
604 |
</question> |
605 |
--> |
606 |
<answer id="exec-privateaccess"> |
607 |
<p> |
608 |
No. |
609 |
</p> |
610 |
</answer> |
611 |
|
612 |
|
613 |
|
614 |
<!-- |
615 |
<question id="exec-process" when="impl"> |
616 |
Do you execute an external process from your module? How do you ensure |
617 |
that the result is the same on different platforms? Do you parse output? |
618 |
Do you depend on result code? |
619 |
<hint> |
620 |
If you feed an input, parse the output please declare that as an API. |
621 |
</hint> |
622 |
</question> |
623 |
--> |
624 |
<answer id="exec-process"> |
625 |
<p> |
626 |
No. |
627 |
</p> |
628 |
</answer> |
629 |
|
630 |
|
631 |
|
632 |
<!-- |
633 |
<question id="exec-property" when="impl"> |
634 |
Is execution of your code influenced by any environment or |
635 |
Java system (<code>System.getProperty</code>) property? |
636 |
On a similar note, is there something interesting that you |
637 |
pass to <code>java.util.logging.Logger</code>? Or do you observe |
638 |
what others log? |
639 |
<hint> |
640 |
If there is a property that can change the behavior of your |
641 |
code, somebody will likely use it. You should describe what it does |
642 |
and the <a href="http://wiki.netbeans.org/API_Stability">stability category</a> |
643 |
of this API. You may use |
644 |
<pre> |
645 |
<api type="export" group="property" name="id" category="private" url="http://..."> |
646 |
description of the property, where it is used, what it influence, etc. |
647 |
</api> |
648 |
</pre> |
649 |
</hint> |
650 |
</question> |
651 |
--> |
652 |
<answer id="exec-property"> |
653 |
<p> |
654 |
No. |
655 |
</p> |
656 |
</answer> |
657 |
|
658 |
|
659 |
|
660 |
<!-- |
661 |
<question id="exec-reflection" when="impl"> |
662 |
Does your code use Java Reflection to execute other code? |
663 |
<hint> |
664 |
This usually indicates a missing or insufficient API in the other |
665 |
part of the system. If the other side is not aware of your dependency |
666 |
this contract can be easily broken. |
667 |
</hint> |
668 |
</question> |
669 |
--> |
670 |
<answer id="exec-reflection"> |
671 |
<p> |
672 |
No. |
673 |
</p> |
674 |
</answer> |
675 |
|
676 |
|
677 |
|
678 |
<!-- |
679 |
<question id="exec-threading" when="init"> |
680 |
What threading models, if any, does your module adhere to? How the |
681 |
project behaves with respect to threading? |
682 |
<hint> |
683 |
Is your API threadsafe? Can it be accessed from any threads or |
684 |
just from some dedicated ones? Any special relation to AWT and |
685 |
its Event Dispatch thread? Also |
686 |
if your module calls foreign APIs which have a specific threading model, |
687 |
indicate how you comply with the requirements for multithreaded access |
688 |
(synchronization, mutexes, etc.) applicable to those APIs. |
689 |
If your module defines any APIs, or has complex internal structures |
690 |
that might be used from multiple threads, declare how you protect |
691 |
data against concurrent access, race conditions, deadlocks, etc., |
692 |
and whether such rules are enforced by runtime warnings, errors, assertions, etc. |
693 |
Examples: a class might be non-thread-safe (like Java Collections); might |
694 |
be fully thread-safe (internal locking); might require access through a mutex |
695 |
(and may or may not automatically acquire that mutex on behalf of a client method); |
696 |
might be able to run only in the event queue; etc. |
697 |
Also describe when any events are fired: synchronously, asynchronously, etc. |
698 |
Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress) |
699 |
</hint> |
700 |
</question> |
701 |
--> |
702 |
<answer id="exec-threading"> |
703 |
<p> |
704 |
API classes are thread safe, they mostly represent immutable |
705 |
objects, or delegate to the SPI. |
706 |
</p> |
707 |
<p> |
708 |
Implementators of the SPI should ensure that their code is properly |
709 |
synchronized, as it can be called from any thread. |
710 |
</p> |
711 |
</answer> |
712 |
|
713 |
|
714 |
|
715 |
<!-- |
716 |
<question id="format-clipboard" when="impl"> |
717 |
Which data flavors (if any) does your code read from or insert to |
718 |
the clipboard (by access to clipboard on means calling methods on <code>java.awt.datatransfer.Transferable</code>? |
719 |
|
720 |
<hint> |
721 |
Often Node's deal with clipboard by usage of <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>. |
722 |
Check your code for overriding these methods. |
723 |
</hint> |
724 |
</question> |
725 |
--> |
726 |
<answer id="format-clipboard"> |
727 |
<p> |
728 |
Plain Unicode text only. |
729 |
</p> |
730 |
</answer> |
731 |
|
732 |
|
733 |
|
734 |
<!-- |
735 |
<question id="format-dnd" when="impl"> |
736 |
Which protocols (if any) does your code understand during Drag & Drop? |
737 |
<hint> |
738 |
Often Node's deal with clipboard by usage of <code>Node.drag, Node.getDropType</code>. |
739 |
Check your code for overriding these methods. Btw. if they are not overridden, they |
740 |
by default delegate to <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>. |
741 |
</hint> |
742 |
</question> |
743 |
--> |
744 |
<answer id="format-dnd"> |
745 |
<p> |
746 |
N/A |
747 |
</p> |
748 |
</answer> |
749 |
|
750 |
|
751 |
|
752 |
<!-- |
753 |
<question id="format-types" when="impl"> |
754 |
Which protocols and file formats (if any) does your module read or write on disk, |
755 |
or transmit or receive over the network? Do you generate an ant build script? |
756 |
Can it be edited and modified? |
757 |
|
758 |
<hint> |
759 |
<p> |
760 |
Files can be read and written by other programs, modules and users. If they influence |
761 |
your behaviour, make sure you either document the format or claim that it is a private |
762 |
api (using the <api> tag). |
763 |
</p> |
764 |
<p> |
765 |
If you generate an ant build file, this is very likely going to be seen by end users and |
766 |
they will be attempted to edit it. You should be ready for that and provide here a link |
767 |
to documentation that you have for such purposes and also describe how you are going to |
768 |
understand such files during next release, when you (very likely) slightly change the |
769 |
format. |
770 |
</p> |
771 |
</hint> |
772 |
</question> |
773 |
--> |
774 |
<answer id="format-types"> |
775 |
<p> |
776 |
None. |
777 |
</p> |
778 |
</answer> |
779 |
|
780 |
|
781 |
|
782 |
<!-- |
783 |
<question id="lookup-lookup" when="init"> |
784 |
Does your module use <code>org.openide.util.Lookup</code> |
785 |
or any similar technology to find any components to communicate with? Which ones? |
786 |
|
787 |
<hint> |
788 |
NetBeans is build around a generic registry of services called |
789 |
lookup. It is preferable to use it for registration and discovery |
790 |
if possible. See |
791 |
<a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html"> |
792 |
The Solution to Comunication Between Components |
793 |
</a>. If you do not plan to use lookup and insist usage |
794 |
of other solution, then please describe why it is not working for |
795 |
you. |
796 |
<br/> |
797 |
When filling the final version of your arch document, please |
798 |
describe the interfaces you are searching for, where |
799 |
are defined, whether you are searching for just one or more of them, |
800 |
if the order is important, etc. Also classify the stability of such |
801 |
API contract. Use <api group=&lookup& /> tag, so |
802 |
your information gets listed in the summary page of your javadoc. |
803 |
</hint> |
804 |
</question> |
805 |
--> |
806 |
<answer id="lookup-lookup"> |
807 |
<p> |
808 |
<code>IOProvider.getDefault()</code> asks lookup for the first instance |
809 |
of <code>InputOutputProvider</code>. This is normally provided by |
810 |
<code>org.netbeans.core.output2</code>. |
811 |
</p> |
812 |
</answer> |
813 |
|
814 |
|
815 |
|
816 |
<!-- |
817 |
<question id="lookup-register" when="final"> |
818 |
Do you register anything into lookup for other code to find? |
819 |
<hint> |
820 |
Do you register using layer file or using a declarative annotation such as <code>@ServiceProvider</code>? |
821 |
Who is supposed to find your component? |
822 |
</hint> |
823 |
</question> |
824 |
--> |
825 |
<answer id="lookup-register"> |
826 |
<p> |
827 |
No. |
828 |
</p> |
829 |
</answer> |
830 |
|
831 |
|
832 |
|
833 |
<!-- |
834 |
<question id="lookup-remove" when="final"> |
835 |
Do you remove entries of other modules from lookup? |
836 |
<hint> |
837 |
Why? Of course, that is possible, but it can be dangerous. Is the module |
838 |
your are masking resource from aware of what you are doing? |
839 |
</hint> |
840 |
</question> |
841 |
--> |
842 |
<answer id="lookup-remove"> |
843 |
<p> |
844 |
No. |
845 |
</p> |
846 |
</answer> |
847 |
|
848 |
|
849 |
|
850 |
<!-- |
851 |
<question id="perf-exit" when="final"> |
852 |
Does your module run any code on exit? |
853 |
</question> |
854 |
--> |
855 |
<answer id="perf-exit"> |
856 |
<p> |
857 |
No. |
858 |
</p> |
859 |
</answer> |
860 |
|
861 |
|
862 |
|
863 |
<!-- |
864 |
<question id="perf-huge_dialogs" when="final"> |
865 |
Does your module contain any dialogs or wizards with a large number of |
866 |
GUI controls such as combo boxes, lists, trees, or text areas? |
867 |
</question> |
868 |
--> |
869 |
<answer id="perf-huge_dialogs"> |
870 |
<p> |
871 |
No. |
872 |
</p> |
873 |
</answer> |
874 |
|
875 |
|
876 |
|
877 |
<!-- |
878 |
<question id="perf-limit" when="init"> |
879 |
Are there any hard-coded or practical limits in the number or size of |
880 |
elements your code can handle? |
881 |
<hint> |
882 |
Most of algorithms have increasing memory and speed complexity |
883 |
with respect to size of data they operate on. What is the critical |
884 |
part of your project that can be seen as a bottleneck with |
885 |
respect to speed or required memory? What are the practical |
886 |
sizes of data you tested your project with? What is your estimate |
887 |
of potential size of data that would cause visible performance |
888 |
problems? Is there some kind of check to detect such situation |
889 |
and prevent "hard" crashes - for example the CloneableEditorSupport |
890 |
checks for size of a file to be opened in editor |
891 |
and if it is larger than 1Mb it shows a dialog giving the |
892 |
user the right to decide - e.g. to cancel or commit suicide. |
893 |
</hint> |
894 |
</question> |
895 |
--> |
896 |
<answer id="perf-limit"> |
897 |
<p> |
898 |
No. |
899 |
</p> |
900 |
</answer> |
901 |
|
902 |
|
903 |
|
904 |
<!-- |
905 |
<question id="perf-mem" when="final"> |
906 |
How much memory does your component consume? Estimate |
907 |
with a relation to the number of windows, etc. |
908 |
</question> |
909 |
--> |
910 |
<answer id="perf-mem"> |
911 |
<p> |
912 |
N/A |
913 |
</p> |
914 |
</answer> |
915 |
|
916 |
|
917 |
|
918 |
<!-- |
919 |
<question id="perf-menus" when="final"> |
920 |
Does your module use dynamically updated context menus, or |
921 |
context-sensitive actions with complicated and slow enablement logic? |
922 |
<hint> |
923 |
If you do a lot of tricks when adding actions to regular or context menus, you can significantly |
924 |
slow down display of the menu, even when the user is not using your action. Pay attention to |
925 |
actions you add to the main menu bar, and to context menus of foreign nodes or components. If |
926 |
the action is conditionally enabled, or changes its display dynamically, you need to check the |
927 |
impact on performance. In some cases it may be more appropriate to make a simple action that is |
928 |
always enabled but does more detailed checks in a dialog if it is actually run. |
929 |
</hint> |
930 |
</question> |
931 |
--> |
932 |
<answer id="perf-menus"> |
933 |
<p> |
934 |
No. |
935 |
</p> |
936 |
</answer> |
937 |
|
938 |
|
939 |
|
940 |
<!-- |
941 |
<question id="perf-progress" when="final"> |
942 |
Does your module execute any long-running tasks? |
943 |
|
944 |
<hint>Long running tasks should never block |
945 |
AWT thread as it badly hurts the UI |
946 |
<a href="http://performance.netbeans.org/responsiveness/issues.html"> |
947 |
responsiveness</a>. |
948 |
Tasks like connecting over |
949 |
network, computing huge amount of data, compilation |
950 |
be done asynchronously (for example |
951 |
using <code>RequestProcessor</code>), definitively it should |
952 |
not block AWT thread. |
953 |
</hint> |
954 |
</question> |
955 |
--> |
956 |
<answer id="perf-progress"> |
957 |
<p> |
958 |
No. |
959 |
</p> |
960 |
</answer> |
961 |
|
962 |
|
963 |
|
964 |
<!-- |
965 |
<question id="perf-scale" when="init"> |
966 |
Which external criteria influence the performance of your |
967 |
program (size of file in editor, number of files in menu, |
968 |
in source directory, etc.) and how well your code scales? |
969 |
<hint> |
970 |
Please include some estimates, there are other more detailed |
971 |
questions to answer in later phases of implementation.` |
972 |
</hint> |
973 |
</question> |
974 |
--> |
975 |
<answer id="perf-scale"> |
976 |
<p> |
977 |
Scalability in GUI speed and memory consumption is probably limited |
978 |
only by the Output Window implementation. |
979 |
</p> |
980 |
</answer> |
981 |
|
982 |
|
983 |
|
984 |
<!-- |
985 |
<question id="perf-spi" when="init"> |
986 |
How the performance of the plugged in code will be enforced? |
987 |
<hint> |
988 |
If you allow foreign code to be plugged into your own module, how |
989 |
do you enforce that it will behave correctly and quickly and will not |
990 |
negatively influence the performance of your own module? |
991 |
</hint> |
992 |
</question> |
993 |
--> |
994 |
<answer id="perf-spi"> |
995 |
<p> |
996 |
No special behavior. |
997 |
</p> |
998 |
</answer> |
999 |
|
1000 |
|
1001 |
|
1002 |
<!-- |
1003 |
<question id="perf-startup" when="final"> |
1004 |
Does your module run any code on startup? |
1005 |
</question> |
1006 |
--> |
1007 |
<answer id="perf-startup"> |
1008 |
<p> |
1009 |
No. |
1010 |
</p> |
1011 |
</answer> |
1012 |
|
1013 |
|
1014 |
|
1015 |
<!-- |
1016 |
<question id="perf-wakeup" when="final"> |
1017 |
Does any piece of your code wake up periodically and do something |
1018 |
even when the system is otherwise idle (no user interaction)? |
1019 |
</question> |
1020 |
--> |
1021 |
<answer id="perf-wakeup"> |
1022 |
<p> |
1023 |
No. |
1024 |
</p> |
1025 |
</answer> |
1026 |
|
1027 |
|
1028 |
|
1029 |
<!-- |
1030 |
<question id="resources-file" when="final"> |
1031 |
Does your module use <code>java.io.File</code> directly? |
1032 |
|
1033 |
<hint> |
1034 |
NetBeans provide a logical wrapper over plain files called |
1035 |
<code>org.openide.filesystems.FileObject</code> that |
1036 |
provides uniform access to such resources and is the preferred |
1037 |
way that should be used. But of course there can be situations when |
1038 |
this is not suitable. |
1039 |
</hint> |
1040 |
</question> |
1041 |
--> |
1042 |
<answer id="resources-file"> |
1043 |
<p> |
1044 |
No, but the implementation may. |
1045 |
</p> |
1046 |
</answer> |
1047 |
|
1048 |
|
1049 |
|
1050 |
<!-- |
1051 |
<question id="resources-layer" when="final"> |
1052 |
Does your module provide own layer? Does it create any files or |
1053 |
folders in it? What it is trying to communicate by that and with which |
1054 |
components? |
1055 |
|
1056 |
<hint> |
1057 |
NetBeans allows automatic and declarative installation of resources |
1058 |
by module layers. Module register files into appropriate places |
1059 |
and other components use that information to perform their task |
1060 |
(build menu, toolbar, window layout, list of templates, set of |
1061 |
options, etc.). |
1062 |
</hint> |
1063 |
</question> |
1064 |
--> |
1065 |
<answer id="resources-layer"> |
1066 |
<p> |
1067 |
No. |
1068 |
</p> |
1069 |
</answer> |
1070 |
|
1071 |
|
1072 |
|
1073 |
<!-- |
1074 |
<question id="resources-mask" when="final"> |
1075 |
Does your module mask/hide/override any resources provided by other modules in |
1076 |
their layers? |
1077 |
|
1078 |
<hint> |
1079 |
If you mask a file provided by another module, you probably depend |
1080 |
on that and do not want the other module to (for example) change |
1081 |
the file's name. That module shall thus make that file available as an API |
1082 |
of some stability category. |
1083 |
</hint> |
1084 |
</question> |
1085 |
--> |
1086 |
<answer id="resources-mask"> |
1087 |
<p> |
1088 |
No. |
1089 |
</p> |
1090 |
</answer> |
1091 |
|
1092 |
|
1093 |
|
1094 |
<!-- |
1095 |
<question id="resources-preferences" when="final"> |
1096 |
Does your module uses preferences via Preferences API? Does your module use NbPreferences or |
1097 |
or regular JDK Preferences ? Does it read, write or both ? |
1098 |
Does it share preferences with other modules ? If so, then why ? |
1099 |
<hint> |
1100 |
You may use |
1101 |
<api type="export" group="preferences" |
1102 |
name="preference node name" category="private"> |
1103 |
description of individual keys, where it is used, what it |
1104 |
influences, whether the module reads/write it, etc. |
1105 |
</api> |
1106 |
Due to XML ID restrictions, rather than /org/netbeans/modules/foo give the "name" as org.netbeans.modules.foo. |
1107 |
Note that if you use NbPreferences this name will then be the same as the code name base of the module. |
1108 |
</hint> |
1109 |
</question> |
1110 |
--> |
1111 |
<answer id="resources-preferences"> |
1112 |
<p> |
1113 |
No. |
1114 |
</p> |
1115 |
</answer> |
1116 |
|
1117 |
|
1118 |
|
1119 |
<!-- |
1120 |
<question id="resources-read" when="final"> |
1121 |
Does your module read any resources from layers? For what purpose? |
1122 |
|
1123 |
<hint> |
1124 |
As this is some kind of intermodule dependency, it is a kind of API. |
1125 |
Please describe it and classify according to |
1126 |
<a href="http://wiki.netbeans.org/API_Design#What_is_an_API.3F"> |
1127 |
common stability categories</a>. |
1128 |
</hint> |
1129 |
</question> |
1130 |
--> |
1131 |
<answer id="resources-read"> |
1132 |
<p> |
1133 |
No. |
1134 |
</p> |
1135 |
</answer> |
1136 |
|
1137 |
|
1138 |
|
1139 |
<!-- |
1140 |
<question id="security-grant" when="final"> |
1141 |
Does your code grant additional rights to some other code? |
1142 |
<hint>Avoid using a class loader that adds extra |
1143 |
permissions to loaded code unless really necessary. |
1144 |
Also note that your API implementation |
1145 |
can also expose unneeded permissions to enemy code by |
1146 |
calling AccessController.doPrivileged().</hint> |
1147 |
</question> |
1148 |
--> |
1149 |
<answer id="security-grant"> |
1150 |
<p> |
1151 |
No. |
1152 |
</p> |
1153 |
</answer> |
1154 |
|
1155 |
|
1156 |
|
1157 |
<!-- |
1158 |
<question id="security-policy" when="final"> |
1159 |
Does your functionality require modifications to the standard policy file? |
1160 |
<hint>Your code might pass control to third-party code not |
1161 |
coming from trusted domains. This could be code downloaded over the |
1162 |
network or code coming from libraries that are not bundled |
1163 |
with NetBeans. Which permissions need to be granted to which domains?</hint> |
1164 |
</question> |
1165 |
--> |
1166 |
<answer id="security-policy"> |
1167 |
<p> |
1168 |
No. |
1169 |
</p> |
1170 |
</answer> |
1171 |
|
1172 |
</api-answers> |