PHP Classes

PHP Domain Driven Design: Domain driven design using domain logic classes

Recommend this page to a friend!
  Info   View files Example   View files View files (27)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 73%Total: 265 All time: 7,752 This week: 257Up
Version License PHP version Categories
domain-logic 1.0.0GNU General Publi...5PHP 5, Design Patterns
Description 

Author

This package presents an approach to domain driven design using domain logic classes.

It provides a set of classes that demonstrate how to implement domain logic with example models, services, strategies, as well specific data type object and mapper classes to use in the demonstration scripts.

Innovation Award
PHP Programming Innovation award nominee
August 2016
Number 5


Prize: One subscription to the PDF edition of the PHP Architect magazine
In simple terms, Domain Design Design is an approach for software development that departs from an evolving model of the problem to the implementation.

This package provides a demonstration of the application of the model driven design.

Manuel Lemos
Picture of Nemeth Zoltan
  Performance   Level  
Name: Nemeth Zoltan is available for providing paid consulting. Contact Nemeth Zoltan .
Classes: 9 packages by
Country: Hungary Hungary
Age: 46
All time rank: 157113 in Hungary Hungary
Week rank: 312 Up6 in Hungary Hungary Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php
/**
 * Domain Model example
 */
include_once __DIR__ . '/vendor/autoload.php';

$product = new \DL\Model\Product(1, new \DL\Strategy\ThreeWayRecognitionStrategy(30, 100));

$contract = new \DL\Model\Contract($product, date('Y-m-d H:i:s', time()));

echo
'<strong>Original Contract</strong>';

var_dump($contract);

echo
'<strong>Contract (Three way Recognition)</strong>';

$contract->calculateRecognitions();

var_dump($contract);


$product = new \DL\Model\Product(2, new \DL\Strategy\CompleteRecognitionStrategy());

$contract = new \DL\Model\Contract($product, date('Y-m-d H:i:s', time()));

echo
'<hr><strong>Original Contract</strong>';

var_dump($contract);

echo
'<strong>Contract (Complete Recognition)</strong>';

$contract->calculateRecognitions();

var_dump($contract);


Details

Domain Logic pattern

It's a basic sample for Domain Logic pattern

Installation

Please run the following command in the root directory:

php -f install.php


  Files folder image Files  
File Role Description
Files folder imagevendor (1 file, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file domain-model.php Example Example script
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file install.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file service-layer.php Aux. Auxiliary script
Accessible without login Plain text file table-module.php Example Example script
Accessible without login Plain text file transaction-script.php Example Example script

  Files folder image Files  /  vendor  
File Role Description
Files folder imageDL (5 directories)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  vendor  /  DL  
File Role Description
Files folder imageDTO (4 files)
Files folder imageMapper (1 file)
Files folder imageModel (7 files)
Files folder imageService (2 files)
Files folder imageStrategy (3 files)

  Files folder image Files  /  vendor  /  DL  /  DTO  
File Role Description
  Plain text file DTOInterface.php Class Class source
  Plain text file DTOModel.php Class Class source
  Plain text file MessageDTO.php Class Class source
  Plain text file UserDTO.php Class Class source

  Files folder image Files  /  vendor  /  DL  /  Mapper  
File Role Description
  Plain text file Product.php Class Class source

  Files folder image Files  /  vendor  /  DL  /  Model  
File Role Description
  Plain text file Contract.php Class Class source
  Plain text file MessageAssembler.php Class Class source
  Plain text file Messages.php Class Class source
  Plain text file Product.php Class Class source
  Plain text file RevenueRecognition.php Class Class source
  Plain text file Singleton.php Class Class source
  Plain text file Users.php Class Class source

  Files folder image Files  /  vendor  /  DL  /  Service  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file RecognitionService.php Class Class source

  Files folder image Files  /  vendor  /  DL  /  Strategy  
File Role Description
  Plain text file CompleteRecognitionStrategy.php Class Class source
  Plain text file RecognitionStrategy.php Class Class source
  Plain text file ThreeWayRecognitionStrategy.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:265
This week:0
All time:7,752
This week:257Up
 User Ratings  
 
 All time
Utility:93%StarStarStarStarStar
Consistency:93%StarStarStarStarStar
Documentation:81%StarStarStarStarStar
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:73%StarStarStarStar
Rank:147