Architecture Review Opinion

Issue: 61412
Submitter: Marek Fukala
Date: 1 Aug 2005
Reviewers: Andrei Badea, Miloslav Metelka, Petr Pisl, Martin Roskanin

Contents

Summary

The API allow clients to get a structural model of a document and listen on changes of the model.

Decision

After discussing several issues, the API was accepted with change requests.

Opinion

The following significant issues were discussed at the inception review.

Naming, removal of short classes, final API classes (issue)

The DocumentElementInfo class should be removed, as its method are either not used or can be replaced by DocumentModel methods.

BaseDocument should not appear in the API. Only javax.swing.text.Document should be used.

There are several classes in the API which are not final and they have protected methods, thus it is not clear whether they are intended to be extended. These classes should be made final.Listener interfaces should extend EventListener.

The DocumentModelProvider class contains a single method. This method should be moved to DocumentModel and the class removed.

Javadoc (issue)

Currently there is no or not enough Javadoc. Proper Javadoc should be written.

Usage of javax.swing.text.Element for document elements (issue)

The DocumentElement class looks similar to javax.swing.text.Element. Consider using this interface for document elements.

Performance issues (issue)

There are known performance problems while updating the model for larger HTML and JSP files. These problems should be analyzed and solved.

Usage of MimeLookup for the retrieval of the SPI implementations (issue)

The Editor MIME Lookup API provides support for retrieving MIME-specific objects. This API should be used to retrieve the document model generators registered for a MIME type.

Minority Opinion

There were not dissenting opinions.

Advisory Information

The current package is org.netbeans.editor.model. Another package naming should be considered, but different from org.netbeans.lib.editor.model, as this one is reserved for future editor APIs.

Test coverage should be clarified. There should be tests for model integrity and for performance.

Appendices

Appendix A: Technical Changes Required

Appendix B: Technical Changes Advised

Appendix C: Reference Material

None