Wednesday, September 23, 2015

Actionable Data Structures (ADS) in CABOOSE

Team. We have been looking for ways in which we could include an actionable data structure (ADS) in CABOOSE. Considering the current design which has been somewhat organic because we are developing an evolve-able prototype, the primary goals of our use of ADSs should be easy integration with the current code-base, a reduction in the overall number of instructions, increased readability and maintainability, plus a better partitioning of the CABOOSE concerns.  

The Value of an ActionHashMap as a Request Processor
  
Each page concern whose content specification is drawn by a controller application bundle (CAB) represents an entity which is requesting a fulfillment service from the CABOOSE controller. The request is in the form of a unique user-defined identifier such as #PRODUCT_TABLE#. Such a label is a placeholder in an markup template for each concern. This placeholder also doubles as a string replacement variable within its XHTML stencil. In other words, the controller will replace this label with a markup string which provides a specification of the appropriate dynamic content. This content specification is the return value of a given method within a class that provides a bundle of one or more rendering services for the controller. An XML directory file contains a mapping between the user-defined placeholders and its associated rendering methods for each view that the application requests.

So, one can build an ActionHashMap which invokes behavior given a key versus returning only an object. An ActionHashMap can be built for each view based on the XML directory mappings, and when a web application requests that a given #PLACEHOLDER# be drawn with the appropriate markup specification, this placeholder might be used as a key for the ActionHashMap. The resulting object returned by this map's keyed behavior would the markup content string which the controller would inject in the XHTML stencil at the position of the placeholder.

Finally, a traditional HashMap could be built which holds all of the ActionHashMaps as values which are keyed by their associated view name.

It seems that we might have some slight convergence between ADSs and CABOOSE.

Hunt. Peck. Think. Happy Coding. The CABOOSE Team.

No comments:

Post a Comment