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 the 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 the solution to your local workspace

Navigate to your workspace and clone the solution (see cloneGeneral 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

Open a new terminal from within VSCode.

Project Structure

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

These folders correspond to the namespace types that are described in Modeling DDD-Solution Section

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 acornym.

Each API namespace folder src-impl/api/api_ns_accr will contain a sub-folder named operations that will contain implemenation stubs & test stubs for each modeled oepration 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 acornym.

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

src-impl/domain/dom_ns_accr /agents

This folder will hold implemenation 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 implemenation stubs & test stubs for this entity
  • instance folder will hold all instance commands implemenation stubs & test stubs for this entity

src-impl/domain/dom_ns_accr /externals

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

src-impl/domain/dom_ns_accr /services

This folder will hold implemenation 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 acornym.

Each Integration namespace folder src-impl/integration/int_ns_accr will contain a sub-folder named services that will contain implemenation 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 oprations stub files
More specifically:
> src-impl
   > api
     > api_ns_accr1
       > operations
     > api_ns_accr2
       > operations
   > 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.