Pada tingkat apa itu termasuk: aplikasi atau domain?

Di mana saya harus meletakkan ini?

, ( ) () , : : ? , - - . , , , - :





? , .





2

(Dependency rule): . , . (Infrastructure) (Application). (Domain). , . , /API, . , , . . ; , -- (Application-as-an-interface).





, Β« Β». PurchaseEbookController



, , PurchaseEbook



, PurchaseEbookService



. , . Purchase



PurchaseRepository



, . PurchaseRepositoryUsingSql



, PurchaseRepository



.





PurchaseRepository



? (, ). Purchase



. . , , , . , .





? , . API, .





-- ApplicationInterface?

, : API, , interface



. ,





namespace Application;

interface ApplicationInterface
{
    public function purchaseEbook(PurchaseEbook $command): void;

    /**
     * @return EbookForList[]
     */    
    public function listAvailableEbooks(): array;
}
      
      



, listAvailableEbooks()



, , ApplicationInterface



.





, -- - , . , , . , . ApplicationInterface



, , , . , ​​ , . .






PHP-? β€” .

Middle+ , PHP.



-, : β€œ ? ?”



-









All Articles