The Code Style site has evolved by gradual refinement and accumulation of features and content. This review is part of a fully backdated site log and archive that sheds light on when, why and how particular features were implemented.
This log is sometimes updated several times per week, sometimes with a long overdue backlog of items. Many log entries refer to the Code Style Java package that delivers the servlet services and utilities used to manage this site.
Subscribe to the news feed for this log:
Created a new top level Broker interface with single declaration, long getLastModified, and sub-interface StreamBroker with openInputStream and openOutputStream methods. Changed the class declaration for FileBroker to implement StreamBroker via FileContentRequest.
Also created a new abstract CacheValue class that implements StreamBroker to permit different forms of physical cache storage. Renamed and re-worked the former ResultValue as org.codestyle.broker.FileCacheValue to operate as a CacheValue type. Removed the unchecked SecurityException if the cached file cannot be deleted.
Renamed and repackaged the former ResultCache and ResultKey classes in the org.codestyle.broker package as a generic Cache and CacheKey classes. In principle, these can be used to cache network resources as well as XSLT results.
Made a range of further standardisation changes to the Code Style Java project using Check Style. Commented out failing tests then re-instated them one by one to contain the task.
final modifiers to further utility classes:
SourceBrokerFactory
SequenceFactory
DatabaseUtilities
DriverUtilities
ResultCache
StylesheetCache
import statements in:
SequenceFactory
DBResults
ResultCache
FileCacheValue
CodeStyleTemplate
private default constructors to utility classes to prevent instantiation:
DatabaseUtilities
DriverUtilities
org.codestyle.template package had originated as abstract classes and the redundant abstract modifier had not been removed from the method signatures:
Discoverable
Navigable
Presentable
Viewable
boolean expressions in the StyleLink constructor, Metadata instance methods getElementNames and getDistinctElementNames and the getHeader method of CodeStyleTemplate.
else clauses in various classes into statement blocks.
Also made various other changes in the course of editing:
rowData in DBResults a private member field and method variables to avoid hiding.
static field names in CodeStyleTemplate and changed long arguments in the overloaded getFooter methods to upper case L.
public modifier from the Linkable interface.
lastModified and templates fields of the StylesheetCache inner class MapEntry private visibility.
Changed the class hierarchy of ReportingParseException to extend SAXException, rather than Exception, and changed the static formatMessage method to an instance method to override getMessage. This method now formats the enclosed SAXParseException fields on output rather than at instantiation.
Installed Check Style and adapted a configuration file based on the Sun code conventions to run across the Code Style Java project. Identified a range of issues and started to bring up to standard in stages.
AnchorPoints, ViewSequence, EchoRequest and TemplateServlet servlets, ParseHandler and ResourceResolver.
final modifiers to various classes:
StreamCopier
SampleFactory
ServletUtilities
SpaceCodec.
final modifiers methods and arguments in:
ViewSource servlet
FileContentRequest
FontSampler servlet
CompareSample
ImageSample
TextSample
Sample
ViewableSample
private default constructors to utility classes ServletUtilities and StreamCopier to prevent instantiation.
ServletException declaration in the ViewSource servlet's doGet method and FileNotFoundException on the FileContentRequest constructor.
static version number field for TemplateServlet and subclasses ParseServlet, ParseRDF and ParseRSS to lower case version, and added an int error code for HTTP file not found errors.
package.html documentation files for all packages.
boolean expressions in the ParseHandler hasParameters method.
@param, @throws and @return tags.
Also applied various other code changes in the course of editing:
getInputStream method of HttpRequest and HttpContentRequest.
LinkSet initialisation in the FontSampler servlet into individual fields to clarify and reduce line length.
static HTTP content type variable in DocumentTemplate.
static field names in XhtmlTemplate to a standard form.
Changed the transform method of the ParseHandler object to take an OutputStream argument instead of an HttpServletResponse, so that client servlets can be adapted to simultaneously channel XSLT results to a ResultCache via ForkedOutputStream. Adapted the abstract ParseServlet to pass a ServletOutputStream to the new method signature while the ResultCache is under development. Also adapted the JUnit ParseHandlerTest and ParseRDFNetworkTest to use new OutputStream arguments.
Added an HTTP POST method test form to the servlet test cases document.
Implemented a delete method for ResultValue to delete cached XSLT result files and adapted the ResultCache's flushAll method accordingly.
Created a new ForkedOutputStream class based on TeeOutputStream in Java I/O by Elliotte Rusty Harold. This dual output stream will ultimately be used to channel XSLT results to servlet output and a result cache.
Removed the UTF-8 declaration from the private String array in SourceType class, so that this is applied by the ParseServlet, see 10th August corrections.
Added a global cache location to the servlet zone configuration to implement XSLT result caching.
Also added this cache configuration to the project build file, properties, filters files and JUnit test cases for the abstract ParseServlet and concrete ParseRSS and ParseRDF servlets, though actual caching is not implemented yet. Improved configuration error reporting to identify specific initialisation parameters.
Wrote a first draft implementation of a ResultCache class to save the results of XSLT transformations. The cache uses a Map of ResultKey and ResultValue pairs to uniquely identify the transformations and their results. The ParseHandler object for a transformation encapsulates its unique properties and is used to construct the ResultKey, the ResultValue implements a File-based registry and interface to the physical storage of the cache. The ResultValue should ultimately be abstracted to permit alternate forms of physical storage through the org.codestyle.broker package.
Introduced a StreamCopier class to the org.codestyle.io package adapted from StreamCopier in Java I/O by Elliotte Rusty Harold. The static copy method channels an InputStream to an OutputStream via a buffer and is used by the new ResultValue class to read and write file content.
Corrected failing network tests for the HTTP Content-Type property of the ParseRDF and ParseRSS servlets and SourceType object from which they are derived. The addition of the character encoding for UTF-8 on 14th June resulted in a string comparison error. Altered the abstract ParseServlet and SourceType classes to separate the type from its encoding and post-appended the UTF-8 declaration. Adjusted servlet implementations and test cases to use the string indexOf method to confirm appropriate content types in ParseServletNetworkTest, ParseRDFNetworkTest and ParseRSSNetworkTest. Also corrected URLs for several network test case documents.
Added the Googlebot agent to the site robots.txt file to restrict access to the FontSampler and ViewSource servlets.
Added an AnchorPoints link to Using XHTML / CSS for an effective SEO Campaign by Brandon Olejniczak to the foot of the Code Style Search engine optimisation article.
These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.
For a summary overview, see the annotated site log contents.