定制 so-lean/cleanprospecter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

so-lean/cleanprospecter

Composer 安装命令:

composer create-project so-lean/cleanprospecter

包简介

P.O.C. of clean architecture (unclebob)

README 文档

README

PR CI maintanibility coverage

Cleanprospecter

Cleanprospecter is a php 7.2 business prospect application designed according to Robert C. Martin recommendations for clean architecture.

Add cleanprospecter in your project with composer.

 $ composer require so-lean/cleanprospecter

A symfony 4.1 implementation can be found on github here

Progress

Consider that scope as the minimal viable product.

  • As anonymous, I want to login
  • As main app, I want to refresh user
  • As prospector, I want to create organization
  • As prospector, I want to find my own organizations
  • As prospector, I want to get organization
  • As prospector, I want to update organization
  • As prospector, I want to create organization
  • As user, I want to get my account information
  • As user, I want to update my account information
  • As user, I want to remove my organization logo
  • As prospector, I want to create prospect
  • As prospector, I want to find my own prospects
  • As prospector, I want to create phone call event
  • As prospector, I want to create appointment event
  • As prospector, I want to create email event
  • As prospector, I want to create sms event
  • As prospector, I want to find my own prospects

In the future

  • tags
  • auto import events from email box, short message service etc...
  • email marketing campaign

Clean architecture -Business rules as a simple composer package.-

The Clean Architecture

A good explanation is available in this Uncle Bob talk here

A GOOD ARCHITECTURE MAXIMIZES THE NUMBER OF DECISIONS NOT MADE

  • UNCLE BOB

Terminological differences

In order to clarify some uncle bob concepts

  • Interactors becomes use cases and are locatated in src/UseCase/UseCaseName and take its name from it : ex FindMyOwnOrganizations
  • Request an response are data transfer object and are located at the same place : ex FindMyOwnOrganizationsRequest, FindMyOwnOrganizationsResponse
  • Presenter interface (Dependency inversion) too : ex FindMyOwnOrganizationsPresenter
  • Gateways is not only database abstraction, entity gateway are located in src/Gateway/Entity

How to implement cleanprospecter

Clean architecture use dependency injection to build uses cases.

1 You need to implement all Gateways in your main application

  • Build use cases in the IOC
  • Register it in the facade.
    // in IOC
    
    //OrganizationGatewayImpl implements OrganizationGateway interface
    $organizationGateway = new OrganizationGatewayImpl();
 
    $useCase = new GetOrganizationImpl($organizationGateway);
    
    //Create facade and register use case
    $facade = new UseCasesFacade();
    $facade->addUseCase($useCase);
    // in controller (or somewhere else)
    $request = new GetOrganizationRequest(7);
    
    //presenter implements GetOrganizationPresenter
    $presenter = new GetOrganizationPresenterImpl();
    
    //all use case is accessible by their name 
    $facade->getOrganization($request, $presenter);

A use case can say what it does

   //...
   
   $useCase = new GetOrganizationImpl($organizationGateway);
   
   echo $useCase;
   
   //Display : "As prospector, I want to get organization"

Developer tools

prerequisites

  • docker
  • docker-compose

All common command lines are accessible by the Makefile. Make create a docker image based on official php alpine docker image (php 7.2.3) with xdebug and composer installed globally.

    $ make

Commands

make command

Command comments
build-env Build the docker env file tagged prospecter-run
composer install vendors
composer-update update vendors
test execute tests suite
testdox execute tests and write agile documentation in text format
test-coverage execute tests and generate report in html format
cs code sniffer
cs-fix fix automatically code sniffer errors

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固