think of it as internal design documentation
when you revisit this code 8 months from now:
- based on nothing but your well-chosen ;) package/class/method/variable names, will you recall all of your current design intentions and rationale? likely not
- when you hand-off this code to another software engineer, how easy will it be to mostly rtfm? will you have to waste time preparing design/implementation notes specifically for the hand-off? if this is the case because the code is unreadable and not self-guiding and there's not already at least high level design notes in a wiki, you're doing it wrong!
If a method is overridden in a subclass, Javadoc should only be present
if it says something distinct to the original definition of the method
this at least makes the paragraph breaks wysiwygísh and somewhat easier to read
Use a single <li> tag for items in a list
place a single <li> tag at the start of the line and no closing tag
Define a punchy first sentence
it has the responsibility of summing up the method or class to readers scanning
the class or package
the first sentence should be
clear and punchy, and generally short
use the third person form at the start
Avoid the second person form, such as "Get the foo"
Use "this" to refer to an instance of the class
When referring to an instance of the class being documented, use "this" to reference it.
Aim for short single line sentences
Wherever possible, make Javadoc sentences fit on a single line
favouring between 80 and 120 characters
Use @link and @code wisely
@link feature creates a visible hyperlink in generated Javadoc to the target
@code feature provides a section of fixed-width font, ideal for references to
methods and class names
Only use @link on the first reference to a specific class or method
Use @code for subsequent references.
This avoids excessive hyperlinks cluttering up the Javadoc
Never use @link in the first sentence
Always use @code in the first sentence if necessary
Adding a hyperlink in that first sentence makes the higher level documentation more confusing
Do not use @code for null, true or false
Adding @code for every occurrence is a burden to both the reader and writer of the
Javadoc and adds no real value.
Use @param, @return and @throws
@param entries should be specified in the same order as the parameters
@return should be after the @param entries
followed by @throws.
Use @param for generics
correct approach is an @param tag with the parameter name of <T> where T
is the type parameter name.
Use one blank line before @param
This aids readability in source code.
Treat @param and @return as a phrase
They should start with a lower case letter, typically using the word "the".
They should not end with a dot.
This aids readability in source code and when generated.
treated as phrases rather than complete sentences
Treat @throws as an if clause
phrase describing the condition
Define null-handling for all parameters and return types
ideally, if the method in question has any specified/required pre and/or post conditions, they should be noted in the javadoc, not *just* null handling
also, there are cleaner ways to design around this type of old school null handling hackage
methods should define their null-tolerance in the @param or @return
likewise with javadoc on things like default constructors
/**
* Creates an instance of SomeClass
*/
public SomeClass() {}
is equally useless and unnecessarily clutters up the source code
List becomes ArrayList
SortedSet becomes TreeSet
Set becomes HashSet
Collection becomes ArrayList
Array (sparse)
java.util.Map
java.util.Map
java.util.Map
If a Map interface is specified, creates a new java.util.HashMap for java.util.Map and a new java.util.TreeMap for java.util.SortedMap.
BlazeDS passes an instance of java.util.ArrayList to parameters typed with the java.util.List interface and any other interface that extends java.util.Collection. Then these types are
sent back to the client as mx.collections.ArrayCollection instances
If you require normal ActionScript Arrays sent back to the client, you must set the legacy-collection element to true in the serialization section of a channel-definition's properties; for more information, see Configuring AMF serialization on a channel.
legacy-collection
Default value is false. When true, instances of
java.util.Collection
are returned as
ActionScript Arrays
legacy-map
Default value is false. When true, java.util.Map instances are serialized as an ECMA Array or associative array instead of an anonymous Object.
A typical reason to use custom serialization is to avoid passing all of the properties of either the client-side or server-side representation of an object across the network tier.
standard serialization scheme, all public properties are passed back and forth between the client and the server.
Explicitly mapping ActionScript and Java objects
Private properties, constants, static properties, and read-only properties, and so on, are not serialized
enables you to set the visibility of attributes and operations
hide or show attributes and operations
visibility you set applies only to the current diagram, so a Class can appear in one diagram with all features displayed, and in another with features hidden
Baseline Diagram Compare feature is a quick and easy way to visually compare a current diagram with an earlier version
Access Any of the following:
•Project Browser diagram context menu | Compare to Baseline | <select baseline>: Show Differences•Project Browser package context menu | Package Control | Manage Baselines: Show Differences | Selected diagram context menu | Open Visual Diagram Diff •Diagram context menu | Compare to Baseline: Show Differences, or•Select Package | Project | Baselines: Show Differences | Selected diagram context menu | Open Visual Diagram Diff
To import a binary module, right-click on the target package in the Project Browser and select the Code Engineering | Import Binary Module context menu option
note: the file dialog that opens after selecting 'import binary module' opens with filtering for .net binaries, so .jars won't be visible. change filter to .jar and happy happy