2017 © Pedro Peláez
 

library yii2-domain

Implementation of DDD key concepts for Yii2.

image

dekeysoft/yii2-domain

Implementation of DDD key concepts for Yii2.

  • Wednesday, October 11, 2017
  • by DeathAngel
  • Repository
  • 4 Watchers
  • 11 Stars
  • 396 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 20 Versions
  • 1 % Grown

The README.md

, (*1)

Build Status Tested By Latest Stable Version Monthly Downloads Total Downloads License , (*2)

Yii2 Domain is a Domain Driven Design patterns implementation for Yii2., (*3)

Includes realization of a following patterns: - Repository - Entity - Specification (very rough implementation through ActiveQuery) - Strategy, (*4)

Requirements

PHP >= 7.1 is required., (*5)

Getting Started

Run the following command to add Yii2 Domain to your project's composer.json. See Packagist for specific versions., (*6)

composer require php-kitchen/yii2-domain

Or you can copy this library from: - Packagist - Github, (*7)

For additional information and guides go to the project documentation, (*8)

Overview

Goal of this library is to introduce Domain Driven Design(DDD) principles to Yii2 projects and to fix ActiveRecord problem of domain layer in applications with medium and large domain area., (*9)

Each model represented as a standalone directory that contains repository, entity, record and query classes. All of these classes represent a domain model., (*10)

DIRECTORY STRUCTURE OF A TYPICAL MODEL(AS EXAMPLE - USER MODEL)

  user/                    contains all of the classes that represents domain model
        UserRepository     model repository
        UserEntity         model entity(represents domain entity - not the DB table that containd entity information) 
        UserRecord         DB record that contains entity information
        ProfileRecord      DB record with additional information thta also a part of the UserEntity.
        UserQuery          query class of model e.g. - specification of the entity

Code examples

Simple search and store:, (*11)


$repository = new UserRepository(); $entity = $repository->findOneWithPk(1); // do some manipulations with entity $repository->validateAndSave($entity);

Complex criteria search and deleting:, (*12)


$repository = new UserRepository(); $entity = $repository->find() ->active() ->withoutEmail() ->one(); // do some manipulations with entity $repository->delete($entity);

Note:

this library is designed to solve ActiveRecord problem of Yii 2. Don't use this library if you are starting a new project and looking for a solution that would allow you to build a decent architecture - you need a good framework that would allow you do build high-quality solution and Yii 2 is not a framework that would allow you to build high quality architecture and implement rich domain layer., (*13)

"Yii2Domain" library is a crutch designed to solve issues of domain layer caused by ActiveRecord in existing projects. There are few decent solutions to build domain layer in a new project: - Spot ORM - Symfony + Doctrine (preferable solution) - Eloquent ORM (if you like Laravel and you are not working with enterprise applications), (*14)

Contributing

If you want to ask any questions, suggest improvements or just to talk with community and developers, join our server at Discord, (*15)

The Versions

11/10 2017

dev-master

9999999-dev

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

13/09 2017

0.0.18

0.0.18.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

12/09 2017

0.0.17

0.0.17.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

07/08 2017

0.0.16

0.0.16.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

13/07 2017

0.0.15

0.0.15.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

13/03 2017

0.0.14

0.0.14.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

13/03 2017

0.0.13

0.0.13.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

27/02 2017

0.0.12

0.0.12.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

27/02 2017

0.0.11

0.0.11.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

27/02 2017

0.0.10

0.0.10.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

21/02 2017

0.0.9

0.0.9.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

21/02 2017

0.0.8

0.0.8.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design clean code

10/02 2017

0.0.7

0.0.7.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

10/02 2017

0.0.6

0.0.6.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

10/02 2017

0.0.5

0.0.5.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

09/02 2017

0.0.4

0.0.4.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

09/02 2017

0.0.3

0.0.3.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

08/02 2017

0.0.2

0.0.2.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

07/02 2017

0.0.1

0.0.1.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design

03/02 2017

0.0.0

0.0.0.0

Implementation of DDD key concepts for Yii2.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Kolodko

repository yii2 entity specification ddd strategy finder domain driven design