31 December 2003

The GoRAD Toolkit was started in December 2003 to address what I saw as a need for a reliable structured approach to building advanced PHP applications. By the time I started rolling out production sites using the framework, other PHP frameworks with the same goals started popping up. For example, the Zend Framework made many of the same core design decisions and had an alpha in 2004 as well, although it did not release a full 1.0.0 version until July 2007 (ref). Frameworks are dime-a-dozen now, and I am generally committed to Drupal, but I still use a significant amount of GoRAD in production due to some of the unique utility classes that it provides. The toolkit is not available for download because the MVC components that pervade it have been deprecated in favor of other options (e.g., Drupal).

GoRAD Design Strategies

GoRAD was built from the ground up to be extremely flexible and customizable. Although I had learned many lessons through practice, I also recognized that there was already a healthy body of work related to framework design that could be applied to a PHP framework. Many GoRAD design strategies are essentially PHP adaptations of the Core J2EE Patterns, including Intercepting FilterContext ObjectFront ControllerApplication ControllerView HelperData Access Object, and others. Virtually all components are overridable and configurable with a very fine-grained separation of concerns.

Abbreviated List of GoRAD Packages

  1. Language constructs
    1. Base class with standard property setters/getters and other basic methods
    2. Various utility classes, including standardized operator syntax
    3. Class autoloading
    4. Trivial type juggling and class change (casting to a new class)
    5. PHPT unit testing
    6. Pluggable exceptions
    7. Aggregation for multiple inheritance
  2. Assistant
    1. Configured using XML, making it fully exportable
    2. Pluggable configuration syntaxes (2 default syntaxes)
    3. Pluggable data element hierarchy (24 default element types)
    4. Pluggable UI component hierarchy (45 default components)
    5. Contextually override UI components (ex: adjust component markup for jquerymobile based on user agent)
    6. Pluggable actions (21 default actions)
    7. Pluggable command engines
    8. Pluggable report engines (9 default report engines)
    9. Pluggable report controls/subreports
    10. Pluggable data access (resource) layer (4 default engines)
    11. Pluggable search engines (3 default styles of search)
    12. Form mode supported restrictions on number of rows to add and/or edit at once
    13. Can function as a controller, delegate or command within GoRAD MVC
    14. Debugging enabled by XML configuration
  3. Automation
    1. Pluggable automation (i.e., cron) system that allows PHP commands to be executed at arbitrary dates/times with supported recurrences
    2. All date calculations and recurrences are based on the GoRAD iCalendar implemenation
    3. All commands are interchangeable with those used online or via CLI
    4. Parameters for the command are stored in the automation object
    5. Output and other execution information is stored in the automation object
  4. Brick
    1. Provide a flexible spreadsheet-based multi-variant form configurator
    2. Visible fields and their possible input values are determined by spreadsheet-style formulas
    3. Sample application: a basic linear multi-page form
    4. Sample application: a product configurator that has interrelated restrictions and requirements (e.g., the type of A used limits the types of B that can be used)
  5. Slang
    1. Standardized XML format for storing common types of data, serving a function similar to plist, JSON, and YAML
    2. Based generally on the RSS format, it provides a recursive data structure
    3. Maximum emphasis is placed on readability
    4. Advanced applications apply XSLT to convert Slang into more verbose configurations
  6. Coding tools
    1. Automatic refactoring for code styles and documentation
    2. Debug and tracing via the Message package
  7. Core
    1. Server handlers to initialize the front controller: Apache, CLI, IIS
    2. Front controller, filter manager, mapper, pluggable exceptions, etc.
    3. Message support
    4. Pluggable application controller (3 default controllers: a simple map-based controller, a raw controller to override, and CLI controller)
    5. Pluggable delegates (5 default context-sensitive delegates)
    6. Pluggable filters, commands and views
    7. Advanced page caching
    8. Pluggable contexts, sessions, contacts and users (contacts and users are loosely coupled)
    9. Allow users to select their active contact and context when allowed (using the Perspective system)
    10. Dynamic URI support (register a command to a secure URL and defer processing of user input until that URI is requested)
  8. Data Access Object
    1. Pluggable aspects with multiple pointcuts available (4 default aspects for serializing, revision history, prepopulation, and chaining)
    2. Caching
    3. Pluggable relationships that were not bound to the same resource type (4 default relationships including S3 objects, local files, and child-parent)
    4. Pluggable storage engines (default engines include db table using, multiple tables, table aggregator, Lucene, null/memory)
    5. Accessible in template plugins
  9. XML and HTML
    1. Extended DOMDocument with significant utility methods
    2. Extended SimpleXML with significant utility methods
    3. Convert CSS to inline styles
    4. Manage XSL and parameters
    5. Perform advanced DOM manipulation more characteristic of jQuery than of the PHP tools
    6. Object-oriented wrapper for Tidy with pluggable configurable automated markup tools (11 default tidy add-on tools)
  10. DB filter supporting either Pear or Zend/PDO database layers
  11. Spreadsheet tools
    1. Import and export xml spreadsheets compatible with Excel
    2. Process Excel-compatible formulas, including SUM, MAX, AND, FALSE, IF, NOT, OR, TRUE, HLOOKUP, ROW, VLOOKUP, etc.
  12. SQL (MySQL-tested) Tools
    1. GeoCalc integration
    2. Modify queries to support filtering and ordering by a parent-id-style hierarchy
    3. Modify queries to enforce a manual sort order
  13. VCX
    1. Pluggable data layer optimized for XML (11 default layers, including XML, Plist, JSON, ini, PHP variables, etc.)
    2. Pluggable version types (21 default versions, including a flexible version that supports 15+ configurations and itself supports plugging)
    3. Statically accessible or bound to context
    4. Supports traversal using many XPath operators
    5. Supports basic data types: string, array, XML
    6. Supports value inheritance and merging
    7. Supports a unique logical infrastructure optimized for code minimalization
    8. Tests can be against the context, the database, user input, and the user themselves (10 default tests that apply to the browser like Flash detection or the user like captcha)
  14. Document Support
    1. Pluggable standardized metadata and content access, including a generic document, a virtual document, a PDF, an RSS file, etc.
    2. Pluggable document lock mechanism (some documents are not on the file system)
    3. Pluggable standardized document conversion involving many combinations of these file types: CSS, CSV, HSS, HTML, XML spreadsheet, PDF, Word (DOC/DOCX), XLSX, JPEG, PS, PSD, RTF, SVG, TIFF
    4. Pluggable conversion engines (e.g., 3 techniques to convert HTML to PDF)
    5. Converter filter: allows a converter to run after the application controller to convert all output, and similarly allows Assistant applications to generate PDFs and other file types
  15. Emulator: load a context and emulate a request
  16. Helpers for faster development
    1. Basic HTML form
    2. Web form with AJAX handler
    3. Load an Assistant as a module within the controller
    4. Job posting system (Assistant configurations - override with XSLT)
    5. Complex document management based on RSS and common extensions (Assistant configurations - override with XSLT)
    6. Voting/rating system with AJAX handler
    7. FAQ management (Assistant configurations - override with XSLT)
    8. Traverse relationships in the database
    9. And 8 other generic helper views
  17. Calendar and date/time tools
    1. Pluggable calendar engine based primarily on the iCal standard
    2. Pluggable imports: iCal, xCal, Exchange, PHP
    3. Pluggable exports: iCal, xCal, PHP
    4. All basic components: event, freebusy, journal, timezone, todo
    5. Import datetimes from unixtime, iCal format, any strtotime-compatible format, etc.
    6. Complete datetime math
    7. Recurrence support, including date exceptions
    8. Accessible in template plugins
  18. Messaging API
    1. Standardized interface for any type of message
    2. Pluggable chainable message backend (defaults include templating, archive/db, email, log, etc.)
    3. Automation command that can generate bulk messages for any available messaging backend (e.g., mass emails)
    4. Advanced message structure and consolidation, which supported code traces
  19. Web services support
    1. SOAP
  20. Template Engine
    1. Standardized object-oriented template engine API
    2. Pluggable template engine backend (7 default engines, including Smarty, DWT, Tal, and others)
    3. The "Litey" engine provided a substitution-based alternative for simple Smarty use cases
    4. The "DWT" engine converted Dreamweaver templates into Smarty templates and compiled them
    5. The "RTFMerge" engine converted mail merge documents created in Word and saved as RTF into Smarty templates and compiled them
    6. Pluggable class-based template plugins provided easier namespace-based extensions to the template system (dozens of default plugins)
  21. Composite views
    1. Final output can combine the results of multiple commands/views
    2. Each component (a "UI extra") has similar implementation, from message output to toolbar generation to dynamic charts
    3. Pluggable component structure (multiple defaults)
  22. Charting
    1. Pluggable engines (3 defaults: HTML, SWF, JPEG)
  23. Sitemap
    1. Filter by context and permissions using VCX
    2. Display as templatable hierarchy (a normal sitemap page)
    3. Display as menu as UI extra
    4. Display as templatable flat list (e.g., for Google Sitemap)
  24. User Authentication
    1. Loosely coupled with contact system, supporting a many-many relationship
    2. Pluggable authentication and session engine (has been used to integrate with Drupal, Redmine and others)
    3. Tools to import and merge
  25. Batch utilities
    1. Manage arbitrary lists of data that have unique identifiers
    2. Construct the lists of data using a sequential batch logic, which is capable of enormous complexity
  26. Spider
    1. Pluggable engines for reading a source (5 default engines, including filesystem, db query)
    2. Pluggable helpers for acting on each document (2 default engines, including database and debug)
  27. Array utilities
    1. Standardized syntax to serialize an array into a string (generally HTML) using various techniques
    2. Normalize keys
    3. Sorting utilities for multi-dimensional arrays
    4. Pluggable utilities to access special arrays (13 defaults utilities, including countries, filesystem queries, mime types, etc.)
  28. Filesystem utilities
    1. Iterator
    2. Recursive search and replace (CLI)
    3. Integration with the vault (database-managed recycle bin)
    4. Compute a realpath based on include_path and other contextual data
  29. Text utilities
    1. Flexible parser and tokenizer to support advanced markup manipulation, spreadsheet formula handling, and a variety of other use cases
    2. Manage conversion between character sets and types of HTML-encoding
    3. Convert strings to boolean values (e.g., "Yes" = "Y" = "True" = 1 = TRUE)
    4. Pluggable encryption (5 defaults)
    5. Basic utilities: character sets, diff, random strings, etc.
    6. Translator support with pluggable translation tools, including manual and Google Translator

blog comments powered by Disqus