Download the PHP package bamiz/use-case-executor without Composer

On this page you can find all versions of the php package bamiz/use-case-executor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package use-case-executor

Use Case Executor

Use Case Executor is a library that facilitates a certain way of implementation of Screaming Architecture. From the point of view of this library, every Use Case of your system is implemented in its own class, with a single public method: execute(). Any data that the Use Case requires to be executed is passed to the execute() method in a form of a Use Case Request object, which is a simple data structure, preferably a class with all its fields public. Any data that needs to be presented to the Actor (the outside-world executor of the Use Case) is returned in a form of a Use Case Response.

Use Case Requests and Responses belong to the business logic layer. They must know nothing about the way in which the application receives its data (the application's Input), and the way in which the application presents the data (the application's Output). This means that the Input must be processed, so that the data required by the Request are retrieved from it and put into the proper Request object. Similarly, the Response that the Use Case returns must be processed, so that a proper Output that contains information interesting to the Actor is created and returned. Use Case Executor uses Input Processors and Response Processors to perform these operations.

Once a separation like described above has been achieved, the dependencies between the application layer and the business logic layer present themselves like this:

Installation

Just run

$ composer require bamiz/use-case-executor

Basic usage

Create a class that represents a Use Case of your system. Implement its behavior in execute() method. Pass all the required input data as an object, preferably named like your Use Case plus the word Request.

In the bootstrap section of your application you will need to set up the dependencies of Use Case Executor. Set up Input Processor Container and Response Processor container by adding the default Processors to them.

Create a Container for your Use Cases and add your Use Case to it. Set up the Context Resolver with all the containers.

Add the configuration of the Use Case to the Context Resolver. The minimum configuration contains the Use Case name and its Request class name.

Create a Use Case Executor:

Use the Executor to execute your Use Cases. Leave the details of processing the Input and creating the Output to the Input and Response processors:

See also


All versions of use-case-executor with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
symfony/options-resolver Version ~2.3|~3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bamiz/use-case-executor contains the following files

Loading the files please wait ....