User Guide


What is Solvent-LastMile?

LastMile lets business application developers leverage components and code snippets created by other developers to quickly compose applications. In other words LastMile helps business application developers solve the application "last-mile" problem, ie how to quickly create something useful on top of a robust technology stack without getting bugged down in detail.

LastMile is a product meant to allow developers to quickly build business applications. Such applications typically don't have complicated architecture, just a quick way to clue a set of functionality together.

Note that LastMile is built on top of the ConfigNode product, which it self is built on top of the Solvent WebApps product platform. This means the LastMile documentation only covers topics specific to LastMile. Users should consult the ConfigNode and Solvent WebApps product documentations for how to use the platform as a whole.

Have ideas, suggests or thoughts? post to the LastMile GitHub repo.

Component Composition Language.

At the heart of LastMile is the notion of a component composition language. This is simply a schema (JSON or YAML) that describes how a given component can be integrated into an application, ie how to compose applications using the component.

It is a simple yet powerful concept because it allows the developer who knows the component best, to provide direct guidiance on how to use a component.

A component developer decides how they wish to design the language for composing their component, there are no hard-and-fast rules for doing this. Every component will have a different language that describes its possible compositions based on what the component does and how it works.

What a composition language should try to do is capture both the workflow and the resulting code artifacts to produce a given result. In some ways this can be thought of as similar to user interface macros that record actions for replay, except here the code snippets are the results.

The expectation is that over time, best practices will emerge from the community of component developers and users for how best to design composition languages.

Composition Primitives

With a schema based composition language, a developer can turn any combination of code snippets into primitives for compositions including actual components such as Vue/React/Angular/WebComponents...etc. Any set of code snippets that can be combined into solid functionality, can be thought of as composition primitives.

For instance a site such as bootsnipp host code snippets, such snippet can serve as primitives for a composition.

Usecase Analysis

In order to develop a composition language, a component or snippet developer needs to think thoroughly about how users will ultimately want to integrate the component. The more comprehensive this analysis is, the more robust the resulting composition language is likely to be.

In essence as a component or snippet developer, you basically have to think of as many integration scenarious as possible, and then implement those scenarious with your composition primitives.

This approach is a step or two above an API developer who merely needs to create a robust interface and let the implementor worry about how they will implement the API. With composition language design, the component developer needs to go much further into the implementation process. One could call this forward integration, analogous to a similar process in supply chains.

It means more work for the component developer since they have to do comprehensive use-case analysis in order to develop a set of composition scenarios, however, the benefit is a significant productivity boost for every other business application developer who wishes to use the component thus making the component much more valuable.

Authoring A Composition Language

To author a composition language in LastMile, you'll simply author a schema as described in the ConfigNode documentation.

Once a language is authored, it can be imported by users into LastMile as described the ConfigNode documentation.

Composition languages

They can be designed in whatever way suitable, both for full application structures or for individual components.

How a component developer distributes their components and the composition language is up to them.

Authoring Compositions

Authoring compositions is the act of a user using a composition language schema to create an application.

To author a composition in LastMile, you'll simply create object graphs as described in the ConfigNode documentation.

The composition language/schema will guide the user and auto-fill all code snippets required to compose the application. The user of course can then complete the task of writing the necessary code and/or providing the necessary configuration values to build their application.

The options provided are entirely up the the composition language designer and ultimately comes down to how sophisticated the language is meant to be.

Compiling Compositions.

When a component user/developer creates a composition via the aide of a composition language, the resulting composition would need to be compiled into some resultant code artifact.

Just as there are no hard-and-fast rules for creating composition languages, there are no such rules for creating compilers. The behaviour of a compiler would be entirely based on the language of course and it is up to the component developer to implement the compiler.

A compiler can be implemented either as client side logic, maybe via a loader that processes JSON or it can be server side.

The most crude compiler would be a simple object traversal algorithm that extracts markup from an object graph and concatenate it to be outputed as HTML.

The more sophisticated the composition language, the more sophisticated the compilation process would be.

Here's a very crude example of the previous composition being compiled into an actual VueJS application.

An apps compilation can be done at request time or it can be integrated as part of a standard build process, it is up to implementors to decide.