[TYPO3-mvc] Where is the right place and naming style for services?

Bastian Waidelich bastian at typo3.org
Tue Jun 26 17:46:58 CEST 2012


Roland wrote:

Hi, once again ;)

> (1) where is the right/best place for services?
>
> /Classes/Service/
> /Classes/Domain/Service/

That greatly depends on your service.
If it is related to the domain of your extension (like the 
TagCloudService in the blog_example) it should go to Domain/Service. If 
it is a general utility service (like the Email service in FED) Service 
is a good place.

> (2) what is the prefered way to name services?
>
> EXT:blog_example: Tx_BlogExample_Domain_Service_TagCloudService
> EXT:fed: Tx_Fed_Service_Email

Following the FLOW3 Coding Guidelines [1] *Service would be correct.

Best,
Bastian


[1] 
http://flow3.typo3.org/documentation/codingguidelines/php.html#namespace-and-class-names


-- 
Bastian Waidelich
TYPO3 Core Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org




More information about the TYPO3-project-typo3v4mvc mailing list