Implementation of a Solution

At this point it is assumed that the initial setup and the mandatory commands of the Solution CLI have been performed and executed as described.

Create a new Solution Workspace

After you have created a solution in Solution Designer and modeled it according to DDD specifications, create a folder for your workspace.

Open a terminal and navigate to your development workspace folder

Example:

cd /my/workspace/

Clone Solution to Local Workspace

Navigate to your workspace and clone the solution (see clone General commands).

The necessary command you can access in the Solution Designer, open the Solution navigate to Solution CLI tab.

fss clone --solution SolutionA

A folder in your workspace will be created for the cloned solution, folder name will be solution acronym.

Example:

/my/workspace/SolutionA

Open Project

Open your solution project folder in VSCode, then open a new terminal from within VSCode.

Project Structure

The project is structured into 3 main folders under src-impl folder api, domain and integration.

These folders correspond to the namespace types that are described in Modeling Low-Code Solutions

src-impl/api

This folder will contain sub-folders. Each sub-folder represents a modeled API namespace where the folder name is the api namespace acronym.

Each API namespace folder src-impl/api/api_ns_accr will contain a sub-folder named operations that will contain implementation stubs & test stubs for each modeled operation in this API namespace

src-impl/domain

This folder will contain sub-folders. Each sub-folder represents a modeled Domain namespace where the folder name is the Domain namespace acronym.

Each Domain namespace folder src-impl/domain/dom_ns_accr will contain the sub folders below

src-impl/domain/dom_ns_accr /agents

This folder will hold implementation stubs & test stubs files for all agents under this domain namespace

src-impl/domain/dom_ns_accr /aggregates.

This folder will contain sub-folders, each one represents a root entity under this domain namespace.

Each entity folder src-impl/domain/dom_ns_accr /aggregates/entityA will contain two sub-folders factory & instance where:

  • factory folder will hold all factory commands implementation stubs & test stubs for this entity
  • instance folder will hold all instance commands implementation stubs & test stubs for this entity

src-impl/domain/dom_ns_accr /externals

This folder will hold implementation stubs & test stubs files for all external entities under this domain namespace

src-impl/domain/dom_ns_accr /services

This folder will hold implementation stubs & test stubs files for all services under this domain namespace

src-impl/integration

This folder will contain sub-folders, each sub-folder represents a modeled Integration namespace where the folder name is the integration namespace acronym.

Each Integration namespace folder src-impl/integration/int_ns_accr will contain a sub-folder named services that will contain implementation stubs & test stubs for each modeled service in this integration namespace.

Attention: It is the solution engineer’s responsibility to implement the logic for these operations stub files
More specifically:
> src-impl
   > api
     > api_ns_accr1
       > operations
       > middleware       
     > api_ns_accr2
       > operations
       > middleware
   > domain
      > dom_ns_accr1
        > agents
        > aggregates
           > RootEntity1
             > factory
             > instance
        > externals
        > services
      > dom_ns_accr2
        > agents
        > aggregates
          > RootEntity1
            > factory
            > instance
          > RootEntity2
            > factory
Attention: It is possible to create additional stubs (.ts files) anywhere within the src-impl folder and implement reusable methods by using the syntax:
export function doSomething() {
    // write reusable code
}
In order to call this function from commands and services, start typing the name of the function and it will automatically recognise it.