Tuesday, July 28, 2020

Phase Completion - Extension [ 08.31.2020 ] : Course Preparation

Team. The next season of teaching offers four "lecture" courses. This includes a programming fundamentals course in Python for an international on-line distance education program, a couple of remote delivery courses for a local community college, which likely will include an information literacy course, and a freshman computing elective at a local Jesuit university. Over the next few weeks, the author must prepare himself for this upcoming term. A couple of these "specific" courses the author has not taught previously, although he has given many similar lectures. He could enter each class session and "wing it", but that does make for the occasional "poor" performance.

The long and the short of it is this, he must postpone work on the fourth phase of this project. Which is about a 16.0 PH coding effort. It also requires refreshing some "long-forgotten" programming skills in C. Many of the modern languages, such a JAVA, C#, and etc., provide memory management under the hood and automatically allocates space as needed plus comes bundled with many useful data structures.

And, although this effort's goal is providing a "proof of concept" prototype for the CABOOSE controller pattern and not an "optimized", "professional-grade" solution, each language's object file should handle a reasonably-sized input. This includes the one created in C, whose language features for dynamically resizing data structures is "messier" than many other "more modern" languages.

So, we will plan on delivery of this phase by 08.31.2020, and the final multilingual project in fourteen "unique" languages well-before 01.01.2021.

Keep Coding Like a Bird-Brain. Hunt...Peck...Think...And, Let HIM Provide.

[Mat 6:26 KJV] 26 Behold the fowls of the air: for they sow not, neither do they reap, nor gather into barns; yet your heavenly Father feedeth them. Are ye not much better than they?

Friday, July 10, 2020

[ Meta is Betta ] - Architectural Language for Controllers - [ The Compiler ]

Team. During a previous entry in this web history, we defined a "meta-language" for controlling a simple CABOOSE controller. As described in the text CABOOSE in JAVA by Abraham Vati James, these control files were specified using eXtensible Markup Language (XML).

When we started the implementation of this controller pattern for this multilingual project, we decided that we would use the simplest approaches available. The modules which process XML in these languages were not well-known; yet, it seemed that using them would produce a "wordier" solution than describing the control file using a format based upon Comma Separated Values (CSV).

CSV files can be properly handled with standard file processing and string functions. And, with some extra logic, our "bespoke", or custom, CSV format with sections is easily processable. It is below.

begin,  views

viewId,       stencil

landing,     /WEB-INF/model/xstencil.xhtml
exception,  /WEB-INF/model/exception.xhtml

end,     views

begin,  placeholders

?We can even implement comments on all lines prefixed with a "single" question mark

viewId,    placeholderId,    class,   method

landing,  #PROJECT#,   org.sharpe.sample.StencilHandler,  projectRenderer
landing,  #MODULE#,  org.sharpe.sample.StencilHandler,  moduleRenderer
landing,  #CREATE_DATE#,  org.sharpe.sample.StencilHandler,  createDateRenderer
landing,  #HIBERNATE_MESSAGE#,org.sharpe.sample.StencilHandler, hibernateMessageRenderer
landing,  #JAXWS_MESSAGE#, org.sharpe.sample.StencilHandler, JAXWSMessageRenderer
landing,  #JAXRS_MESSAGE#, org.sharpe.sample.StencilHandler, JAXRSMessageRenderer

exception,  #EXCEPTION_MESSAGE#,  org.sharpe.sample.StencilHandler,exceptionRenderer

end,     placeholders

And, with the proper conditions, we can permit extra white-space for readability. This controller file came with a sample CABOOSE pattern implementation for a JAVA Enterprise Edition servlet that pulls information synchronously from a Hibernate database, a JAVA JAX WS web service, and a JAVA JAX RS (RESTful) web-service.

For our project, we likely will create a control file in this CABOOSE meta language that will populate three of four unique views and a general-use exception view. This will be a proof of concept. The above CABOOSE file produces one test view called "landing" and an "exception" page.
On the landing page, all of the #PLACE_HOLDERS# are replaced with the string returned by the class and method named on the same line. In JAVA, these classes must be in the "classpath" of the web application.

We will produce a "naive" compiler for this language. Although we will parse each line and fill data structures, such as associate arrays, dictionaries, hash tables, or maps, with the information describing the process flow, this procedure will be much simpler than generating an object file from a C or C++ file. It will not require producing machine language or byte code instructions from a high level language specification. We will simply store the processing logic in data structures that will permit near instantaneous access. So, when one request a "view", its specification in HTML can be quickly found within the storyboard model along with a list of placeholders and methods which will replace them with content strings.

This compiled logic will depend upon the use of dynamic invocation when calling the placeholder replacement methods. Dynamic linking is a "tad" bit slower than the static linking that commonly is done. Yet, this approach allows for a much better partitioning of the system concerns. However, one might create a "naive" code generator that builds a "well-structured" and "well-formatted" switching statement from the description found in the CABOOSE meta-language file. Its logic could contain processing for reading the appropriate view and populating it with string replacement. Plus, it could contain statically linked methods which will render the content for the placeholders.

With the use of one's imagination, he can see how a "simple" text-based menu-driven system could be built with a CABOOSE pattern and its associated language. One can also obviously see that he could build a web-based system with an HTML storyboard. And, one could be a traditional client-side graphical user interface system, if he defined a declarative of markup type language for describing the windows and forms. This is the most flexible solution for application building.

Our next phase, will see use reading in the meta language file, placing its contents in a data structure, and then echoing these contents. The plan on a three week turn around on this step, although it probably could be completed in eight hours or less be an accomplished engineer.

Keep It Simple. Happy Hunting, Pecking, and Thinking.