[TYPO3-mvc] Extbase Domain-Service
Jochen Rau
jochen.rau at typoplanet.de
Wed Dec 23 00:04:51 CET 2009
Hi.
schrieb Thomas "Thasmo" Deinhamer:
> Regarding DDD I read that processes that don't belong to
> the domain of a model or a repository, could or should
> be handled by services - which are also available in Extbase.
>
> I'd like to calculate the current stock amount of a product,
> based on several circumstances, like a number of products
> which are not available or another number of products which
> are on reapair etc.
>
> Furthermore I need to predict the available stock amount
> also based on a given, specific date.
>
> The predicted stock amount for a specific date should then
> be displayed in the frontend.
>
> How can this be done? Do I need a service for this, or can
> this be handled inside the product model or the controller?
A Tx_..._Domain_Service_StockCalculatorService seems to be a good choice
to me.
The product model is not aware of how many other products are in stock.
The controller has no clue about the domain logic of the business case.
It should be as 'thin' as possible.
Regards
Jochen
--
Every nit picked is a bug fixed
More information about the TYPO3-project-typo3v4mvc
mailing list