[TYPO3-mvc] How to add a unique/primary key property to a manually created domain model?

Steffen Müller typo3 at t3node.com
Mon Feb 18 12:00:51 CET 2013


Hi.

Maybe a little OT, but inconsistencies might occur if you just store uid
of produts as items in your basket instead of full objects.
Imagine this case:
1) a customer picks a product and adds it as an item to his basket
2) then the product price is updated (e.g. raised) by an editor
3) then the customer finishes his order.

This will result in an unexpected higher price.

That's why I suggest to store objects instead of uids. Beside that,
using uids is not the DDD way to go, because uid is rather a convention
of the TYPO3 database than the identifier of your entity (product). I
guess the product has it's article id or whatever.

Here are some reading suggestions for session handling as a starting point:
http://www.typo3-media.com/blog/sessions-extbase-typo3.html
http://docs.typo3.org/flow/TYPO3FlowDocumentation/TheDefinitiveGuide/PartIII/SessionHandling.html
http://forge.typo3.org/projects/package-typo3-flow3/repository/show/Classes/TYPO3/Flow/Session?rev=master


-- 
cheers,
Steffen

TYPO3 Blog: http://www.t3node.com/
Twitter: @t3node - http://twitter.com/t3node


More information about the TYPO3-project-typo3v4mvc mailing list