Team. An instance of the CABOOSE System written in Python can be found on GitHub. It should be said that the version on GitHub has an simple optimization which the code found on Google Drive does not.
Monday, January 4, 2021
Friday, December 18, 2020
Python ICE | A "Full" Python In CABOOSE Prototype [ Just Below The Surface ]
Not a ZeroC Production
Team. Hopefully, the Gang's all here. This deliverable date has long since passed by. The realization of the "fifth" phase of this multilingual project is extremely overdue. It initially was scheduled for November 15, 2020. With the completion of the final phase projected near this time or mid-January 2021.
Seeing that this architectural software pattern will not be woven in each of the fourteen languages chosen by then, one of the "simpler" implementations was chosen as a "deliverable" concession and completed "proof of concept". The implementation language was Guido von Rossum's Python.
Since this past year has offered the author teaching opportunities in computer programming fundamentals, in particular, Python, he knew that "finalizing" the vision of a general-purpose controller which supported dynamic invocation would be quite simple in that language.
So, he set aside a "vacation day" before the Winter holidays in America and spun the product. Between running errands and three meetings, including an academic interview, he found time for it on a Friday. It was about 4.0 person hours (PH) worth of effort. It is nearly a (0.5) KLOC coding effort with some repeated segments of code and ample comments, not including the generated "icemode.py" file which is produced by "icy.py" and of varying length.
It includes a "simple-minded" and "non-optimal" code-generator that renders a "hard-coded" version of the logic file with a batch file called "iceman.bat".
The primary script "caboose.py" will run using dynamic invocation for activating behaviors described in the CABOOSE logic file if the ICEMODE global in it is assigned a value of "False". If it is given a value of "True", then the script uses hard-coded logic in the "icemode.py" file generated by "iceman.bat" and ultimately "icy.py".
It goes without saying that a Python 3 hybrid-interpreter must be installed and part of your system's PATH variable before this can run from the command prompt.
Python ICE for Windows development is available on online. This is not the product from https://zeroc.com/products/ice with a similar moniker. That product is a framework for "microservices" based upon remote procedure call (RPC) and is architected and coded much like Oracle's Ozark controller product. This is called ICE for a different bi-fold reason. Firstly, ICE is an acronym for In CaboosE.
CABOOSE is a very simple pattern for a controller which one can "spin" himself using a number of languages in a day or so each. Secondly, this product uses an architectural control file (ACL) whose mapping between page concerns and those methods which satisfies them can be "iced" or "frozen" in a programmatic "switching" structure for static invocation versus the default dynamic invocation. It is more of a "template-driven" system with a model of the view in a storyboard and behaviors that render each view in a "cab.py" file.
Unlike ZeroC's product, this product version is not object-oriented, although it could be.
And like the JAVA in CABOOSE project which integrates well with Oracle's Ozark, this ICE product likely will mate up well with ZeroC's ICE project. But, that is intuition with the different ICEs and not experience talking.
And, it just so happens that the JAVA in CABOOSE project was considered by Oracle's JAVA Community Process (JCP) for adoption a full-year before the development of Ozark after it was pitched as a potential JAVA Specification Request (JSR). It was determined that Oracle had enough "view technologies" with servlets and JAVA Server Pages (JSP).
So, please do not get caught up in labels. These are different types of ICE, like "nilak" and "siku" for the Inuktitut of the Alaskan coastline. Certainly there is more than one Bill Joy, James Gosling, Mary Fitzsimmons, and Tom Johnson in this world. And, it is the case that more things in this life than Irishmen come with the same name. But, if one looks closely, they can easily see the differences between the products with the same "name".
This prototype of the controller runs from the command line, but can be easily adapted for "web-use". It can be invoked from the DOS prompt with "run [view_name]". Three templated HTML views exist in the StoryBoard model: home, landing, and error.
So, for instance, if one types "run home" at the prompt, then the populated HTML template for the homepage prints on the terminal. If one types "run foobar", then the error page prints since foobar is not a registered view in the CABOOSE logic file, directory.scsv.
The HTML view templates are populated by functions found in "cab.py". This Python script must be created and customized for each Python ICE (Python In CABOOSE) application which one creates. If a non-existent view is requested, then the error view is returned as was the case with "foobar".
The CABOOSE Logic file "directory.scsv" unites all of this. It drive "caboose.py" which does not need modification, outside of the ICEMODE global which might be best housed in a the "cab.py" file.
A similar, yet not fully ICE'd version for JAVA is described in JAVA in CABOOSE by Abraham Vati James found on Amazon. This only is one of the pennames under which this author has worked in past years. Take it, tweak it, turn some web gears with it. It is under a MIT License for Open Source.
Hopefully, this shows how simple spinning and weaving the tapestry of a modern general-purpose controller is. It is the author's goal that he provide implementations in the other programming dialects of this multilingual project within a few month. PHP and PERL for the LAMP stack should be an easy task such a Python. This ease of development is driven by each of their individual mechanisms for dynamic invocation. Also, the Node.js and Typescript implementations each permit use of a function for statement evaluation.
This greatly simplifies dynamic invocation in comparison with JAVA's Reflection tools and function pointers in C/C++. And, these tasks in C#, Rust, Clojure, Groovy, and Ruby will be a "new" undertaking for the author. But, this should not be an impossible task.
Upon taking his first computer fundamentals course at Vanderbilt during the Spring of 1989, he wondered about controllers in a model-view-controller architecture and whether a general-purpose one could be built with a means of "programming it" with a secondary "architectural control language".
This is what is found in the sectioned comma separated values (*.scsv) file which holds the CABOOSE logic.
The realization of this "trivial" project arises from the culmination of many years of learning and work. And, it should be said that such a revelation was quite novel at the time when print SPOOLing was new and revolutionary. In some ways, its time has passed; in others, it has not.
This could be a means of creating the "old" text-based and menu-driven command-line interface systems from which the author first harvested the abstractions of layered and model-view-controller architectures. Based upon his training in Pascal, he wondered if he could generate the "switch-case" or "if-then-else" ladder needed for logical processing of such a controller-based system. But, he knew little about lexical analyzers, interpreters, compilers, or code generators, at the time, other than what they did. He was far from understanding parse trees and the likes of grammars. These concepts still are not his strong points, seeing that he never took a course in compiler construction. In many ways, this might be considered a "kludge".
Yet, over the years, before the advent of markup languages and eXtensible Markup Language (XML) processors, work on mainframes with "on-lines" and a bespoke in-house system called integrated scripting produced by Jack Sprouse, a knowledge of International Business Machine's Customer Information Control System (CICS), and undergraduate study suggested that such a system with a "simple-minded" code generation step driven by a architectural control language (ACL) would be worthwhile. Life's circumstances did not allow for its production until now.
But, the author kept it simple (KIS), plus he used the bird-foraging technique (hunting, pecking, and thinking) along with copying and pasting lines of code. And, Python ICE is likely the first nearly "full" rendering of this vision. It is a extremely simple "cold fusion" of sorts, since it connects view technology standards (markup) and a popular high-level language (Python) with some elements of fourth generation languages (code generators).
It is a mezzanine generation for languages in this fifth generation, those running atop machine emulators, such as Python and JAVA. Using a mixture of declarative markup and imperative or functional languages, it is a generation 3 1/2 system when integrated with a third-generation language such as C/C++ and a 5 1/2 when combined with a modern fifth generation virtual machine dialect.
Occasionally, limitations on what one knows helps him develop simpler solutions. At times, one can "overthink" what he is doing and build a duplicate of Dr. Who's Tardis when all one needs in a Ruby Pearl Tercel DX or, better yet, a push cart.
The construction of an ICE system virtually permits for the abstraction of the C, controller, out of the MVC processing equation. So, ultimately, we now have a (model-view) MV architecture which is "best" described as (view-model) VM based upon the top-down layering.
This, when run atop a virtual machine, produces a VM * VM system which experiences a magnification of its combined power and desirable engineering traits as emergent behaviors arise. And thus, one might call it a "VM-squared" or , basically s "VM^2", architecture.
The author fully knows that VM-squared or the equivalent VM-MV systems have been defined as something different in past years. Yet, it is quite true that few know where the anacronyms originated. It was in the author's college-ruled red Mead notebook which was originally purposed for his ENGL104W Prose Fiction course taught by Robert Bacon at Vanderbilt University during the Spring of 1989.
Yet, it is oft said that “Truth is stranger than fiction, but it is because fiction is obliged to stick to possibilities; Truth isn't.” ― Mark Twain, Following the Equator: A Journey Around the World.
And, although this misuse of personal academic notes was a violation of Vanderbilt's Honor Code, the convolution of Flannery O'Connor's words in the phrase "everything which converges must rise." brings much comfort in this world of "360-degree" good fortune.
"What goes around comes back around again..." - Grand Puba
Sunday, November 1, 2020
The Iceman Cometh | Summary of Project Vision - Its Ultimate Goal
Team. The purpose of this project is spinning a "general-purpose" controller in fourteen different languages. This meets the goals of this "Google-based" web history, providing a modern "Rosetta Stone" describing common, widely-applicable software patterns in a myriad of languages. This project is built around four key architectural features: a "customizable" storyboard model of the view content, bundles of behaviors which populate the views of this storyboard, a file mapping between the storyboard content placeholders and these "invokable" behaviors, and dynamic invocation, which is a feature found in most "professional-grade", high-level computer programming languages. These four design decisions delineate this controller pattern from others such as Struts, Spring, and Laravel. Plus, this choice provides for its flexible, universal, and portable nature. Best of all. a single language instance of such a controller can easily be crafted and documented in forty person-hours or less by a seasoned software engineer.
So, when one builds a "web-based" system with this controller pattern at its core, he must follow the steps below. It is a "multi-cycle" process.
CYCLE A:
Front-End Developers:
- Build a complete "static" HTML-storyboard.
- Integrate its parts.
- Verify it internally.
- Validate it with the client.
Upon approval:
CYCLE B:
- Identify any content which should be dynamic.
- Assign each portion of content a unique user-defined placeholder, such as #E-MAIL#.
Front-End Developers:
- Replace any content which should be dynamic with user-defined placeholders.
- Reintegrate the annotated storyboard's parts.
- Verify it internally.
- Validate it with the client.
Back-End Developers:
- Build packages of invokable methods which will replace placeholders with appropriate dynamic content.
- Follow a "sensible" naming convention for these methods based upon the placeholders they will replace.
- Unit test methods.
- Verify internally.
- Validate with the client.
Integrator:
- Build the mapping file based on the requirements document produced when identifying the dynamic content and defining the placeholders. This will represent an "architectural control language" (ACL) file in eXtensible Markup Language (XML) or a Segmented Comma Separated Values (SCSV) format.
[ NOTE : The front-end, back-end, and integration work for CYCLE B work can be completed in parallel. ]
CYCLE C:
- Unite the annotated storyboard, packages of methods, and ACL file with the pre-written and reusable general-purpose controller pattern rendered in the appropriate language for the target platform and method bundles.
After this integration step:
- Verify the system internally.
- Validate the system with the client.
CYCLE D: ( Technically Optional )
- "Freeze" the "liquid" nature of the dynamic invocation through the use of an integration completion engine (ICE).
- Perform "final" verification.
- Perform "final" validation.
- programming by contract (rebranded design by contract by Dr. Bertrand Meyer)
- object-orientation with visions for inheritance, polymorphism, encapsulation, information hiding, access modifiers, and other primitive features of this concern partitioning approach.
- JAVA, which he code named Oak, a freely-distributed and universal virtual machine language that was object-oriented possessing product features like applets, servlets, and factories. Each of these features were implemented differently than he originally intended. Yet, it became a highly viable product. All of this was present along with an "original" tear-drop doodle titled the Duke of Earl and given the gender-neutral name of a freshman sweetheart from a "special" high school program called Horace Mann..
- action-orientation (AO) as a meta-concern separation paradigm based upon objects. The world met AO in a form that was much different than intended lacking "actionable" data types (ADTs)
- an action-oriented language based upon "interconnected and dynamic" object configurations called Python, since the arrangement of actionable data types in motion looked like a ball of writhing serpents in his mind's eye.
- a vision for the concept of architecture in software, based upon principles from mature engineering fields such as construction engineering.
- the notions of model-view-controller and layered architectures
- an idea for patterns and frameworks in computing inspired his grandmother's Jim Walter's home in Chattahoochee, Florida.
- the plans for a research group called the Gang of Four.
- and much more...
Sunday, October 25, 2020
Delays, Delays, Delays, .... | Once Again
Team. Schoolwork is keeping this college adjunct quite busy. So, the next deliverable might become available around 11.15-30.2020 instead of 10.30.2020. His course load at the on-line university where he teaches has doubled. Plus, he is teaching a couple of "new" courses this term. And, one of these is at a "new" college. "New" courses always has an increased learning curve and require more person-hours. And, "new" work environments always require an adjustments.
The next phase is rather straightforward and many of your likely have completed it already and possibly the entire project. The end is clearly in sight.
For the next phase, we will be parsing the architectural control file and replacing the placeholder in our storyboard template with the name of the appropriate method for replacing its content.
In the final phase, we will invoke that method and replace the placeholder with the string value return from the associated method.
It likely would be wisest if the contents of the architectural control file were parsed and placed in an associative array, dictionary, hash map, or hash table. This would allow for the quick repeated access of associated method names, during the execution of the application. For web-based processing, such a "control" data structure should be placed in a session or application-level variable. As such, time would not be spent reparsing the architectural control language (ACL) file each time a server-side process runs.
These data structures already are available in most of the languages used in this development effort, except for C. And, for the sake of simplicity we likely will not roll our own hash table for this implementation. Most likely, we will simply reparse the file each time that we need a value. This will be highly inefficient, but this is a "proof of concept" prototype.
And, in the "post-final" phase, we might write a switch generator that will read the ACL file and produce a source file with the appropriate hard-coded logic for statically invoking the appropriate methods for the view that we will be returning.
The author's term at a couple of programs ends early, around the week of Thanksgiving in America. This we free up time for working on this project.
Wednesday, September 16, 2020
Controllers
Team. This project has manifold purpose. In other words, it is worthwhile for many different reasons. First, it is an exercise in "polyglot" programming, in that it provides fourteen functionally-equivalent software products. The author crafts each in a different high-level computer programming language.
And, this also is a valuable exercise since it creates a general-purpose controller. This architectural software structure is very common and found explicitly or implicitly in every interactive system. In terms of software engineering theory, it is an archetypal module for all systems that accept input and produce output. It is the locus of the system's logical processing.
For systems that are layered, usually with presentation, middle-ware, and data-entity tiers, the controller is a way of viewing the role of the middle-ware business logic.
This a fundamental structure in software engineering and system development. It is much like a compiler and interpreter. One does not write a "fresh" instance of one of these language tools each time he needs one. Unfortunately, in the "medieval" days of computing, 1970s - 1980s, a vision for the "pre-rolled" component that controlled the logic the logic of any system was not envisioned. So, the common function of the control unit was rewritten each time it was needed. This counters the principles of software reuse and write once run many (WORM).
The field of software architecture was conceived in the Spring of 1989 based upon the author's best recollection. The first conference on the topic was in the Fall of 1989 as modern records show. It was during this Spring that insight and innovation inspired the birth of the basic architectural assemblies of layered and model-view-controller systems. This was one catalyst driving the modern computing renaissance of the mid-1990s with its world-wide web and markup languages for "typesetting".
With the advance of the discipline of software engineering during the 1990s and early millennium, the community was given various "prefabricated" controller products such as Struts, Spring, and Laravel. Yet, none of these are truly "general-purpose", nor can they as easily integrate functionality as the product under development in these fourteen languages. Plus, Struts and Spring are only compatible with JAVA and Laravel only supports PHP (the personal hypertext processor).
And, one of the most wonderful aspects of the current system implementation of this general-purpose controller is that it is very simple, a small coding effort, and one which you can build yourself and customize as needed.
Foreshadowing future software engineering practices, "general-purpose" controllers supporting dynamic invocation might soon be a standard language component much like compilers and interpreters.
Oracle and Microsoft each have modern MVC products. The author is familiar with Oracle's Ozark product which provides a "flexible" controller product for use with RESTful web-services. Yet, outside the realm of web transactions, Ozark does not support the dynamic invocation of "user-defined" methods in other instances. At least, this is how the author understands this product. And, Ozark systems cannot be "wired-up" as easily as this "simple" products architectural control language (ACL) file. Ozark systems must have their logical flow described within the JEE controller's source file. In some sense, those logical concerns are tangled up with other source code concerns. It might be the case that this use of an ACL file provides a better partitioning of system concerns.
In short, this structure for architectural controllers might become a "de facto" standard. Primarily, because it is "simple" in design and "straightforward" in its use, much like HTML.
Wednesday, September 9, 2020
Phase V | Foreshadowing and Falling Action
Team. We have been working with a simple HTML template file and a CABOOSE logic file that are inconsistent and incompatible with each other.
The architectural language instructions drawn from "directory.scsv" are from the sample website found within the pages of CABOOSE in JAVA, a text which is available on Amazon. Currently, they do not correspond with our single page site.
Over the next few weeks, we will don our creativity caps and alleviate this problem. Once we have an HTML storyboard with a compatible controller logic file, Phase V will consist of replacing each placeholder in the HTML file with the name of the method or procedure that will eventually supply the appropriate string for that position within the markup file.
We are planning on the construction of a very simple system with a few pages, no more than five. We will settle on a theme over the next few days. It will be a "meaningful" solution that does not require database access. Plan on an October 31 deliverable.
It is envisioned that we will have a single phase after this one, when we utilize the features of dynamic invocation available in each of these language. The tentative deliverable date for that phase is December 31, 2020.
Tuesday, September 8, 2020
Phase IV Deliverable
Team. We completed the deliverable for the fourth phase of this project over the weekend. Of the last few implementations, the only one which was troublesome was the one done in Ruby. The output from this language version during the current phase of our general-purpose controller's development is somewhat different than the others in this deliverable. A current archive with work from all of the phases is available on-line.
Hunt, Peck, and Think. The "perfect" solution will come more quickly, if you do.