Categories
Engineering

Forge an Exoskeleton Framework for Laravel

WORK IN PROGRESS – DRAFT

What is Forge Framework?

Forge Framework (#phpffw) is a methodology used to develop micro to large scale applications.

It is inspired by Domain Driven Design and built with the PHP Laravel Framework.

It is the hope of this project to create a methodology which allows software engineers, designers, and product managers to collaborate, communicate and move from project to project seamlessly.

It provides a set of established practices and removes the guess work out of working on software projects.

This will give individuals, Startups and Fortune 100 companies confidence to build their ideas and businesses in a standard and systematic way well into the future.

The Common Language

This serves as a glossary of sorts to help understand and interpret the rest of this document.

Action – is a single unit of work (task). Usually a single step in a larger set of actions in order to accomplish the product developer’s requirements.

Application interface – is the way in which a client is allowed to interact with the software solution. e.g. Console command, HTTP, or TCP/IP.

Application infrastructure – is the technology platform used to meet theproduct developer’s requirements.

Backend – is the implementation of the software solution.

Client – is a person or machine that interacts with the software solution.

Data transfer object – is a technology agnostic representation of the software solutions data.

Domain – is a (grouped) set of related processes. This can be considered similar to how a business has several isolated departments and these departments work together to carry out the requirements of the business.

Frontend – is the user interface used to send a request to the backend for processing. Frontend typically is a web browser or terminal console.

Product Developer – is a person or organisation that has commissioned the software solution to be created and/or maintained.

Repository – is the mechanism by which the software solution is able to interact and manipulate the chosen application infrastructure.

Software solution – is the set of processes that are used to satisfy the product developer’s requirements.

Process – is the steps required to accomplish a product developer’srequirement.

Theory of Operation

The lifecycle of software solutions built using FFw is depicted below.

client, which can be a person or a machine, makes a request. Their request comes into the backend usually via a frontend.

The application interface is responsible for understanding, interpreting and responding to the request. The request can be in the form of HTTP, Console command, TCP/IP connection or any other means that a client can use to interact with the backend.

Once the application interface has interpreted the request of the client it will invoke the corresponding process for that domain. A domain is group of related processes. A Process is a set of actions. An action is a step in a sequence, to accomplish a product developer’s requirements, to satisfy the request of the client.

The process depending on what is required, will use a repository to access the application infrastructure to create, read, update, delete or otherwise process the request. A repository is a middle man that coordinates with the application infrastructure to get access to the underlying technology (filesystem, database, API) that stores, retrieves and manipulates the data required for the product developer’s requirements to be fulfilled.

The application infrastructure after processing the repository’s request will return data as a data transfer object. A data transfer object is a technology agnostic representation of the data returned by the underlying platform used to store, retrieve and manipulate software solution’s data.

The data transfer object is returned to the process which (possibly after further processing) returns the result to the application interface. Theapplication interface then transforms it into a form that the client will understand (or has requested) e.g. JSON:API.

Technical Walkthrough

Let’s consider this request, a client wishes to see all invoices.

The client uses their web browser to visit the following web page https://example.com/invoices.

  1. The application interface will match the URL of the web page to a route.
  2. Once the route (/invoices) has been matched, the router will load the corresponding controller (InvoiceController.php) in the application interface which is responsible for executing the process 
    ( e.g. Receivables/ListInvoices.php ) and then return the appropriate application response to the client.
  3. The process will access the underlying application infrastructure via the repository (InvoiceRepository.php) and will retrieve the data requested.
  4. The repository will return the result as a data transfer object(InvoiceCollection) which the process returns to the application interface.
  5. Finally the calling controller transforms the result into the JSON:API format and returns it to the frontend.
  6. The frontend renders the JSON:API formatted data in to a list that the client can now view.

The ABCDs of Forge Framework

Let’s walk through how to add, browse, change and delete resources.

Leave a Reply

Your email address will not be published.