Skip to content

Instantly share code, notes, and snippets.

@dualyticalchemy
Last active November 22, 2020 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dualyticalchemy/08bc39521e8e80a90219634a78fbc941 to your computer and use it in GitHub Desktop.
Save dualyticalchemy/08bc39521e8e80a90219634a78fbc941 to your computer and use it in GitHub Desktop.

Semiotic Web Architecture

This article explores various design patterns for developing ...

Addressing prior ReST constraints

Background

Design patterns were originally codified in Gang of Four's ... Today we develop using mixed patterns typically called MVC, MVVM, MVP, MOVE, etc.

These patterns may be useful in developing clients which correspond to hypermied-oriented servers (DARRT, etc.)

Schema

  1. https://www.jsonschema.net/login
  2. https://app.quicktype.io/

Authentication (authn)

JOSE vs PASETO...

Identity

If Zooko's triangle sufficiently maps to CAP theorem, we should abandon both in favor of CALM conjecture when dealing with identifiers in disorderly, declarative programming. Enables programming with guesses, apologies and promises.

By providing the programmer with a set of abstractions that are predominantly order-independent, Bloom encourages a style
of programming that minimizes coordination requirements. But as wesee in the destructive cart program, it is nonetheless possible to use Bloom to write code in an imperative, order-sensitive style. Ouranalysis tools provide assistance in this regard. Given a particular implementation with points of order, Bloom’s dataflow analysis canhelp a developer iteratively refine their program—either to “push back” the points to as late as possible in the dataflow, as we did in this example, or to “localize” points of order by moving them tolocations in the program’s dataflow where the coordination can beimplemented on individual nodes without communication. (https://dsf.berkeley.edu/papers/cidr11-bloom.pdf)

Authorization (authn)

Permission management

Vector Clocks

Steganography

Links relations in the data exchange format; also in the media type: https://www.wired.com/2012/07/squirrel/

  • Embed WinAmp in an mp3, give it a wallet for engaging in PKI (openchain is arguably more decentralized than Bitcoin and we can use DID here)

Cache Invalidation

Use configurable base directory in RequireJS. Related to Code On-demand.

Naming Things

Link Relations

Standard
Non-standard
  • Periodic Table of Information
  • Impossibility of Intent
  • Philonomics (Generative Identity and mental models of identity systems)

On-demand

  • DualAPI

Versioning

DO NOT VERSION only the base of the API; either all resources must be versioned or no resource should be versioned. Links should be made available for predecessor-versions.

Message Modeling

  • XDI graphs?
  • Use hashed YUML as generic tokens for representing underlying domain model changes for discovery layer of periodic table of information based on PKI, etc.
  • See https://en.wikipedia.org/wiki/VHDL

State management ...

Accounting

  • DHT?

SOLID

Functional Programming achieves SOLD. Domain-specific Languages

Bounded Context Canvas

See https://github.com/ddd-crew/bounded-context-canvas

Microservices Design Canvas

See https://dzone.com/articles/streamlined-microservice-design-in-practice

Scale Cube

See https://microservices.io/articles/scalecube.html

FOCTS

Factory

YUML

Sequence Diagrams

[a]-R-*>[b]

Entity-Relationship Diagrams

Example

Observer

Example

Composite

Example

Template

Example

Strategy

Example


EVFRS

Entity

Example

Value object

Example

Factory

Example

Repository

Example

Service

Example


SFBAS

Singleton

YUML

Example

Factory

YUML

Example

Builder

YUML

Example

Adapter

YUML

Example

State

YUML

Example

SFDOS

Strategy

Example

With ternary
const cond = await D();
const F = () => {};
const G = () => {};
const C = (R) => {
  R();
};
const S = cond ? F : G;
C(S);
Without ifs
const behaviors = [];
const behavior = () => {};
behaviors.push(behavior);
behaviors.push(behavior);
const F = (cond) => {
  const D = {
    P: () => behaviors[0],
    Q: () => behaviors[1]
  }
  D[cond]();
};

Factory

Example

const extend = () => {};
const base = () => {};
const F = (cond) => {
  if (cond) extend;
  return base;
};
const M = await D();
F(M);

Decorator

P and Q could be the cached results of knowledge reasoners or ontology checks available in Protégé (Fact++)

See https://www.w3.org/2001/sw/wiki/Category:OWL_Reasoner

Isn’t there a need for cacheing the results of the various reasoners in a FOL form? (https://www.w3.org/community/philoweb/2014/01/15/syllogism/)

Example

const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
const P = 'aRb';
const predicate1 = (value) => value === P
const predicate2 = (value) => value ? 'created' : 'deleted';
const D = compose(predicate1, predicate2);
const Q = 'aRb';
D(Q);

Observer

Use RxJS, ngrx, etc. https://resthooks.org, etc. Generally apply a publish-subscribe pattern. W3C has also worked on ActivityPub which involve subscription models which can be part of transaction script modeling or domain modeling.

Perhaps the Actor model of ActivityPub works well with Agent-centric models a la holochain, etc. But then again, data-centric approaches like Semantic Arts and MarkLogic (bitemporal data) give an alternative interpretation of these Data- and Agent-centric distinctions.

Also consider the Reactor pattern: https://www.npmjs.com/package/reactor-lib/v/2.3.3 Reactor can implement (im)mutability factors for Hypermedia-oriented Design.

Like many other rule languages including our earlier work on Overlog, Reactor updates mutable state in an operational step “outside Datalog” after each fixpoint computation. (https://dsf.berkeley.edu/papers/cidr11-bloom.pdf)

Generally CALM wants to unseat the assumption (axiomatic) in a schematism that suggests only storage semantics or coordination-based programs can be achieved according to CAP theorem. CALM conjecture proposes to use disorderly programming which distinguishes itself from temporal logic patterns like TLA+ (see SAM pattern).

Example

Singleton

Example


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment